Development Lifecycle
Agentic development has a workflow shape that survives compaction and reduces error rates. Anthropic’s canonical loop is four phases — Explore → Plan → Code → Commit. A common community variant inserts an explicit Verify step before Commit; in the canonical framing, verification is folded into Code (“verify against the plan, run the test suite”). Each phase maps to enforcement mechanisms that prevent skipping. Teams that collapse phases produce the same errors undisciplined humans produce — except faster, and at larger scale.
The phases are sequential by design. An agent that codes before planning will miss context; an agent that commits before verifying will ship broken changes. The mechanisms below exist to make it structurally difficult to violate that ordering.
The Phases
| Phase | What | Enforcement |
|---|---|---|
| Explore | Read-only investigation: files, deps, history, mental model. | Plan Mode (Claude Code: Shift+Tab twice cycles into plan, or type /plan, or launch with --permission-mode plan). |
| Plan | Propose changes in natural language; human approves or redirects. | Human review gate, blocking. The agent cannot proceed without explicit approval. |
| Code | Execute approved changes: edits, commands, tests. | PostToolUse hooks fire after each edit — lint, format, scoped tests. Violations surface immediately, not at commit time. |
| (Verify) | Community variant. Full test suite, type-check, integration. | PreCommit hooks block bad commits; CI gates provide the second layer. |
| Commit | Structured commit message + PR with full context. | Conventional-commit hook validates the message; PR templates enforce description quality. |
Plan Mode is read-only by design — the status bar shows [paused] plan mode on when active. Ctrl+G is not the plan toggle; it opens the current prompt in $EDITOR, often used inside plan mode to revise the plan before approval.
Enforcement Mapping
Every practice can be mapped to one of three tiers: guidelines (soft, in instruction files), rules (hard, in hooks or config), and gates (blocking, cannot be bypassed). Push critical practices as far right as the workflow tolerates.
| Practice | Guideline | Rule | Gate |
|---|---|---|---|
| Write tests first | Documented in CLAUDE.md as a convention | — | — |
| Conventional commits | Stated in commit-format section | PreCommit hook validates format | — |
| No push to main | Stated in git-workflow section | PreToolUse hook intercepts git push | Branch protection on the remote |
| Lint before PR | Stated in pre-commit checklist | PostToolUse hook runs linter after each edit | CI required status checks block merge |
| Secret detection | Stated in security section | PreCommit hook scans diff for secrets | CI secret scanner blocks merge |
Guidelines cover 90%; rules catch 9%; gates catch the final 1%. Instruction files are probabilistic. Hooks are deterministic. For anything where a violation would cause a production incident, the enforcement must be deterministic.
Getting Started
Five steps. Each is independent — stop at any point and you have a functional setup. Later steps add capability, not prerequisites.
- Install.
npm i -g @anthropic-ai/claude-code(or the equivalent for Codex / Gemini CLI / your chosen agent). - Open project.
cd your-project && claude. The agent auto-discovers config files, git history, and project structure. - Create the instruction file.
CLAUDE.md(orAGENTS.md/GEMINI.md) in the project root. See Instruction Files for the seven essentials — conventions, stack, testing, git, security, structure, pre-commit checklist. - Add slash commands. Drop markdown files in
.claude/commands/. Each becomes an invokable workflow. Note: custom slash commands are increasingly being merged into Skills as the recommended primitive;.claude/commands/still works but is moving toward legacy status. See Skills. - Configure MCP. Create
.mcp.jsonto connect external tools (GitHub, Postgres, monitoring, internal APIs). See Tool Protocols.
Progressive Adoption Ladder
Teams that succeed follow the same curve. Teams that deploy the full stack on day one fail.
| Phase | Add | Goal |
|---|---|---|
| Week 1 | Instruction file only | Build familiarity with the agent’s behavior; learn where it drifts. |
| Week 2 | PostToolUse hooks (lint, scoped tests) | Eliminate the “forgot to lint / forgot to test” failure modes. Shift guidelines to rules. |
| Week 3 | MCP servers | Reduce context switching — issues, schemas, deploys, all in-conversation. |
| Week 4 | Skills | Standardize multi-step workflows: review, deploy, triage. |
| Month 2+ | Sub-agents | Decompose long-horizon tasks into bounded subtasks executed by purpose-built specialists. |
Each week adds one category. If a layer destabilizes the team, stay at that level until it’s comfortable before proceeding.
Checkpoints and Recovery
Aggressive experimentation is viable because state is recoverable. Every edit-tool action creates a checkpoint.
- Trigger the menu with the
/rewindcommand or by double-tappingEsc. Both open the same restore picker. - Three restore modes: Conversation only (rewind the chat, keep the files), Code only (rewind the files, keep the chat), or Both (full state restore).
- Critical caveat: bash-driven file changes are NOT tracked. Checkpoints capture direct edit-tool calls (
Edit,Write,MultiEdit). They do not capture filesystem changes made viarm,mv,cp, or other shell commands. An agent that leans on bash to move files around silently bypasses the safety net.
The implication for workflow design: prefer the edit/write tools over shell file operations. Keep destructive bash off the hot path. If a step must use rm or mv, treat it like any other irreversible action — pre-flight check, confirm, then run.
Start with Explore and Week 1: instruction file only. Each layer above is independently valuable. Resist the urge to deploy hooks, MCP, skills, and sub-agents on day one — the team that adds one category per week ships; the team that adds five categories on Monday spends Friday debugging its own scaffolding.