A set of configuration files and skills that turn Claude Code into an autonomous coding agent. Designed to work with git worktree layouts — a bare repository with worktree branches as sibling directories and a shared plans/ repository at the project root. A dispatcher script (hive.sh) scans plans/todo/, dispatches one agent per plan (up to a concurrency limit), and waits for them to finish. Each agent (coder.sh) creates or reuses a worktree, then loops Claude Code until the plan is done or blocked — handling context-window limits by re-invoking Claude (which resumes from the progress file). Progress is tracked per-plan in plans/progress/, allowing multiple agents to work on different plans concurrently without contention. Plans are written and verified using dedicated skills before execution begins.
Use at your own risk.
- Add task ideas to
plans/backlog/as individual markdown files. - Use the
designskill to explore backlog items (or new ideas) and write design docs toplans/design/. - Use the
write-planskill to create detailed implementation plans inplans/draft/. - Use the
verify-planskill to review, rewrite, and promote plans toplans/todo/.
The agent expects a bare repository with worktrees. The plans/ directory is its own git repository, sibling to the worktrees:
<project-root>/ # bare git repository (contains HEAD, objects/, refs/, etc.)
├── main/ # worktree: main branch
├── <feature-branch>/ # worktree: feature branches (one per plan)
├── plans/ # separate git repo for plan files
│ ├── backlog/ # task summaries — ideas/work items to turn into plans
│ ├── design/ # design docs from /design skill
│ ├── draft/ # plans being written or revised
│ ├── todo/ # verified plans, ready for execution (polled by hive.sh)
│ ├── in-progress/ # actively being worked on
│ ├── progress/ # per-plan progress files (one per active plan)
│ ├── review/ # verification reports
│ ├── done/ # completed, ready to merge
│ ├── merge/ # merge plans (human-only, not polled by hive.sh)
│ ├── archive/ # merged to main, historical record
│ └── blocked/
├── worktrees/
├── HEAD
├── objects/
└── refs/
- Copy the contents of the
agent/folder into each worktree root (or the main worktree). - Create a
plans/directory at<project-root>/and initialize it as its own git repo (git initinsideplans/). Create the subdirectories:backlog/,design/,draft/,todo/,in-progress/,progress/,review/,done/,merge/,archive/,blocked/. - Copy the contents of the
skills/folder to~/.claude/skills/or the project's.claude/skills/folder. Alternatively, uselink-skills.shto symlink them.
These files live in the agent/ directory (and are copied to the worktree root during setup):
CLAUDE.md— Instructions that Claude Code reads on startup. Defines the worktree environment, agent workflow, plan execution rules, handover format, and how to use skills. ONE plan per session. The agent resolves the project root viagit rev-parse --git-common-dirand locates plans at$PROJECT_ROOT/plans/.coder.sh— Runs Claude Code in a loop on a single plan. Usage:./coder.sh <branch> <path-to-plan>. Creates or reuses a worktree for the given branch, then loops until the plan is done or blocked, handling context-window limits by re-invoking Claude (which resumes from the progress file). Includes retry logic with exponential backoff for transient API errors. Run multiple instances in parallel for concurrent plans.hive.sh— Dispatcher that scansplans/todo/once, reads each plan's**Branch:**metadata, and dispatches acoder.shinstance per plan (up to--max-concurrent N, default 3). Waits for all agents to finish and reports completion status. Handles graceful shutdown on SIGINT/SIGTERM.AGENTS.md— Shared knowledge base for patterns and gotchas discovered during execution. Agents append to this file so future iterations avoid repeating mistakes.
design— Explores ideas through collaborative dialogue, writes design docs toplans/design/.write-plan— Reads designs fromplans/design/, creates detailed implementation plans inplans/draft/. Exact file paths, complete code, explicit commands. No tests. Single-file or multi-stage folders.verify-plan— Reads plans fromplans/draft/, validates structure and feasibility. Rewrites the plan to fix any issues found, re-verifies, and promotes passing plans toplans/todo/.implement-plan— Reads plans fromplans/todo/, executes interactively with user checkpoints. Completed plans go toplans/done/.merge-plan— Reads completed plans fromplans/done/, analyzes worktree branches, writes merge plans toplans/merge/.merge— Reads merge plans fromplans/merge/, executes squash-merges interactively with human oversight. Archives plans toplans/archive/.
cargo-lint— Runscargo clippywith-D warnings(all warnings are errors), auto-fixes issues, and checks for doc warnings. Retries up to 3 times before blocking.self-review— Agent reviews its own code diff for logical errors. Light mode runs per-step (quick scan of the step's diff). Thorough mode runs at end-of-plan (full branch diff against base, writes a review report toplans/review/). Auto-fixes issues and blocks on unresolvable problems.test-audit— Verifies that changed code has adequate test coverage by reading the branch diff and test files. Writes missing tests for uncovered public functions and error paths. No coverage tooling — qualitative assessment by the agent.
backlog/ → design/ → draft/ → todo/ → in-progress/ → done/ → archive/
(design) (write-plan) (verify-plan) (implement-plan) ↑
review ↺ │
rewrite │
↓ │
blocked/ │
│
done/ → merge/ → (run via /merge) ─────────────────────────────────────┘
(merge-plan)
- backlog/ — Task summaries: ideas and work items to be turned into plans. Each file is one task. Consumed by
/design. - design/ — Design docs from
/design. Feed intowrite-plan. - draft/ — Plan is being written by
write-plan, or being rewritten byverify-plan. - todo/ — Plan is verified and ready for execution. Polled by
hive.sh. Onlyverify-planpromotes plans here. - in-progress/ — Plan is actively being worked on (a worktree exists for it). Internal to
implement-plan/coder.sh. - merge/ — Merge plans from
/merge-plan. Requires human oversight, run via/merge. - progress/ — Per-plan progress files. Exists while the plan is in-progress; deleted when done.
- review/ — Quality reports from
self-reviewthorough mode. - done/ — All steps completed successfully. Branch ready to merge.
- archive/ — Merged to main. Historical record.
- blocked/ — A step failed after 3 attempts.
./coder.sh feature-auth plans/todo/add-auth.md./hive.sh # default: 3 concurrent agents
./hive.sh --max-concurrent 5 # up to 5 concurrent agentshive.sh reads the **Branch:** field from each plan to determine the worktree branch name. If absent, it falls back to the plan name.
Dual-licensed under MIT or Apache-2.0, at your option.