Implements the nuclear cleanup option for post-merge polecat removal:
- Kills Claude session (force mode)
- Deletes git worktree (bypassing all safety checks)
- Deletes polecat branch
- Closes agent bead
Supports --all for bulk nuke and --dry-run for preview.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This change migrates gt mol status from querying by pinned status + assignee
to reading the hook_bead field from agent beads.
Changes:
- Add AgentBeadFields struct to parse agent bead description fields
- Add buildAgentBeadID function to convert identity to agent bead ID
- Update runMoleculeStatus to:
1. First try to find the agent bead by ID
2. Read hook_bead from agent bead description
3. If hook_bead is set, fetch and display that bead
4. Fall back to legacy pinned-query approach if no agent bead or hook
The implementation is backwards compatible - agents without agent beads
(like polecats before gt-rxa7v is completed) still work via the fallback.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Raw tmux send-keys doesn't work correctly with Claude's input handling.
gt nudge uses literal mode + debounce + separate Enter for reliable delivery.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added ResolveBeadsDir() helper that follows .beads/redirect files,
enabling crew workers and polecats to properly access shared beads.
Updated callers:
- mailbox.go: NewMailboxFromAddress follows redirect
- catalog.go: LoadCatalog follows redirect at all levels
- doctor checks: beads_check, patrol_check, wisp_check follow redirect
Also added comprehensive tests for the redirect resolution logic.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a new fixable doctor check that verifies beads routing configuration:
- Checks if routes.jsonl exists
- Verifies all rigs have routing entries (by path, not just prefix)
- Validates that routes point to valid locations with .beads directories
- Can auto-fix by adding missing routes with --fix
The check is smart about prefix mismatches: if a rig already has a route
by path (e.g., gastown/mayor/rig), it won't report it as missing even if
the prefix in rigs.json differs from what's in routes.jsonl.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When mayor/deacon checks their hook from ~/gt, gt mol status now scans all
registered rigs for pinned beads. This ensures the propulsion principle works
regardless of which directory the agent starts in.
The scan uses routes.jsonl to find all rig beads directories.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When slinging or hooking work to mayor/deacon, the pin now lands in Town
beads (~/.beads/) instead of rig beads. This ensures gt mol status finds
the pinned work when run from ~/gt.
The issue was that town-level roles operate from the town root, so their
hooks should be discoverable from there.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The template incorrectly used --assignee flag on bd mol wisp which doesn't
exist. Changed to two-step pattern matching deacon template.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed polecat branch model to use unique timestamped branches
(polecat/<name>-<timestamp>) instead of reusing persistent branches.
This prevents JSONL drift issues where stale polecat branches don't
have recently created beads.
Changes:
- Add(): create unique branch, simplified (no reuse logic)
- Recreate(): create fresh branch, old ones left for GC
- loadFromBeads(): read actual branch from git worktree
- CleanupStaleBranches(): remove orphaned polecat branches
- ListBranches(pattern): new git helper for branch enumeration
- gt polecat gc: new command to clean up stale branches
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When run in a non-crew session (Mayor, Witness, Refinery, Deacon),
gt crew next/prev now returns success (exit 0) instead of an error.
These sessions don't have cycle groups, so pressing C-b n should
simply do nothing rather than fail with an error message.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
These methods called `bd pin` and `bd unpin` which have been removed.
Neither method was ever called - gt uses `bd update --status=pinned` instead.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add --all flag to restart all running crew sessions
- Add --dry-run flag to preview without restarting
- Add --rig filter to target specific rig
- Extract restartCrewSession helper for reuse
🤝 Filed gt-1kljv for adding tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Theme is configuration (from settings/config.json), not runtime state.
Loading theme from state file was causing rig config to be ignored,
which is why the beads rig kept using mad-max names instead of minerals.
Crew workers are human-managed and should never be auto-killed by
gt doctor --fix. This adds defense-in-depth protection:
1. OrphanSessionCheck.Fix() now skips any session matching the
gt-<rig>-crew-<name> pattern
2. OrphanProcessCheck.Fix() now checks if a process has a crew
session pane as an ancestor before killing it
Even if detection fails (like the pgrep bug we just fixed), crew
sessions and their processes will be protected.
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The orphan-processes check was incorrectly killing active crew sessions
because pgrep -x tmux does not reliably find the tmux server on macOS.
Root cause:
- pgrep -x tmux was finding tmux attach-session processes but missing
the actual tmux server process
- Claude processes running in tmux panes were incorrectly flagged as
orphaned because their parent (tmux server) was not in the allowed list
Fixes:
1. Use ps + awk instead of pgrep to find tmux processes more reliably
2. Exclude Claude.app desktop processes from orphan detection (they are
not Gas Town CLI processes)
Closes: gt-ronyn
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When slinging a bead that has the template label (a proto), and --var
flags are provided, automatically call bd --no-daemon pour to
instantiate the proto with variable substitution before slinging.
This enables the seamless workflow:
gt sling mol-release beads --var version=0.38.0
Instead of the manual two-step:
bd --no-daemon pour mol-release --var version=0.38.0 --json
gt sling <resulting-mol-id> beads
Also adds a warning when slinging a proto without --var, since
{{variables}} will not be substituted.
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds comprehensive "Theory of Operation" section explaining WHY agents
must execute work immediately when found on their hook. Uses steam engine
metaphor to convey that this is physics, not politeness.
Each role gets a tailored metaphor:
- Mayor: main drive shaft
- Crew/Polecat: piston
- Deacon: flywheel
- Witness: pressure gauge
- Refinery: exhaust valve
The section explains the failure mode (agent waits, human is AFK,
Gas Town stops) and reinforces the propulsion principle.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- gt unsling: clear your own hook
- gt unsling <bead>: only unsling if that bead is hooked
- gt unsling <target>: clear another agent's hook
- gt unsling <bead> <target>: unsling specific bead from agent
- gt unhook: alias for gt unsling
Symmetric with gt sling/hook commands.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>