AI coding harnesses: agent execution model, memory, and context management…

AI coding harnesses: agent execution model, memory, and context management across commercial and OSS tools

2026-03-09 · agentic-ai memory-context ai-architecture tools-infrastructure · medium · source → · wiki →
key claims
  1. All major AI coding harnesses implement tool-mediated execution as their core primitive: agents invoke discrete tools (file_read, file_write, bash, browser) rather than generating text that is interpreted as instructions, making every agent action visible and auditable
  2. AGENTS.md has emerged in 2025 as the cross-vendor standard for project-context injection, supported by OpenAI Codex, Cursor, GitHub Copilot, AMP (Sourcegraph), Aider, Zed, and Continue.dev — it carries build commands, test commands, coding conventions, and architectural notes in version-controlled Markdown at the repository root
  3. Local-process tools (Claude Code, Aider, Cline, Opencode) use human-approval gates before destructive operations, while cloud-sandbox tools (OpenAI Codex, GitHub Copilot Coding Agent) use container isolation instead — both approaches serve the same safety function through different mechanisms
  4. Git is the universal state store across all surveyed systems; all use commits as the checkpoint and rollback mechanism, with some harnesses explicitly prompting agents to commit after every incremental unit of work to ensure recoverability
  5. Anthropic's published long-running agent harness (initializer agent + coding agent + feature-list JSON + progress file) is the field's most detailed public architecture for multi-context-window task execution: the initializer sets up a structured feature list; each coding session works on one feature, commits, and updates the feature list before yielding
  6. Context window management is an unsolved problem: repo maps (Aider), dynamic context discovery (Cursor, up to 47% token reduction in A/B testing), LSP-fed semantics (Opencode, Zed), and compaction (Anthropic Agent SDK) are competing approaches with distinct trade-offs, and no system has published an integrated solution
  7. AMP (Sourcegraph) implements the most structurally differentiated multi-agent architecture: an Oracle sub-agent for planning and architecture (using o3-class models), an Executor sub-agent for multi-file code changes, and a Codebase Search sub-agent for semantic navigation — matching model capability to cognitive task type
  8. GitHub Copilot explicitly documents a dual-layer architecture where agent mode is synchronous in-IDE pairing and the Copilot Coding Agent is asynchronous issue-to-PR delegation via GitHub Actions VMs, treating these as complementary rather than competing surfaces

Research Question

What are the core architectural and philosophical principles behind the AI coding harnesses (agentic IDEs and agent runtimes) published or released by Anthropic, OpenAI, and the broader ecosystem of commercial and OSS tools? Specifically: where and how do the agents run, what do they have access to (filesystem, tools, APIs), and how do they handle memory, state, progress management, and context window management?

Findings

(Populated from §6 Synthesis above.)

Executive Summary

AI coding harnesses across commercial and OSS tools have converged on three architectural choices: tool-mediated execution (every agent action goes through discrete tool calls), file-based project-context injection (AGENTS.md, CLAUDE.md, or equivalent), and git as the primary state and progress persistence mechanism. The primary divergence is execution environment: local CLI/IDE processes (Claude Code, Aider, Cline, Opencode) prioritise developer sovereignty and bring-your-own-key access, while cloud sandboxes (OpenAI Codex, GitHub Copilot Coding Agent) prioritise organisational governance and parallel execution at scale. Context window management remains an unsolved engineering problem — repo maps, dynamic context discovery, LSP integration, and session compaction are competing approaches without a dominant winner. [inference] Anthropic's published harness framework is the most detailed public treatment of long-running multi-context-window agent execution, and its core finding — that incremental, commit-gated progress with a structured feature list is more reliable than prompting agents to work freely — is directly applicable to any research or coding loop design.

