Settings

Theme

Show HN: A simpler coding agent harness

4 points by pyrolistical 19 days ago · 2 comments · 2 min read


The system prompts that coding agent harnesses pass to language models are massive. They describe every available tool in detail — even the ones you never use.

So I wondered, what if I built something more minimal?

I tend to work on small projects where all the code fits in the context window. So I built a harness with a single tool: the ability for an LLM to edit my files.

The core algorithm:

1. Read every file in the project directory

2. Concatenate them with the user's prompt into a single message

3. Send it to any language model, instructed to respond with a message and a list of edits — each edit being a search and replace on a specific file

4. Apply the edits

I tried getting the LLM to generate unified diffs, but it kept producing malformed ones. Search and replace turned out to be far more reliable — the model copies text verbatim from the files already in its context.

This can be extended with a few more features:

1. A CLI that lets you continue the conversation or reset it. Dumber LLMs need this so it can see the mistake they made.

2. Automatic retries — if an edit fails, re-send the current files and have the LLM fix its own search blocks.

3. File deletion. I made it so that an empty search-and-replace on an empty file deletes it.

The LLMs I tested were local ones running through the LM Studio API. Gemma 4 was pretty bad. Qwen 3.5 was significantly better.

Where is the source code? You should be able to get any coding agent to generate you one using this post.

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection