Agentic coding workflows
Brief a coding agent with the goal, boundaries, and success criteria, then let the model choose the investigation path.
Best suited to Claude - native coding-agent surfaces, plan approval flows, and strong long-context code reading make it the best default for multi-file coding work
The task
You want an AI coding assistant to implement a feature, fix a bug, or refactor code across a real codebase. This is different from asking for a snippet. The model has to read surrounding code, respect local conventions, make edits, and prove the result.
Why the old approach is outdated
Older templates often scripted the model’s work: “First, inspect the repo. Second, identify the root cause. Third, write a plan. Fourth, edit the code.” That makes the prompt feel controlled, but it can narrow the agent before it has seen the system.
Current coding agents work better when the prompt defines the job, the authority level, and the proof required. The model should decide which files to read first. You still need planning for risky work. Claude Code’s agent-team docs describe plan approval as a real workflow control, where a coding teammate researches in read-only mode before implementation is approved.
The current approach
State the outcome, boundaries, and verification path. Let the agent choose the investigation order.
Fix the failing checkout test in tests/checkout.spec.ts.
Read the relevant source before editing. Keep the change narrow and preserve the
current test intent. Run the smallest relevant test first, then the full suite if
the repo supports it.
If the test is wrong, say so and explain the evidence before changing it.
This works because the instruction leaves room for real investigation while still defining success. The agent knows what to fix, what not to disturb, and how to show that the fix holds. For longer sessions, pair this with context window management so old tool output and stale plans do not crowd out the current task.
What to add for larger tasks
For multi-file, ambiguous, or irreversible work, require planning before edits. The difference is risk, not ceremony.
This touches auth and billing. Start in read-only planning mode.
Identify the files involved, the likely risks, and the verification plan. Wait for
approval before editing. After approval, keep a short progress note so the work can
resume cleanly if this session ends.
For long-running agent work, add a state rule:
Track what has been inspected, what changed, and what still needs verification.
Do not weaken tests to make progress look better.
What to avoid
- Writing a full investigation script before the model has read the code. Name the goal and constraints instead.
- Skipping a plan for high-risk work. Agentic coding still needs approval gates when the blast radius is large.
- Using “think step by step” as a substitute for a real success criterion. Ask for tests, diffs, or a short decision record instead.
- Asking for broad cleanup during a bug fix. Extra refactors make it harder to review whether the bug was actually fixed.