Key Findings

  1. All major AI coding harnesses implement tool-mediated execution as their core primitive: agents invoke discrete tools (file_read, file_write, bash, browser) rather than generating text that is interpreted as instructions, making every agent action visible and auditable.
  2. AGENTS.md has emerged in 2025 as the cross-vendor standard for project-context injection, supported by OpenAI Codex, Cursor, GitHub Copilot, AMP (Sourcegraph), Aider, Zed, and Continue.dev — it carries build commands, test commands, coding conventions, and architectural notes in version-controlled Markdown at the repository root.
  3. Local-process tools (Claude Code, Aider, Cline, Opencode) use human-approval gates before destructive operations, while cloud-sandbox tools (OpenAI Codex, GitHub Copilot Coding Agent) use container isolation instead — both approaches serve the same safety function through different mechanisms.
  4. Git is the universal state store across all surveyed systems; all use commits as the checkpoint and rollback mechanism, with some harnesses explicitly prompting agents to commit after every incremental unit of work to ensure recoverability.
  5. Anthropic's published long-running agent harness (initializer agent + coding agent + feature-list JSON + progress file) is [inference] the field's most detailed public architecture for multi-context-window task execution: the initializer sets up a structured feature list; each coding session works on one feature, commits, and updates the feature list before yielding.
  6. Context window management is an unsolved problem: repo maps (Aider), dynamic context discovery (Cursor, up to 47% token reduction in A/B testing), LSP-fed semantics (Opencode, Zed), and compaction (Anthropic Agent SDK) are competing approaches with distinct trade-offs, and no system has published an integrated solution.
  7. AMP (Sourcegraph) implements the most structurally differentiated multi-agent architecture: an Oracle sub-agent for planning and architecture (using o3-class models), an Executor sub-agent for multi-file code changes, and a Codebase Search sub-agent for semantic navigation — matching model capability to cognitive task type.
  8. GitHub Copilot explicitly documents a dual-layer architecture where agent mode is synchronous in-IDE pairing and the Copilot Coding Agent is asynchronous issue-to-PR delegation via GitHub Actions VMs, treating these as complementary rather than competing surfaces.
  9. Zed introduced the Agent Client Protocol (ACP) in late 2025 as a standardised subprocess messaging protocol for AI agents, explicitly modelled on LSP's success in standardising language tooling, enabling any third-party agent to integrate with the editor without tight coupling.
  10. No surveyed coding harness uses vector databases or semantic retrieval as a default component of the core agent loop; external memory stores appear only in specialised retrieval contexts such as Cursor's codebase semantic indexing.
  11. OSS tools (Cline, Aider, Opencode) share a bring-your-own-key, local-sovereignty philosophy — code stays on the developer's machine, API keys remain under developer control — positioning them against commercial per-seat tools but limiting their adoption in enterprise-governed environments.
  12. Anthropic's "Building Effective Agents" (December 2024) introduces five composable workflow patterns (prompt chaining, routing, parallelisation, orchestrator-workers, evaluator-optimizer) with the explicit design principle that systems should start simple and add complexity only where clear value is demonstrated.

Assumptions

Analysis

Tool-mediated execution and file-based project-context injection have both cleared an industry validation threshold, adopted independently across competing commercial and OSS tools. Tool-mediated execution makes every agent action auditable by design. File-based context injection (AGENTS.md) fits naturally into existing developer workflows — version-controlled, diffable, reviewable via PR — with no additional infrastructure. [inference] Both converged on design choices that make agent actions visible and reversible, across commercial and OSS tools independently, suggesting these properties are practically necessary rather than optional.

The local-vs-cloud execution split reflects different customer requirements rather than a technical disagreement. Individual developers working on private codebases prefer local tools: no data leaves the machine, no per-seat pricing, no dependency on external availability. Enterprises deploying agents across teams need audit logs, policy controls, and sandboxed isolation — requirements that cloud execution satisfies more naturally. [inference] Hybrid approaches (local IDE + optional cloud delegation) are the emerging middle ground.

Context window management fragmentation is the clearest indicator the field has not converged. Each approach addresses a different slice of the problem: repo maps summarise codebase structure at low token cost, trading inline code detail for breadth; dynamic context discovery cuts token waste at the cost of tool orchestration complexity; LSP integration delivers the richest live semantics — diagnostics, symbol tables, type information — at the cost of editor coupling; compaction maintains session continuity but can degrade instruction fidelity at boundaries. That even frontier models with compaction fail on long-running tasks without structured progress files — per Anthropic's harness engineering findings — suggests larger context windows alone will not close this gap.

Risks, Gaps, and Uncertainties

Open Questions

  1. How does structured feature-list progress management (Anthropic harness) compare to issue-tracker integration (GitHub Issues, Linear) in practice for multi-session coding tasks? — potential new backlog item.
  2. What is the real-world failure rate of context compaction across context window boundaries, and what degradation patterns emerge? — gaps in the published evidence.
  3. Has any system published controlled benchmarks comparing repo maps, dynamic context discovery, and LSP-based context approaches on the same tasks? — if not, this is a research opportunity.
  4. How do systems handle conflicting instructions between AGENTS.md, system prompts, and user prompts — and has this been exploited as a prompt injection attack surface? — security-relevant open question.
  5. Will AGENTS.md develop a formal schema or validator, or remain an informal open standard indefinitely? — standardisation trajectory question.

sources


Connected items

Loading…

View full knowledge graph →