Stop Copy-Pasting Scripts: Version Your AI Agent as State, Context, and Verifier Components
InsideDebt6345 · reddit · 2026-08-11
The author shares an engineering approach to solve common AI agent pain points: state drifting across projects, forgetting progress, and untestable outputs.
They refactored the agent harness into three independently versioned components:
- State: Reads/writes a JSON file at session boundaries (tracking done / inProgress / next) to prevent the agent from losing its place between runs.
- Context: Queries the workspace for dependencies before the first action, so the agent isn't rediscovering the same relationships every time.
- Verifier: A separate checker outside the generation loop that scores outputs against a done condition (returning NO / YES / MAYBE / IFF). Keeping the checker away from the maker significantly reduced confident-but-wrong outputs.
The setup now installs into new projects via a single command, and bug fixes propagate downstream automatically.
More from coding & agent
- Running opencode2 AI Coding Agent Inside Durable Objects — ritakozlov · 2026-08-11
- Open CLI Tool Installs 120 Curated Skills for AI Coding Agents — tom_doerr · 2026-08-11
- Building a Distributed, Event-Driven AI Agent Platform — blaizedsouza · 2026-08-11
- Agentic AI Architecture Cheat Sheet: 7-Layer Framework from Goal to Governance — blaizedsouza · 2026-08-11
- dhh predicts humans won't read or write code in 5 years, sparking debate — rohanpaul_ai · 2026-08-11
- Grok Build Adds Interactive /tour Tutorial for Terminal Learning — XFreeze · 2026-08-11