OpenDev: Building Effective AI Coding Agents for the Terminal — Scaffolding, Harness, Context Engineering, and Lessons Learned
Terminal-native AI coding agents face three fundamental engineering challenges: managing finite context windows over sessions that routinely exceed the model's token budget, preventing destructive operations when the agent can execute arbitrary shell commands, and extending capabilities without overwhelming the agent's prompt budget. Most production systems are closed-source with undocumented architectural decisions, leaving open questions unanswered.
OpenDev is presented as the first comprehensive technical report for an open-source, terminal-native, interactive coding agent, providing a secure, extensible foundation for terminal-first AI assistance and a blueprint for robust autonomous software engineering.
Multiple early design iterations of OpenDev revealed concrete failure modes: an agent class hierarchy created a diamond problem when subagents needed mixed capabilities; lazy prompt building caused first-call latency and race conditions with MCP server discovery; and a four-tool state machine for plan mode was brittle with the agent sometimes failing to exit plan mode.