Hive Agent Pilot. A blunt, efficient project manager for the modern 10x Multi-threaded Engineer.
hap is a CLI tool designed for developers who want to use AI Agents locally in parallel on different git branches. It enforces a "Hive" directory structure to manage complex, multi-repository projects without context switching.
Most project managers just cd into a folder. hap manages parallel universes.
- The Hive Structure: Separates
sources(git history) fromworkspaces(active state). - Workspace Mode: Instantly spawn a temporary, isolated workspace (
hap -w) for an AI agent or a quick hotfix. - Explicit Cleanup: Workspaces persist after you close the editor. Use the dedicated cleanup command to remove them and their branches when done.
- Dual Modes: Support for Heavy layouts (Servers/DBs) and Lite layouts (Editor only).
bash(4.0+)zellij(default editor)fzfgitcursororantigravity(optional, for-e cursoror-e antigravitysupport)pnpm(optional, for auto-install)
git clone https://github.com/thefurdui/hap.git
cd hap
make installhap requires a specific directory structure to manage parallel contexts effectively.
-
Create the Skeleton:
~/projects/your-project/ ├── config/ <-- You MUST put hap.kdl and hap-lite.kdl here ├── sources/ <-- Bare or Detached Git Repos (The "Truth") ├── workspaces/ <-- Managed by hap (The "Action") └── shared/ <-- (Optional) Persistent state linked to workspaces -
Shared State (Optional): If you have files that are NOT in git (like
.envfiles, local certificates, or IDE configs) but need them in every ephemeral workspace:- Create a folder in
shared/named exactly like the repo insources/. - Any file placed in
shared/repo-name/will be automatically symlinked into the workspace when created.
- Create a folder in
-
Configure the Layouts: Copy the files from
templates/into yourconfig/folder and adapt them:hap.kdl(The Heavy Lifter): Edit the "Systems" tab. Change thecwdpaths to match your repo names insources/and update theargsto run your actual servers (e.g.,go run main.go,pnpm dev).hap-lite.kdl(The Agent): Update the agent pane command if you use something other thangemini(e.g.,claude,aider).
-
Register the Project:
cd ~/projects/your-project hap -s your-project .
Daily Driver (Full Mode):
Opens your project with the servers defined in hap.kdl running automatically.
hap # Interactive list
hap -p your-project # Open directlyAgent / Parallel Mode:
You are working in Main. You need to fix a bug on the backend without stopping the servers or changing branches.
hap -w your-project backend-fix- Creates
workspaces/backend-fix. - Creates fresh git worktrees from
sources/.- Default branch:
hap/backend-fix/repo-name
- Default branch:
- Pushes the new branch to
originimmediately. - Installs dependencies (pnpm/go) in the background.
- Opens Zellij using
hap-lite.kdl(No servers, just code + agent). - On Exit: The workspace remains.
Cleanup: When you are done with a task, use the cleanup command.
hap -c your-project backend-fix # Clean local workspace & branch
hap -c your-project backend-fix -D # Clean local + DELETE REMOTE branch (Prompts confirmation)
hap -c your-project # Bulk clean all inactive, clean workspacesTarget Branch Control:
You can specify a target branch name instead of the default hap/ prefix.
hap -w your-project login-feature -B feat/login- Creates
workspaces/login-feature. - Checks out branch
feat/login/repo-name.
Manual Mode Selection:
Open the Main workspace, but skip the heavy server startup (uses hap-lite.kdl).
hap -m liteCustom Editor:
By default, hap uses Zellij. You can switch to a GUI editor for a more traditional IDE experience.
hap -p your-project -e cursor
hap -w your-project fix-bug -e cursor
hap -p your-project -e antigravity
hap -w your-project fix-bug -e antigravityCurrently supported values for -e: zellij (default), cursor, antigravity.
hap uses passive tracking to determine if a workspace is "active" during bulk cleanup:
- Zellij:
hapqueries the Zellij daemon (zellij list-sessions) to check if a session namedproject-taskis currently running. - GUI Editors: A
.hap.guilock file is placed in the workspace.haplaunches the editor in "Fire and Forget" mode (no blocking) and exits. The workspace remains "active" (safe from bulk cleanup) as long as this file exists.
- Bulk Cleanup (
hap -c project):- Scans all workspaces.
- Skips any workspace with an active Zellij session or a
.hap.guifile. - Removes the rest.
- Targeted Cleanup (
hap -c project task):- Forcefully cleans the workspace, removing
.hap.guilocks and git branches.
- Forcefully cleans the workspace, removing
All hap data is stored in ~/.local/share/hap/:
projects.csv— Registered projects
MIT