Submit a tool

Your AI coding agent forgets what it was building halfway through

The agent loses the plot on bigger tasks, rewrites working code, or drifts from the goal. Short answer: 5 steps. 1) Write a short project file the agent always reads; 2) Plan first, then build; 3) One task per session; 4) Commit after every working step; 5) Make it prove each step works.

Last updated:

The problem: The agent loses the plot on bigger tasks, rewrites working code, or drifts from the goal.
Asked on X: post 1, post 2

How do I fix this?

  1. Write a short project file the agent always reads

    Claude Code reads CLAUDE.md, Codex and many others read AGENTS.md, Cursor uses project rules. Put the goal, stack, folder layout and "don't touch" rules there.

  2. Plan first, then build

    Ask for a numbered plan saved to a file (e.g. tasks.md) before any code. Approve or edit it. Spec-driven tools like OpenSpec formalize this.

  3. One task per session

    Work through the plan one item at a time and start a fresh session for big new items. Long chats fill the context window and older instructions get lost.

  4. Commit after every working step

    Use Git commits as save points. If the agent breaks things, you roll back in seconds instead of arguing with it.

  5. Make it prove each step works

    Ask it to run the app or tests and show the result before moving on. "Done" without a check is how drift starts.

Which tools can do this for me?

Claude Code

Anthropic's terminal coding agent; included with Claude subscriptions or billed via API.

Codex

OpenAI's coding agent (CLI, IDE and cloud); included with ChatGPT plans or via API.

Cursor

AI-first code editor with agent mode and a weekly usage pool.

GitHub Copilot

Completions, chat and agent inside VS Code/JetBrains/GitHub.

All tools for “Pick an AI coding plan” →