Context Management in a Coding Harness

Context Management in a Coding Harness An architecture diagram generated by Archify. Instructions · system + project rules · Architecture component Instructions system + project rules Tool Schemas · native tools + MCP tools · Architecture component Tool Schemas native tools + MCP tools Conversation History · messages, tool calls, results · Architecture component Conversation History messages, tool calls, results Environment Facts · cwd, git, files, diagnostics · Architecture component Environment Facts cwd, git, files, diagnostics Context Builder · select, trim, summarize · Architecture component Context Builder select, trim, summarize Token Budget · fit window, keep signal · Architecture component Token Budget fit window, keep signal Model Request · ordered message sequence · Architecture component Model Request ordered message sequence Model · reason + tool calls · Architecture component Model reason + tool calls Tool / MCP Execution · dispatch, run, observe · Architecture component Tool / MCP Execution dispatch, run, observe Updated State · append results, compact later · Architecture component Updated State append results, compact later stable rules available actions prior turns current facts candidate context trim/summarize messages + tools tool calls tool results persist & reuse assistant reply Legend Frontend Backend Database Cloud Security External