Autonomous coding pipeline for Claude Code with dual-gate AI review.
Give it tasks. It discovers, implements, reviews (with two AI models), fixes, and merges — while you do something else.
You: "fix the login redirect and add input validation to the signup form"
code-autopilot:
Task 1/2: Fix login redirect
Step 1: Understand → redirect goes to /dashboard, should be /me
Step 2: Discover → found auth.go, middleware.go, 2 tests
Step 3: Brief → describe the problem, not the fix
Step 4: Implement → agent changes auth.go, adds test
Step 5: Claude review → APPROVED
# Step 6 skipped — no fixes needed
Step 7: Codex review → APPROVED
Step 8: PR #42 created (ready for merge)
Task 1/2: PASSED
Task 2/2: Add signup validation
...
Task 2/2: PASSED
Queue complete: 2/2 passed.
What happens when review rejects:
Task 1/1: Add input validation
Step 4: Implement → agent adds validation to signup form
Step 5: Claude review → CHANGES_REQUESTED: missing XSS sanitization
Step 6: Fix → agent adds DOMPurify, re-running review
Step 5: Claude review (retry) → APPROVED
Step 7: Codex review → APPROVED
Step 8: PR #43 created (ready for merge)
Task 1/1: PASSED (2 iterations)
Copy the skill to your Claude Code skills directory:
# User-level (available in all projects)
cp SKILL.md ~/.claude/skills/code-autopilot/SKILL.md
# Or project-level (available only in this project)
mkdir -p .claude/skills/code-autopilot
cp SKILL.md .claude/skills/code-autopilot/SKILL.mdIn any Claude Code session:
> /code-autopilot fix the login redirect bug
> /code-autopilot execute GitHub issue #45
> /code-autopilot do these 3 things: 1) fix auth, 2) add validation, 3) update tests
Or just tell Claude to use autopilot:
> use autopilot to implement the search feature
Create .autopilot.yml in your project root. Everything is optional — it works without any config.
# .autopilot.yml
base_branch: develop
merge_strategy: squash
models:
discoverer: haiku # codebase exploration
implementer: sonnet # writes the code
claude_reviewer: opus # reviews the diff (upgrade for deeper review)
# Enable dual-gate review with a second AI
external_reviewer:
command: "codex exec" # or "gemini -p"See .autopilot.yml.example for all options.
| Value | Best for |
|---|---|
haiku |
Fast, cheap — discovery, simple tasks |
sonnet |
Balanced — implementation, review (default) |
opus |
Deep — complex reviews, cross-cutting refactors |
The key differentiator. Two AI models review every diff independently:
- Claude (always on) — reviews inside Claude Code using the configured model
- External (optional) — a second AI CLI (Codex, Gemini, etc.) reviews the same diff
Both must approve before merge. If either rejects, the skill fixes the issues and re-runs both gates.
The orchestrator can override a reviewer finding with documented justification — logged in the terminal, log file, and PR body.
- Claude Code CLI installed and authenticated
- A git repository with a remote
- For dual-gate: an external AI CLI (
codex,gemini, etc.) - A writable
/tmpdirectory (default for logs and temp files). On Windows, settemp_dirin.autopilot.yml
For unattended operation, add these to your Claude Code allowed tools:
Bash(git push*)Bash(gh pr create*)Bash(gh pr merge*)
Without these permissions, Claude will pause and ask for approval at each git operation.
This skill consumes tokens across multiple agents (discovery, implementation, review, fixes). A typical single-task run uses roughly:
- Simple fix (CSS, config): ~15-30K tokens
- Medium feature (new endpoint, handler): ~50-100K tokens
- Complex feature (multi-file, new subsystem): ~100-200K tokens
The max_iterations config (default: 10) acts as a cost circuit breaker. For cost-conscious usage, set models to haiku for discovery and lower max_iterations.
MIT