Skip to content

zerofeed/code-autopilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-autopilot

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.

What it does

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)

Install

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.md

Usage

In 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

Configuration

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.

Model options

Value Best for
haiku Fast, cheap — discovery, simple tasks
sonnet Balanced — implementation, review (default)
opus Deep — complex reviews, cross-cutting refactors

Dual-gate review

The key differentiator. Two AI models review every diff independently:

  1. Claude (always on) — reviews inside Claude Code using the configured model
  2. 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.

Learn more about how it works

Requirements

  • Claude Code CLI installed and authenticated
  • A git repository with a remote
  • For dual-gate: an external AI CLI (codex, gemini, etc.)
  • A writable /tmp directory (default for logs and temp files). On Windows, set temp_dir in .autopilot.yml

Permissions setup

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.

Token usage

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.

License

MIT

About

Autonomous coding pipeline for Claude Code with dual-gate AI review

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors