Your complete partner for Claude Code - orchestrates parallel AI agents to build features from PRDs
with full project context awareness. Give it project context, define your tasks, and let AI build your features.
Before you start, make sure you have:
- Git - Your project must be a git repository
- Node.js (v18+)
- Claude CLI - Install from https://claude.ai/code
# Install globally
npm install -g pilot-ai-cli
# Verify installation
pilot --version# Clone the repo
git clone https://github.com/i-am-anshul/pilot.git
cd pilot
# Install dependencies
npm install
# Build
npm run build
# Link globally
npm link# Navigate to your project
cd your-project
# 1. Initialize pilot
pilot init
# 2. Let AI create your PRD (fills gaps in context files and generates tasks)
pilot create-prd
# 3. Run build to execute tasks
pilot buildSets up pilot in your project:
- Creates
.pilot/directory with context file templates - Creates
PRD.mdtask file template - Runs pre-flight checks (git, Claude CLI, Node.js)
pilot initUses Claude to autonomously:
- Read all spec files in
.pilot/ - Identify gaps (blanks, "TBD", "no preference")
- Make decisions for each gap
- Update
.pilot/files with decisions - Generate
PRD.mdwith atomic, testable features
pilot create-prdThis is the bridge between init and build - it transforms rough project context into actionable tasks.
Runs the main build loop:
- Parses tasks from
PRD.md - Validates each task against project context
- Creates isolated git worktrees for parallel execution
- Runs up to 3 Claude agents simultaneously (with color-coded streaming output)
- Merges each agent's work immediately when done (no waiting for slow agents)
- Runs tests and auto-fixes failures
- Pushes to remote
pilot buildTip: If one agent gets stuck, press Ctrl+C. Completed agents' work is already merged, and any completed tasks from the stuck agent will be salvaged.
Cleans up stale worktrees, branches, and state from failed or interrupted runs:
- Removes all
.pilot-worktrees/directories - Deletes all
pilot/*branches - Clears running tasks state
- Removes
failed-summary.md
pilot cleanupUse this before pilot build if you hit errors about existing worktrees or branches.
Interactively describe a bug and let AI investigate and fix it:
- Asks what problem you're facing
- Optionally accepts error logs (multi-line)
- Optionally accepts additional context (steps to reproduce, expected behavior)
- Uses Claude to investigate and fix the issue
- If fix doesn't work, asks for detailed feedback with new logs
pilot fixUse this when you encounter bugs in code that pilot built (or any code in your project).
When a fix doesn't work, pilot asks for:
- Detailed feedback (multi-line) - Describe what's still broken
- New error logs (optional) - Paste updated crash logs or errors
- Additional context (optional) - Any new observations
This information is passed to the next attempt. The AI is forced to:
- Reset assumptions - Previous understanding was wrong
- Re-investigate from scratch - No incremental tweaks
- Blacklist failed approaches - Can't try variations of what failed
- Meet confidence threshold - Must be ≥7/10 confident before implementing
Every fix attempt MUST include a test that:
- Reproduces the bug (fails without the fix)
- Verifies the fix works (passes with the fix)
"N/A" or skipping tests is not acceptable.
For complex bugs, use --deep to enable brainstorming mode:
pilot fix --deepDeep mode differences:
- Brainstorms 4 solutions - Generates 4 different approaches (including one "out of the box")
- Decision tree visualization - Shows all solutions with confidence scores
- Confidence threshold - Only implements solutions with ≥7/10 confidence
- Never gives up - Uses WebSearch to research if all solutions are below threshold
- Analysis table - Compares pros, cons, and risk levels for each approach
Interactively add a new feature to your PRD:
- Describe the feature you want to add
- Optionally provide additional context (requirements, constraints)
- AI breaks down the feature into atomic tasks with story points
- Preview generated tasks before adding
- Tasks are appended to PRD.md
pilot addUse this to incrementally add features to an existing project. Works even without .pilot/ context - it will analyze your codebase directly.
pilot init # Create .pilot/ and PRD.md templates
│
▼
Fill .pilot/ files # Describe your project, tech stack, architecture
│
▼
pilot create-prd # AI fills gaps and generates atomic tasks
│
▼
pilot build # AI agents execute tasks in parallel
│
├──▶ (if worktree/branch errors) ──▶ pilot cleanup
│
├──▶ (if bugs in built code) ──▶ pilot fix (or pilot fix --deep)
│
└──▶ (to add more features) ──▶ pilot add ──▶ pilot build
After initialization, your project will have:
your-project/
├── .pilot/
│ ├── project-context.md # REQUIRED - What is this project?
│ ├── tech-stack.md # REQUIRED - Languages, frameworks, commands
│ ├── system-design.md # REQUIRED - Architecture and patterns
│ ├── design-spec.md # OPTIONAL - UI/UX patterns
│ ├── boundaries.md # OPTIONAL - Files to never modify
│ ├── state.json # AUTO - Crash recovery state
│ └── logs/ # AUTO - Per-task execution logs
│ ├── task-slug.md # Individual task logs
│ └── failed-summary.md # Quick summary of all failed tasks
├── PRD.md # Tasks for agents to complete
└── ... your code
Describe what your project is:
# Project Context
## What is this project?
A task management app for remote teams
## Domain
Productivity, Collaboration
## Key Concepts
- Workspace: A team's shared space
- Task: A unit of work with assignee and due date
## What this project is NOT
- Not a chat app
- Not a file storage systemDefine your technical constraints:
# Tech Stack
## Language
TypeScript
## Framework
Next.js 14, React
## Database
PostgreSQL with Prisma
## Testing
- Test command: `npm test`
- Lint command: `npm run lint`
## Build
- Build command: `npm run build`
- Dev command: `npm run dev`Document your architecture:
# System Design
## Architecture Overview
Monorepo with Next.js app router
## Directory Structure
- /app - Next.js app router pages
- /components - React components
- /lib - Shared utilities
- /prisma - Database schema
## Key Patterns
- Server components by default
- Client components only when needed
- Zod for validationTasks use markdown checkboxes:
# PRD
## Tasks
- [ ] Create user authentication API [3pt]
- [ ] Build login page [2pt] <!-- depends: create-user-authentication-api -->
- [ ] Add password reset [2pt] <!-- depends: create-user-authentication-api -->Tasks can include story point estimates using [Xpt] notation. Points represent implementation token consumption:
| Points | Token Budget | When to Use |
|---|---|---|
[1pt] |
~16K | Simple change, single file, mostly boilerplate |
[2pt] |
~32K | New component with basic logic |
[3pt] |
~48K | Feature touching 2-3 files |
[5pt] |
~80K | Complex feature, multiple files, some exploration |
[8pt] |
~128K | Large feature, many files, significant research |
Story points are optional but help estimate effort. Both pilot create-prd and pilot add automatically add them.
| Marker | Meaning |
|---|---|
[ ] |
Pending - ready to be worked on |
[x] |
Completed - merged successfully |
[!] |
Blocked - validation failed or agent stuck |
[?] |
Needs attention - merge conflict unresolved |
Use HTML comments to specify task dependencies:
- [ ] Build API
- [ ] Build frontend <!-- depends: build-api -->The task slug is the title in lowercase with special characters as hyphens (Build API → build-api).
Dependency matching is flexible:
- Underscores and hyphens are treated the same (
content_hashmatchescontent-hash) - Double hyphens become single (
react--typescriptmatchesreact-typescript) - Multiple dependencies supported:
<!-- depends: task-a, task-b -->
If a dependency doesn't match any task, you'll see a warning during build.
- Project Context Awareness - Agents understand your domain, tech stack, and architecture
- Task Validation - AI validates each task fits the project before execution
- Parallel Execution - Runs up to 3 agents simultaneously using git worktrees
- Merge-as-Complete - Each agent merges immediately when done, no waiting for slow agents
- Graceful Interruption - Ctrl+C salvages completed work from all agents before exiting
- Real-time Streaming - See all agents' thinking simultaneously with color-coded output
- Dependency Support - Tasks can depend on other tasks with flexible ID matching
- AI Conflict Resolution - Automatically resolves merge conflicts
- Auto-fix Tests - Attempts to fix failing tests after merge
- Crash Recovery - Resumes from where it left off if interrupted
- Failed Task Summary - Quick overview of all failures in
failed-summary.md - Easy Cleanup -
pilot cleanupremoves stale worktrees and branches - Incremental Feature Addition -
pilot addbreaks down new features into tasks with story points - Deep Bug Analysis -
pilot fix --deepbrainstorms multiple solutions with confidence scoring
If you have agent-browser CLI installed, agents can test web UIs:
# Install from https://agent-browser.dev
agent-browser open http://localhost:3000
agent-browser snapshot
agent-browser click @e1
agent-browser type @e2 "hello"- Validation - Each task is validated against project context using Claude
- Worktrees - Creates isolated git worktrees in
.pilot-worktrees/ - Execution - Claude agents work in parallel on their assigned tasks
- Merge-as-Complete - Each agent merges immediately when done (with lock to prevent conflicts)
- Conflict Resolution - AI attempts to resolve conflicts automatically
- Testing - Runs tests after merge, attempts auto-fix on failure
- Push - Pushes completed work to remote
When you interrupt a build with Ctrl+C, pilot doesn't lose your progress:
- Kills running agents - Stops all Claude subprocesses
- Commits uncommitted work - Saves any changes in worktrees
- Checks for completed tasks - Parses PRD in each worktree to find completed tasks
- Merges partial work - If Agent 1 completed 3/5 tasks, those 3 get merged
- Leaves incomplete tasks pending - They'll be picked up on the next
pilot build - Cleans up worktrees - Removes temporary directories
Agent 1: [A, B, C, D, E] ← Working on D when interrupted
Agent 2: [F, G, H, I] ← Already finished and merged
Agent 3: [J, K, L, M] ← Already finished and merged
Ctrl+C → Salvages A, B, C from Agent 1's worktree
→ D, E remain as pending for next run
"Claude CLI not found"
- Install from https://claude.ai/code
- Make sure
claudeis in your PATH
"Not a git repository"
- Run
git initin your project directory
"Branch is already used by worktree"
- Run
pilot cleanupto remove stale worktrees and branches - Then run
pilot buildagain
Claude rate limit errors (Exit code: 1)
- Wait for your rate limit to reset
- Check
.pilot/logs/failed-summary.mdfor affected tasks - Run
pilot cleanupthenpilot buildto retry
Tasks marked as blocked
- Check
.pilot/logs/for the task log - The task may not fit the project context
Tasks stuck even after dependencies complete
- Check if dependency IDs match (underscores vs hyphens)
- Look for warnings about "unknown dependency" in build output
- Verify the dependency task slug matches exactly
Many tasks failed - how to see why?
- Check
.pilot/logs/failed-summary.mdfor a quick overview - Each entry shows: task name, status, 1-line reason, and log file path
Merge conflicts unresolved
- Check the branch in
.pilot-worktrees/ - Resolve manually and run
pilot buildagain
One agent is stuck but others finished
- Press Ctrl+C to interrupt - completed agents' work is already merged
- The stuck agent's completed tasks (if any) will be salvaged
- Incomplete tasks remain pending for the next
pilot build
Interrupted build - did I lose my progress?
- No! Pilot's merge-as-complete architecture saves work as each agent finishes
- Ctrl+C also salvages any completed tasks from interrupted agents
- Check
git logto see what was merged before interruption
MIT
