Live data from Hacker News

Building a coding agent in Swift from scratch

github.com

21–30 of 30 posts

Re: Building a coding agent in Swift from scratch

#23
post #9

the interesting design tension i ran into building in this space is context management for longer sessions. the model accumulates tool call history that degrades output quality well before you hit the hard context limit - you start seeing "let me check that again" loops and increasingly hedged tool selection.a few things that helped: (1) summarizing completed sub-task outputs into a compact working-memory block that…

So that’s what it is! I was wondering why reducing context and summarising still makes it make mistakes and forget the steering. And couldn’t find explanation to why it starts ignoring instructions when context is not full at all. How did you find that tool call is what degrades it? Isn’t this a biggest problem there is and not just “design tension”?

Re: Building a coding agent in Swift from scratch

#24
I'm reading the first of the blog posts. I've never actually seen any Swift code before, but looking at the package definition I'm struck by how much it looks like Zig. I've never heard Andrew Kelly call Swift out as an influence, but it seems some Swift DNA is in Zig.

Also, brave calling it swift-claude-code given Anthropics behavior.

Re: Building a coding agent in Swift from scratch

#26
post #22

It’s not quite clear that this project is- there’s no “Claude code” a program. There’s tui/gui app, harness, prompts, and LLM. so this is a harness part?

It's the harness/orchestration layer — the part that runs the agent loop, dispatches tool calls, and manages context.

Re: Building a coding agent in Swift from scratch

#27
post #24

I'm reading the first of the blog posts. I've never actually seen any Swift code before, but looking at the package definition I'm struck by how much it looks like Zig. I've never heard Andrew Kelly call Swift out as an influence, but it seems some Swift DNA is in Zig. Also, brave calling it swift-claude-code given Anthropics behavior.

Interesting observation on package definitions. Languages borrow good ideas from each other all the time, and the ecosystem is better for it.

On the naming fair point, already renamed the CLI binary after an earlier comment here. The repo name is more about discoverability.

Re: Building a coding agent in Swift from scratch

#29
post #23
post #9

the interesting design tension i ran into building in this space is context management for longer sessions. the model accumulates tool call history that degrades output quality well before you hit the hard context limit - you start seeing "let me check that again" loops and increasingly hedged tool selection.a few things that helped: (1) summarizing completed sub-task outputs into a compact working-memory block that…

So that’s what it is! I was wondering why reducing context and summarising still makes it make mistakes and forget the steering. And couldn’t find explanation to why it starts ignoring instructions when context is not full at all. How did you find that tool call is what degrades it? Isn’t this a biggest problem there is and not just “design tension”?

[dead]

Re: Building a coding agent in Swift from scratch

#30
post #24

I'm reading the first of the blog posts. I've never actually seen any Swift code before, but looking at the package definition I'm struck by how much it looks like Zig. I've never heard Andrew Kelly call Swift out as an influence, but it seems some Swift DNA is in Zig. Also, brave calling it swift-claude-code given Anthropics behavior.

Interesting observation on package definitions. Languages borrow good ideas from each other all the time, and the ecosystem is better for it. On the naming fair point, already renamed the CLI binary after an earlier comment here. The repo name is more about discoverability.

Agreed. I wasn't saying it's a bad thing, just interesting.

The thing that really stuck out to me was the dot syntax:`.SomeVariable`. I'm guessing those are enum accesses where the compiler can figure out what it is from context? It's all over Zig, and it seriously screws with me lol. I know it's a me problem, but I can never keep straight what's what.

Post reply on HN