Prompting and workflows for developers
Mid / SeniorHow to brief a coding agent: context, plan-then-implement loops, verification criteria, session hygiene and parallel work.
Created 19 October 2026
9 concepts · detail hidden
01Glossary — terms used in this page
#c-glossary-terms-used-in-this-page- Context window — the maximum amount of text (tokens) the model can consider at once; everything in the session competes for it.
- Context engineering — deliberately choosing what information (files, docs, rules, examples) goes into the context.
- CLAUDE.md / AGENTS.md — repo-level instruction files that give an agent project conventions, commands and gotchas.
- Subagent — a separate agent instance given a narrow task and its own context, returning only a summary.
- Worktree — a second checkout of the same git repository, letting parallel agents edit without colliding.
02Anatomy of a good coding prompt
#c-anatomy-of-a-good-coding-promptState the goal, the constraints (stack, style, what not to touch), the relevant files or entry points, and how success is verified (the command to run, the test that should pass). A prompt that names the verification command lets the agent check its own work; “make it better” gives it nothing to converge on.
03Explore, plan, implement, verify — the standard loop
#c-explore-plan-implement-verify-the-standard-loop- Explore — have the agent read the relevant code and report back before changing anything.
- Plan — ask for a plan and review it; correct the approach while it is still cheap.
- Implement — execute in small steps.
- Verify — run tests, type check and lint; feed failures back.
Skipping the plan on non-trivial work is the most common cause of a large, confidently wrong diff.
04Persistent instructions versus per-prompt instructions
#c-persistent-instructions-versus-per-prompt-instructionsPut stable facts (build and test commands, architecture notes, conventions, known gotchas) in
CLAUDE.md/AGENTS.mdso every session starts informed. Keep it short and specific; rules the agent could discover from the code are noise. Put task-specific detail in the prompt.05Giving the agent a feedback signal
#c-giving-the-agent-a-feedback-signalAn agent improves fastest when it can observe results: failing tests, compiler errors, a screenshot of the UI, a log line. Provide a fast reproducible check, and ask it to reproduce a bug with a failing test before fixing it.
06Managing context length and session hygiene
#c-managing-context-length-and-session-hygieneLong sessions fill the context with stale exploration and failed attempts, and quality degrades. Start a fresh session for an unrelated task, summarise state before continuing a long one, and keep large logs out by asking for filtered output. After two failed corrections on the same issue, restart with a better prompt instead of piling on corrections.
07Subagents and parallel work
#c-subagents-and-parallel-workDelegate broad searches or independent subtasks to subagents so their exploration does not consume the main context. For several independent changes, run agents in separate worktrees and review each diff on its own branch. Parallelism raises throughput but also raises the review load, which becomes the bottleneck.
08Reusable skills, commands and hooks
#c-reusable-skills-commands-and-hooksEncode repeated workflows (release steps, review checklists, scaffolding) as reusable commands or skills, and enforce must-always rules with hooks rather than hoping the prompt is followed. Deterministic enforcement beats a polite instruction.
09Common prompting anti-patterns
#c-common-prompting-anti-patterns- Asking for a whole feature in one prompt with no plan.
- Accepting output without running it.
- Contradictory or bloated instruction files.
- Pasting huge irrelevant context instead of pointing at the right files.
- Arguing with the agent through many corrections in one polluted session.