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

PhaseWhatEnforcement
ExploreRead-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).
PlanPropose changes in natural language; human approves or redirects.Human review gate, blocking. The agent cannot proceed without explicit approval.
CodeExecute 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.
CommitStructured 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.

PracticeGuidelineRuleGate
Write tests firstDocumented in CLAUDE.md as a convention
Conventional commitsStated in commit-format sectionPreCommit hook validates format
No push to mainStated in git-workflow sectionPreToolUse hook intercepts git pushBranch protection on the remote
Lint before PRStated in pre-commit checklistPostToolUse hook runs linter after each editCI required status checks block merge
Secret detectionStated in security sectionPreCommit hook scans diff for secretsCI 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.

  1. Install. npm i -g @anthropic-ai/claude-code (or the equivalent for Codex / Gemini CLI / your chosen agent).
  2. Open project. cd your-project && claude. The agent auto-discovers config files, git history, and project structure.
  3. Create the instruction file. CLAUDE.md (or AGENTS.md / GEMINI.md) in the project root. See Instruction Files for the seven essentials — conventions, stack, testing, git, security, structure, pre-commit checklist.
  4. 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.
  5. Configure MCP. Create .mcp.json to 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.

PhaseAddGoal
Week 1Instruction file onlyBuild familiarity with the agent’s behavior; learn where it drifts.
Week 2PostToolUse hooks (lint, scoped tests)Eliminate the “forgot to lint / forgot to test” failure modes. Shift guidelines to rules.
Week 3MCP serversReduce context switching — issues, schemas, deploys, all in-conversation.
Week 4SkillsStandardize multi-step workflows: review, deploy, triage.
Month 2+Sub-agentsDecompose 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.

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.