Samples st_nlink > 1 vs. true hogs
Distinguishes pnpm hardlinked node_modules (reminding you to run pnpm store prune) from exclusive physical disk eaters like Rust target/ and Next.js .next/cache.
fbk doctor playbook →
Deterministic Git worktree & branch hygiene across Claude Code, Codex, Antigravity (AGY), Amp, DeepSeek Harness, Amy, T3 Code, and Orca—with a self-evolving fbk doctor, zero-write Squash/Rebase detection, and a hardened Recovery Vault.
npx -y skills@1.5.17 add yizhiyanhua-ai/fireworks-branch-killer/skills/fireworks-branch-killer --agent codex claude-code -g -y --copy
fbk doctor: a self-evolving space playbook that learns your machine.Every checkup and cleanup writes back into a personal <state_dir>/playbook.md—never dirtying your repository—so recommendations sharpen as your stack and habits evolve.
Distinguishes pnpm hardlinked node_modules (reminding you to run pnpm store prune) from exclusive physical disk eaters like Rust target/ and Next.js .next/cache.
Fix a flagged .gitignore trailing slash (node_modules/) and re-run doctor: the warning automatically promotes into Resolved Wins in your playbook.
Every slim, clean, or close --apply feeds actual reclaimed GBs and recurring hotspot repositories back into your profile.
Run fbk doctor --learn "..." --stack js-ts or tell your agent to remember a rule. Need a strict zero-write probe? Pass --no-evolve.
Inside Claude Code, Codex, AGY, or Amp, natural-language phrases route straight to scripts/fbk.py instead of ad-hoc rm -rf guesses.
| Goal | Ask Your Agent Naturally | Deterministic CLI |
|---|---|---|
| Evolving workspace checkup | “Run fbk doctor and check my space-saving tips” | fbk doctor --root . |
| Open living local playbook | “Show my evolving fbk space-saving playbook” | fbk doctor --show-playbook |
| Record a new gotcha | “Save a lesson in fbk: prune pnpm store after cleanups” | fbk doctor --root . --learn "Run pnpm store prune" --stack js-ts |
| Keep branches, slim caches | “Slim node_modules, .next/cache, and target in idle worktrees” | fbk slim --root . --apply |
| Close merged PR worktree | “PR squash-merged—close this worktree and branch with fbk” | fbk close --worktree ./wt-feat --apply |
| Tier-0 cleanup & rollback | “Preview Tier-0 cleanup” / “Restore last vaulted branch” | fbk clean --root . --tier 0 --apply · fbk restore <id> --apply |
fbk doctor.Stop duplicating GBs across parallel worktrees from day one—plus critical traps surfaced automatically during diagnosis.
| Stack / Layer | Root-Cause Mechanism | Critical Gotcha & fbk Synergy |
|---|---|---|
| Claude Code | worktree.symlinkDirectories |
Never end .gitignore rules with / (node_modules/ fails on symlinks—write node_modules). fbk slim uses follow_symlinks=False safely. |
| JS / TS (pnpm & bun) | virtualStoreType: global · bun CoW |
Standard pnpm hardlinks node_modules to a global store; deleting one worktree frees little until pnpm store prune runs. Real exclusive hogs: target/ & .next/cache. |
| Browser E2E / QA | PLAYWRIGHT_BROWSERS_PATH · PUPPETEER_CACHE_DIR |
Externalizes 400 MB–1.2 GB browser binaries; set trace and video to retain-on-failure to avoid huge test recordings. |
| Python & AI / ML | uv + UV_LINK_MODE=clone · HF_HOME |
Keep UV_CACHE_DIR on the same APFS volume for zero-copy venvs and store model weights outside worktrees (saves 10–60 GB). |
| Rust (Tauri / Wasm) | RUSTC_WRAPPER=sccache · CARGO_TARGET_DIR |
Eliminates 5–20 GB per-worktree target/ bloat; use sccache + fbk slim for parallel lock-free builds. |
| Go / Mobile / Docker / Git | GOMODCACHE · GRADLE_USER_HOME · cp -cR |
Use git worktree over full clones, tear down test DBs via docker compose down -v, and run git maintenance start. |
Read-only probes always pass --no-optional-locks, virtual squash probes touch zero loose repo objects, and every non-ancestor delete snapshots a verifiable .bundle first.
Ancestor, cherry-pick, or virtual squash-merged branches past the 24h grace period with zero active lsof processes.
Removes idle node_modules, .next, target, dist, .venv across 3 nested levels after verifying zero git ls-files.
Requires --allow-review / --allow-dirty and writes a .bundle + diff + untracked .tar.gz to Recovery Vault first.
Primary repos, protected branches, active lsof cwd, index.lock, .fbk-keep, .delivery, or 24h grace period.
SessionStart warns gently when stale worktrees accumulate; PreToolUse intercepts /tmp git remote add bloat and worktree quota sprawl before it starts.
| Harness | Skill Discovery | Hooks & Guard | Auto-Detected Worktrees |
|---|---|---|---|
| Claude Code | .claude/skills/ |
.claude/settings.json |
.claude/worktrees/*, claude-* |
| Codex | .agents/skills/ |
~/.codex/hooks.json + AGENTS.md |
.codex/worktrees/*, codex* |
| Antigravity (AGY) | .agents/skills/ |
.agents/hooks.json |
agy-*, ge\d+-*, .gemini |
| Sourcegraph Amp | .agents/skills/ · ~/.config/agents/skills/ |
AGENTS.md |
Shared .agents/skills/ standard |
| DeepSeek / Amy / T3 / Orca | .agents/skills/ |
hook_adapter.py + ORCA_* |
wt-ds*, .amy/*, .t3/*, .orca/* |
fbk slim --root . --apply (or ask your agent to slim idle caches). It recursively scans 3 levels for monorepos, checks lsof for active processes and git ls-files to protect tracked files, skips symlinks (follow_symlinks=False), and trims node_modules, .next, target, dist, and .venv without deleting your code or branch.pnpm hardlinks files in node_modules to a global store. Unlinking one worktree does not reclaim physical blocks while the store holds references. fbk doctor samples st_nlink > 1 to detect this and reminds you to pair cleanups with pnpm store prune (or enable virtualStoreType: global), while targeting exclusive physical hogs like target/ and .next/cache.playbook.md and evolution-profile.json live inside <state_dir> (~/.cache/fireworks-branch-killer or --state-dir), never inside your repo. Pass --no-evolve for zero state writes.git branch --merged, fbk runs a zero-write 3-step waterfall: ancestor check → git cherry → virtual squash merge inside an isolated temporary GIT_OBJECT_DIRECTORY, writing zero loose objects into your real repo..bundle (plus git diff and untracked .tar.gz) into Recovery Vault before removal. Run fbk restore --list and fbk restore <receipt_id> --apply to recover cleanly.SKILL.md standard under .agents/skills/ (with .claude/skills/ symlinked or copied). Installing once via npx skills gives every compatible agent identical deterministic safety guardrails.