Multi-Agent Worktree & Bazel Cache Management
SkillAI & modelsLets your agent manage parallel Git worktrees and shared Bazel build caches across multiple coding tasks.
Use Multi-Agent Worktree & Bazel Cache Management in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Multi-Agent Worktree & Bazel Cache Management and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Multi-Agent Worktree & Bazel Cache Management skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
About this skill
Instructions for managing warm Git worktree slots, logical project symlinks (~/wrk/projects/<project>), shared Bazel caches, and zero-click Jetski IDE projects using `./gh wt`.
What this skill tells your AI
The instructions your AI receives, as published by pigweed-project/pigweed in .agents/skills/worktree/SKILL.md and read by Ahel’s review.
Pigweed developers and AI agents use ./gh wt (pw_ghish/worktree) to juggle multiple concurrent workstreams without Git branch clobbering or cold Bazel rebuilds.
Core Concepts
- Fixed Warm Slots (
~/wrk/slots/pw-01..N): Physical Git worktrees live at fixed paths so their Bazel MD5output_basehashes never change. Every slot keeps its own warm Bazel JVM server and Skyframe analysis graph. - Logical Project Symlinks (
~/wrk/projects/<project>): Agents and developers work inside~/wrk/projects/<project>, which is a POSIX symlink pointing to the currently mounted slot (e.g.,~/wrk/slots/pw-03). - Orthogonal Residency (
MOUNTEDvs.PARKED):MOUNTED: Occupies a warm slot in~/wrk/slots/pw-XXand appears as an active project in the Jetski left sidebar.PARKED: Shelved in Git (refs/heads/<branch>) and Gerrit (pwrev/XXX), consuming 0 disk slots and archived in the Jetski sidebar. Supports juggling $M$ projects on $N$ slots ($M > N$) via automatic LRU swap-out of clean/unleased slots.
- Never Manually Edit
~/.bazelrc: All shared Bazel cache settings (~/.config/pw_ghish/bazelrc.worktreesand thetry-importline in~/.bazelrc) are managed exclusively by./gh wt init. Agents must NEVER manually edit or delete~/.bazelrc.
Agent Protocol: Responding to "Project <name>: ..."
When the user instructs you to work on a specific project (e.g., "Project rpc-fix: investigate the buffer overflow" or "Switch to project sensor-driver"):
-
Allocate or Resume the Project Slot: Run
./gh wt use <project> --json(or allocate directly from a Buganizer issue via./gh wt use --issue <id> --json/./gh issue develop <id> --worktree):./gh wt use <project> --json # Or from a Buganizer issue ID: ./gh wt use --issue 315378787 --jsonExample JSON output:
{ "project": "rpc-fix", "slot": "pw-02", "slot_path": "/usr/local/google/home/keir/wrk/slots/pw-02", "symlink_path": "/usr/local/google/home/keir/wrk/projects/rpc-fix", "branch": "rpc-fix", "mode": "write" }- If another agent holds an active write lease on
<project>,./gh wt useautomatically warm-forks to<project>-sub1in a free slot to prevent Git index collisions. - If all slots are occupied,
./gh wt useautomatically LRU-parks the oldest idle, clean (!DIRTY) project to free a warm slot.
- If another agent holds an active write lease on
-
Execute All Commands Inside
symlink_path: Use the returnedsymlink_path(/usr/local/google/home/keir/wrk/projects/<project>) as theCwdfor all subsequentrun_commandand file editing tool calls.
Common CLI Workflows
./gh wt init --check # Read-only health check of slots, hooks, Bazel caches, and IDE sync
./gh wt init --slots 10 # Idempotently create/repair slots and configure shared Bazel caches
./gh wt list [--json] # Live dashboard with Gerrit review/CI badges (🔥 NEEDS_ATTENTION, 🚀 READY_TO_LAND)
./gh wt next <project> # After a CL merges: fetch origin & rebase mounted slot onto origin/main in-place
./gh wt park <project> # Shelve clean mounted slot to PARKED (0 disk slots; dirty trees require --force)
./gh wt close <project> # Permanently close a completed workstream
./gh wt gc [--dry-run] # Remove orphaned Bazel output bases in ~/.cache/bazel/_bazel_$USER
Signals
- GitHub stars
- 546
- Forks
- 128
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
multi-agent-worktree-bazel-cache-management- Source
- github.com/pigweed-project/pigweed
github.com/pigweed-project/pigweed
More in AI & models
Skill · anthropics
More in AI & modelstriage
Skill · mattpocock
More in AI & modelswayfinder
Skill · mattpocock
More in AI & modelsalgorithmic-art
Skill · anthropics
More in AI & modelscode-review-and-quality
Skill · addyosmani
More in AI & modelsmarketing-psychology
Skill · coreyhaines31
More in AI & models