Part 4 · Engineering Patterns for Reliable Agents

Initializer + Coding Agent

The initializer sets up the environment, the coding Agent progresses incrementally — a dual-role Harness design

THE QUESTION THIS PAGE ANSWERS

ANSWER FIRST

What is the key idea behind “Initializer + Coding Agent”?

The initializer sets up the environment, the coding Agent progresses incrementally — a dual-role Harness design

DECISION RULE

Make the claim earn its place. Use this page as a decision aid, not a definition to memorize. Connect the idea to one real task, one observable result, and one failure that would change your mind.

TRY NEXT

Write one question you could answer with evidence after trying this idea.

WATCH FOR

A conclusion that sounds complete but leaves the key assumption untested.

Dual-role Solution
Two Agents, clear division of responsibility
Runs on first round only
Initializer Agent
Responsible for bootstrapping: set up environment, define the plan, make the first commit
  • Create init.sh script to set up the dev environment
  • Write claude-progress.txt progress file
  • Expand user's high-level prompt into a detailed feature checklist (JSON format)
  • Make the first git commit, ensuring the repo is in a clean state
Runs every round
Coding Agent
Responsible for continuous progress: implement features one by one, keep moving forward
  • Read the progress file to understand the current state
  • Do one feature at a time
  • Update the progress file after completion
  • git commit with a clear message of what was done
Feature Checklist Design

A proven approach is to use JSON format for the feature checklist — Markdown is not suitable for this purpose. The reason: models are less likely to accidentally modify structured JSON, whereas Markdown tends to get rewritten by the model.

// feature checklist in claude-progress.txt { "features": [ { "category": "authentication", "description": "Email/password login with session management", "steps": [ "Create login form component", "Implement auth API endpoint", "Add session cookie handling", "Write end-to-end test" ], "passes": false }, { "category": "chat", "description": "Real-time streaming chat with Claude API", "steps": ["..."], "passes": false } ] }
Use strong wording in the Prompt: explicitly tell the Agent "do not delete or modify existing test content." Otherwise the Agent will lower test standards just to make tests pass.
Incremental Progress: One Feature at a Time
Why "one at a time" is the key
  • 1 After completing each feature, the code is in a mergeable state: no half-baked work, no syntax errors
  • 2 Git commits provide rollback points: if the next round breaks something, you can return to the last clean state
  • 3 The progress file provides context: a new Agent doesn't have to guess where things are — just read the file
  • 4 The context window won't overflow: each round only needs context for one feature, preventing accumulation to the limit
Test Verification

Agents often think they're done but haven't done end-to-end verification. It says "login feature is implemented," but the button doesn't actually click. Solution:

Explicitly require the Agent to do end-to-end testing with browser automation.
You need to actually open a browser, click buttons, and verify results — unit tests alone are not enough. Have the Agent write E2E tests with Puppeteer / Playwright as the criterion for whether a feature truly "passes."
Final Result
200+ feature claude.ai clone successfully built
Using the Initializer + Coding Agent dual-role pattern, the Agent successfully autonomously built a complete web application with 200+ features. Every feature has a corresponding E2E test, and the code always remains in a mergeable state.
Good handoff mechanism = good long-running Agent. Progress files, feature checklists, incremental commits — these are the most basic guarantees for an Agent to keep moving forward. Nothing fancy.

How “Dual-role Solution” changes an answer

“A proven approach is to use JSON format for the feature checklist — Markdown is not suitable for this purpose.” shows that a model does not process the “word count” we see. It processes Token pieces. Tokenization affects input length, how much context fits, and how much computation a request consumes.

Length, information, and context are different

As “Agents often think they're done but haven't done end-to-end verification.” grows, separate three questions: how many Tokens the text becomes, which pieces can change the current decision, and whether older material has fallen outside the context window. Removing repetition is often more useful than simply making the window larger.

  • Create init.sh script to set up the dev environment
  • Write claude-progress.txt progress file
  • Expand user's high-level prompt into a detailed feature checklist (JSON format)

Keep what can change the decision

Use “Agents often think they're done but haven't done end-to-end verification.” as an A/B test: keep the same question while removing repeated background, compressing format, and trimming irrelevant history. Compare answer quality, latency, and Token count.

From “Dual-role Solution” to “Feature Checklist Design”

“Dual-role Solution” grounds the problem in “Two Agents, clear division of responsibility Runs on first round only Initializer Agent Responsible for bootstrapping: set up environment, define the plan, make the first commit Create init.sh script to set up…”. “Feature Checklist Design” then moves it toward “A proven approach is to use JSON format for the feature checklist — Markdown is not suitable for this purpose. The reason: models are less likely to accidentally modify structured JSON, whereas Markdown tends t…”. Together, they show that the lesson is not just a conclusion to remember, but a claim with conditions.

Carry the judgment into the next situation

For long text, keep what can change the conclusion before compressing format and history. A larger context is worth its cost only when the added information is useful.

  • “Dual-role Solution”: Two Agents, clear division of responsibility Runs on first round only Initializer Agent Responsible for bootstrapping: set up environment, define the plan, make the first commit Create init.sh script to set up…
  • “Feature Checklist Design”: A proven approach is to use JSON format for the feature checklist — Markdown is not suitable for this purpose. The reason: models are less likely to accidentally modify structured JSON, whereas Markdown tends t…
  • “The closing point”: Read the progress file to understand the current state

The final “The closing point” brings the discussion to “Read the progress file to understand the current state”. The useful thing to carry forward is knowing which judgments must be revisited when input, scale, or risk changes.

Mark as learned Your reading progress updates automatically
← PreviousNext →

Keep reading

The next useful article in the thread.

ARTICLE DISCUSSION

Leave one useful thought here.

Keep the idea that clicked, the question that stayed open, or a small note for the next learner.

Discussing Initializer + Coding Agent Engineering Patterns for Reliable Agents
3discussionsArticle discussion · synced with the Circle
View in the learning circle
AM
Asha MorganContent editor
INSIGHTField note

I turned one judgment from this article into a small experiment I could run today. Knowing what to observe next is more useful than simply remembering the conclusion.

ARTICLE DISCUSSION7 helpful
LH
Lin HarperIndie developer
INSIGHTInsight

After reading this, I first looked for the conditions behind the idea instead of copying the method into a project. That order made the later trade-offs much clearer.

ARTICLE DISCUSSION5 helpful
KM
Kiki MooreProduct operations
QUESTIONQuestion

When this judgment reaches real work, which constraint should be added first? I am curious which step matters most between reading and the first practical attempt.

ARTICLE DISCUSSION4 helpful