- Add numbered prefixes to `gt convoy list` output (1. 2. 3. ...)
- Support numeric shortcuts in `gt convoy status <n>`
- Add `-i/--interactive` flag for expandable tree view TUI
- New internal/tui/convoy package with bubbletea-based UI
- j/k navigation, enter to expand/collapse
- 1-9 to jump directly to convoy
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Key optimizations:
- Use --no-daemon for bd commands to avoid daemon IPC overhead
- Pre-fetch all agent beads in single query (ListAgentBeads)
- Pre-fetch all hook beads in single query (ShowMultiple)
- Pre-fetch all tmux sessions for O(1) lookup
- Parallel rig processing with goroutines
- Add --fast flag to skip mail lookups
The main bottleneck was bd daemon communication timing out on
stale daemon processes, causing 5+ second delays per rig.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When gt handoff is run with -s and -m flags, it now:
- Creates the handoff mail bead directly using bd create
- Captures the created bead ID
- Auto-hooks the bead with status=hooked so the next session picks it up
This enables the handoff workflow:
gt handoff -s "Title" -m "Instructions..."
The next session startup hook (gt prime) will detect the hooked bead
and present it to the agent for immediate execution.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a mail bead (type=message) is on hook, gt hook now shows:
- From: <sender>
- Subject: <title>
- Run: gt mail read <id>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add "Hookable Mail" section to all role templates explaining how mail beads
can be hooked for ad-hoc instruction handoff. Key documentation points:
- GUPP applies to hooked mail: read and execute instructions
- Two use cases: hook existing mail, create+hook via gt handoff
- Role-specific examples for each agent type
Templates updated:
- boot.md.tmpl
- crew.md.tmpl
- deacon.md.tmpl
- mayor.md.tmpl
- polecat.md.tmpl
- refinery.md.tmpl
- witness.md.tmpl
Also updated prime.go fallback output functions to include hookable mail
reference for when templates fail to render.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The gt hook command was using --status=pinned while gt sling and the rest
of the codebase use --status=hooked. This inconsistency meant gt hook would
not find beads hooked by gt sling, and vice versa.
Changes:
- hook.go: Use beads.StatusHooked instead of beads.StatusPinned
- hook.go: Update bd update command to use --status=hooked
- unsling.go: Use beads.StatusHooked when finding hooked beads
- Update error messages and comments to say "hooked" instead of "pinned"
This fix ensures gt hook works uniformly for all bead types (molecules,
issues, mail beads) since they all use the same beads system.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When slinging work from town beads (hq-*) to a polecat whose agent bead
is in rig beads (gt-*), the hook_bead update was silently failing because
bd couldn't find the cross-beads reference.
Changes:
- sling.go: Use town root for routing instead of cwd, enabling cross-beads
resolution via routes.jsonl. Log warnings on failure instead of silent ignore.
- done.go: Use townRoot (already available) instead of cwd for beads client.
Log warnings on failure for both state and cleanup status updates.
Root cause: The beads client was created from current working directory,
which may not have access to routes.jsonl for cross-prefix resolution.
Town root always has routes.jsonl for proper prefix → rig directory mapping.
(gt-ohqxq)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add heartbeat checking to Boot degraded triage: detects stale Deacon
heartbeat (>15min nudges, >30min restarts)
- Add checkDeaconHeartbeat to daemon heartbeat cycle as fallback
- This ensures the Deacon is monitored continuously, not just at startup
The mol-deacon-patrol formula was also updated separately to use
gt deacon health-check instead of ephemeral context memory tracking.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major redesign based on design review:
1. REMOVED: Claude Code internal parsing (ZFC violation)
- Deleted internal/claude/sessions.go (parsed ~/.claude/projects/)
- This coupled us to Claude Code's undocumented internal format
2. ADDED: Event-based session discovery
- gt prime now emits session_start events to ~/gt/.events.jsonl
- Events include role, session_id, topic, cwd
- Discovery reads our own event stream (ZFC-compliant)
3. ADDED: --talk flag for actual seances
- gt seance --talk <session-id> spawns: claude --fork-session --resume <id>
- --fork-session creates a new session (read-only, no grave disturbance)
- You literally talk to your predecessor: "Where did you put X?"
4. ADDED: One-shot prompt mode
- gt seance --talk <id> -p "Where is the config?"
- Uses claude --print for quick questions
The name "seance" is now literal - you commune with the dead (past sessions).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The runSlingFormula function was calling bd wisp which does not exist.
The correct command is bd mol wisp for creating ephemeral molecules.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Parses Claude Code ~/.claude/projects/ to find Gas Town sessions.
Sessions are identified by the [GAS TOWN] beacon in startup messages.
Features:
- Filter by role (crew, polecat, witness, etc.)
- Filter by rig name
- Show recent N sessions
- JSON output for scripting
- Sorts by most recent first
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
getTrackedIssues was spawning a separate bd show subprocess for each
tracked issue. With 10 convoys x 5 issues = 50+ subprocesses per poll.
Solution: Use bd show batch capability (bd show id1 id2 id3 --json)
to fetch all issue details in a single call. Falls back to individual
lookups if the batch fails (e.g., invalid IDs).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a third panel to the feed TUI showing:
- In-progress convoys with progress bars (completed/total)
- Recently landed convoys (last 24h) with time since landing
Features:
- Panel cycles with tab: tree -> convoy -> feed
- Direct access via 1/2/3 number keys
- Auto-refresh every 10 seconds
- Styled progress indicators (●●○○)
The convoy panel bridges the gap between "WHO is working" (agent tree)
and "WHAT is happening" (event feed) by showing "WHAT IS SHIPPING".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add RuntimeConfig type to RigSettings allowing per-rig LLM runtime
configuration. This moves hardcoded "claude --dangerously-skip-permissions"
invocations to configurable settings.
Changes:
- Add RuntimeConfig type with Command, Args, InitialPrompt fields
- Add BuildCommand() and BuildCommandWithPrompt() methods
- Add helper functions: LoadRuntimeConfig, BuildAgentStartupCommand,
BuildPolecatStartupCommand, BuildCrewStartupCommand
- Update startup paths in up.go and mayor.go to use new config
- Add comprehensive tests for RuntimeConfig functionality
Remaining hardcoded invocations can be updated incrementally.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The getCleanupStatus function in witness/handlers.go and crew removal
in cmd/crew_lifecycle.go were constructing agent bead IDs with hardcoded
"gt-" prefix. This failed for rigs that use a different prefix like "bd-".
Now uses beads.GetPrefixForRig to look up the correct prefix from
routes.jsonl, enabling support for the beads rig and any future rigs
with custom prefixes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The command now refuses to nuke a polecat unless it passes safety checks:
1. Worktree has no unpushed/uncommitted changes
2. Polecat has no open merge request beads
3. Polecat has no work on its hook
Use --force to bypass these checks (loses work).
Use --dry-run to see safety check status before nuking.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SendKeys has an Enter-concatenation bug that causes the nudge to fail.
NudgeSession is the canonical way to message Claude and works reliably.
Fixes cold starts of crew workers (gt crew start).
(gt-7swyi)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When adding a dog, creates an agent bead with role_type:dog label.
When removing a dog, deletes the corresponding agent bead.
This enables @dogs group resolution in the mail router by allowing
queries like `bd list --type=agent --label=role_type:dog`.
Changes:
- Add DogBeadID(), DogRoleBeadID() helper functions
- Add CreateDogAgentBead() for creating dog agent beads with labels
- Add FindDogAgentBead() and DeleteDogAgentBead() for cleanup
- Add Labels field to Issue struct for label parsing
- Update ParseAgentBeadID() to handle dog bead IDs (gt-dog-<name>)
- Update IsAgentSessionBead() to include "dog" as valid role
(gt-qha0g)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When Mayor creates a convoy, automatically default --notify to 'mayor/'
since the Mayor dispatched the work and should be notified when it lands.
This reduces flag boilerplate for the common case.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The `bd slot` command is for agent beads only. Convoy beads aren't agents,
so the slot set failed with exit status 1. The notify address is already
stored in the convoy's description, which is the intended persistence
mechanism.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
gt nudge now accepts role shortcuts that expand to session names:
- mayor → gt-mayor
- witness → gt-<rig>-witness (uses current rig)
- refinery → gt-<rig>-refinery (uses current rig)
This makes it easier to nudge common targets without needing to
remember the full session naming conventions.
(gt-w1te9)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add State (idle/processing/blocked) and Health (healthy/stale/empty) fields to MQSummary
- Display state indicator (● for processing, ○ for idle/blocked)
- Show [stale] warning when queue has >10 pending items with no processing
- Include new fields in JSON output for automation
(gt-hpcyt)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Set Spawned=true when DispatchToDog creates a new dog, allowing
callers to distinguish between reusing an existing dog vs spawning.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add bidirectional cross-references between MR beads and agent beads:
1. MRFields.AgentBead - tracks which agent created the MR
2. AgentFields.ActiveMR - tracks agent's current MR
In gt done:
- Include agent_bead in MR description when creating
- Update agent bead with active_mr pointing to the new MR
In refinery merge handling:
- Clear agent bead's active_mr after successful merge
Benefits:
- Given MR, find which polecat created it
- Given polecat, find their active MR
- Orphan detection: MR without agent = stale
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Agent bead ID validation was hardcoded to only accept "gt-" prefix, which
caused errors when spawning beads polecats (which use "bd-" prefix):
Error: invalid agent ID: agent ID must start with 'gt-' (got "bd-beads-polecat-pearl")
Changed ParseAgentBeadID to accept any 2-3 character prefix (gt-, bd-, hq-)
instead of hardcoding "gt-". Updated tests to cover other prefixes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The --json flag was only registered on the status subcommand, not the
parent hook command. When running `gt hook --json` (no args), it would
fail with "unknown flag". Now the flag is registered on both.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove routine POLECAT_PROCESSED and WITNESS_REPORT/REFINERY_REPORT
mail types from Witness→Mayor communication.
Changes:
- Remove Notify Mayor step for routine polecat processing from
witness-CLAUDE.md template
- Remove WITNESS_REPORT and REFINERY_REPORT callback types from
callbacks.go (pattern matching, handlers, constants)
- Update callback help text to reflect new behavior
Witness now handles routine lifecycle autonomously. Only genuine
problems that require human/Mayor intervention are escalated:
- ESCALATION (problems Witness cannot resolve)
- BLOCKED (needs human decision)
- CRASH_RECOVERY (informational)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add FindMRForBranch helper to check for existing MR beads before creating.
If an MR already exists for the branch, skip creation and reuse it.
This makes gt done safe to re-run if interrupted mid-execution.
Implements Option C from gt-svdsy: idempotent operations that check
if already done before doing, making it safe to retry.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove TouchTownActivity() calls from root.go PersistentPreRun hook
- Remove ReadTownActivity() and activity-based backoff from daemon.go
- Delete TouchTownActivity/ReadTownActivity functions from keepalive.go
- Replace dynamic backoff with fixed 10-min recovery heartbeat
Normal wake is now handled by feed subscription (bd activity --follow).
The daemon is a safety net for dead sessions, GUPP violations, and orphaned work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Boot is spawned by the daemon as the Deacons watchdog. During shutdown
Boot was never explicitly stopped. Now gt down stops Boot between Mayor
and Deacon (step 3) to ensure clean shutdown.
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed autoSpawnPatrol to use --status=hooked instead of --status=pinned.
This ensures patrol wisps are visible to gt mol status and trigger autonomous mode.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Role templates (crew, polecat, mayor, deacon, witness, refinery)
- prime.go startup protocol messages
- Documentation (propulsion, reference, molecules, wisp architecture)
- Session hints and sling prompts
- Formula template instructions
- CLAUDE.md
The hook is the user-facing concept, molecules are implementation details.
Agents should use `gt hook` to check what work is assigned to them.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rewrote gt mol help to focus on agent operations (YOUR hook, YOUR work)
- Removed misleading "use bd mol pour" guidance (gt sling handles this)
- Added gt formulas command as convenience wrapper for bd formula list
- Agents no longer need to know about bd for common workflow operations
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements "vet mode" - the doctor checks on the Boot watchdog:
- Boot directory presence
- Session status (alive/not running)
- Last execution status and errors
- Marker file freshness (stale marker indicates crash)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Makes 'gt hook' (no args) show hook status instead of requiring a bead ID.
Also adds 'gt hook status' subcommand for explicit usage. The hook concept
is user-facing while molecules are implementation details.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Accidentally included staged reverts in previous commit. Restoring:
- convoyAddCmd for 'gt convoy add' command
- Event filtering/deduplication in feed model
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add WorktreeAddExistingForce to git package (uses --force flag)
- Fix worktree creation: use force flag so main can be checked out
in multiple worktrees (needed for cross-rig work)
- Implement 'gt worktree remove <rig>' with --force flag
- Refuse to remove worktrees with uncommitted changes unless forced
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the 'add' subcommand to convoy that:
- Validates the convoy exists
- Automatically reopens closed convoys
- Adds 'tracks' dependency for each issue
- Warns but doesn't fail on issues that can't be added
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add gt polecat check-recovery command to check cleanup_status from agent bead
- Update gt polecat nuke to block on polecats with unpushed work (use --force to override)
- Add EscalateRecoveryNeeded function for RECOVERY_NEEDED escalations
- Update Witness template with dormant polecat recovery protocol
Prevents accidental data loss when cleaning up dormant polecats that have
unpushed commits. The Witness should now use check-recovery before nuking
and escalate NEEDS_RECOVERY cases to the Mayor.
(gt-cloml)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Parent commands (mol, mail, crew, polecat, etc.) previously showed help
and exited 0 for unknown subcommands like "gt mol foobar". This masked
errors in scripts and confused users.
Added requireSubcommand() helper to root.go and applied it to all parent
commands. Now unknown subcommands properly error with exit code 1.
Example before: gt mol unhook → shows help, exits 0
Example after: gt mol unhook → "Error: unknown command "unhook"", exits 1
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Examples:
gt crew add murgen croaker goblin # Create all three
gt crew add dave # Still works for single
- Continues on failure (warns but doesn't abort)
- Shows summary at end
- Existing workspaces skipped with warning
- Rig add now creates empty crew/ directory with README
- Crew members must be added explicitly with 'gt crew add <name>'
- Removed --crew flag from rig add command
- Updated help text and output to reflect new behavior
This gives users control over crew member names rather than defaulting to 'max'.
Agents weren't auto-executing after gt handoff because the SessionStart
hook only outputs text - it doesn't inject a prompt. Claude needs actual
user input to trigger a response.
The fix: pass "gt prime" as an argument to claude, just like gt crew at
already does. This treats the argument as the first user prompt, which
triggers GUPP execution immediately.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>