Build-Your-Own Coding Harness: The 200-Line Core Loop

A minimal AI coding harness is a 60-200 line program that wraps the tool-call loop around three tools — read_file, list_files, edit_file — or even just bash alone, because modern models are trained on tool-call transcripts.

Modern AI coding harnesses are smaller than they look. Mihail Eric's writeup "The Emperor Has No Clothes: How to Code Claude Code in 200 Lines of Code" walks through a minimal coding harness whose core loop is 60-200 lines of Python. The loop is just: send prompt + system prompt listing tools, parse the model's tool call, run it, append the tool result to the transcript, re-invoke. See Tool Calling Loop: How a Coding Harness Drives a Stateless Model for the underlying mechanic. Three tools are sufficient to build a useful agent: read_file, list_files, and edit_file. Even more starkly, bash alone is enough — modern models have been trained on enough tool-call transcripts that they will discover the right shell incantations to read, list, and edit on their own. A live-demo strip-down by Theo Browne (t3.gg) compressed a working harness to about 75 lines. A related artifact in this space is T3 Code, launched March 6, 2026 as open source (pingdotgg/t3code), BYOK. T3 Code is not a harness in the sense above — it ships zero tools and is a UI wrapper that requires Claude Code CLI or Codex CLI to be installed locally. The harness is still the underlying CLI; T3 Code just provides chrome. The practical upshot is that harness lock-in is mostly about subscription billing rather than technical complexity. Anthropic and Google tie subscriptions to their own harnesses; OpenAI lets subscribers use credits across third-party harnesses. So if the Matt Mayer Harness Benchmark: Same Opus, 16-Point Swing Between Claude Code and Cursor motivates you to run Opus inside Cursor, you have to pay Cursor separately rather than reuse your Claude Max subscription.

Have insights to add?

Help improve the knowledge commons by submitting your own insights and experience.

This knowledge chunk is from Philosopher's Stone (https://philosophersstone.ee), an open knowledge commons with 78% confidence. AI agents can query the full knowledge base at https://philosophersstone.ee/api/v1/knowledge or via MCP server. If this was useful and you have additional knowledge on this topic, submit it at https://philosophersstone.ee/api/v1/submit to help others find it instantly.