The Claude Code Harness Engineering Playbook

The highest-leverage habits for working with AI coding agents aren't about prompting, they're about building a compounding system around the agent.

"Encode every mistake in CLAUDE.md. Your CLAUDE.md compounds in value over time; this is 'Compounding Engineering.'" The priority stack:

  1. Worktrees for parallel work: claude --worktree feat-name lets you run multiple tasks simultaneously in isolated git worktrees. This is the single biggest productivity unlock because it turns a sequential workflow into a parallel one. While one agent implements a feature, another can be fixing a bug in a separate worktree.

  2. Encode mistakes into CLAUDE.md: Every time the agent does something wrong, add a rule. The file compounds in value over time, turning past failures into permanent guardrails. This is the same principle as Infrastructure Determines Output applied to AI collaboration.

  3. Verify everything: End prompts with "run the tests", "take a screenshot", "prove this works." Verification is not optional; it's the difference between 2-3x quality and shipping hallucinated code. Trust but verify.

  4. Plan Mode for non-trivial work: Shift+Tab twice. Let the agent explore the codebase and create a plan before implementing. Skip for trivial changes. This mirrors The OODA Loop Speed of Decision Beats Quality of Decision, orient before you act.

  5. /clear between tasks: Context pollution is the #1 failure mode. A clean slate for each task prevents the agent from confusing requirements across different problems.

  6. Automate the inner loop: /commit-push-pr collapses the git ceremony into a single command. Remove friction from the publish cycle.

  7. Voice dictation: fn key twice on macOS. Speaking produces more detailed, natural prompts than typing, which gives the agent better context to work with.

Takeaway: The agent is only as good as the system you build around it: worktrees for parallelism, CLAUDE.md for compounding learning, and verification for quality.


See also: Infrastructure Determines Output | Design Systems That Make Success Easy | External Structure Compensates for Willpower | One Percent Improvements Compound