- Add --purge flag to gt crew remove that:
- Deletes the agent bead (not just closes it)
- Unassigns any beads assigned to the crew member
- Properly handles git worktrees (not just regular clones)
- Add gt doctor crew-worktrees check to detect stale cross-rig worktrees
- Worktrees in crew/ with hyphenated names are now properly cleaned up
using git worktree remove instead of rm -rf
The --purge flag is for accidental/test crew that should leave no trace
in the capability ledger. Normal crew removal closes the agent bead to
preserve CV history per HOP architecture.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
gt crew start beads and gt crew stop beads now default to --all
behavior when no crew names are specified, matching user expectations.
- crew start: accepts 0-1 args (rig only) and starts all crew
- crew stop: detects if single arg is a rig name vs crew name
- Updated help text with new examples
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The crew start command now infers the rig name from the current
working directory when using --all without specifying a rig. This
matches the behavior of crew stop and other commands.
Before: gt crew start gastown --all (required)
After: gt crew start --all (infers from cwd)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added 'spawn' as an alias for 'start' in the following commands:
- gt witness start → also gt witness spawn
- gt refinery start → also gt refinery spawn
- gt deacon start → also gt deacon spawn
- gt crew start → also gt crew spawn
This improves discoverability since agents are guessing 'spawn'
when trying to start roles.
Note: gt polecat does not have a 'start' command - polecat spawning
is handled via 'gt sling'.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed command signature from `gt crew start [name...]` to
`gt crew start <rig> [name]` with --all flag support:
- Takes rig as first required positional argument
- Optional crew member name(s) as subsequent arguments
- --all flag to start all crew members in the rig
- Validates that either name or --all must be provided
🤖 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
Using "greenplace" (The Green Place from Mad Max: Fury Road) as the
canonical example project/rig name in documentation and help text.
This provides a clearer distinction from the actual gastown repo name.
Changes:
- docs/*.md: Updated all example paths and commands
- internal/cmd/*.go: Updated help text examples
- internal/templates/: Updated example references
- Tests: Updated to use greenplace in example session names
Note: Import paths (github.com/steveyegge/gastown) and actual code
paths referencing the gastown repo structure are unchanged.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When run from inside a crew directory like gastown/crew/joe, the command
now auto-detects the crew workspace name instead of requiring it as an
argument. This matches the existing behavior of 'gt crew at'.
🤖 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>
- Fix crew next/prev: Pass session name via key binding to avoid run-shell context issue
- Add TouchTownActivity() for town-level activity signaling
- Implement daemon exponential backoff based on activity.json:
- 0-5 min idle → 5 min heartbeat
- 5-15 min idle → 10 min heartbeat
- 15-45 min idle → 30 min heartbeat
- 45+ min idle → 60 min heartbeat (max)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Users naturally expect "gt crew start <name>" to work alongside
"gt start crew <name>". This adds the alias, handling all input
formats: "name", "rig/name", and "rig/crew/name".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When multiple crew sessions exist in the same rig, C-b n cycles to next
and C-b p cycles to previous. Sessions are sorted alphabetically and
wrap around.
Implementation:
- crew_cycle.go: Hidden `gt crew next/prev` commands for tmux to call
- crew_helpers.go: parseCrewSessionName and findRigCrewSessions helpers
- crew_at.go: Calls SetCrewCycleBindings on session creation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Organize 43 commands into 7 logical groups using cobra's built-in
AddGroup/GroupID feature:
- Work Management: spawn, sling, hook, handoff, done, mol, mq, etc.
- Agent Management: mayor, witness, refinery, deacon, polecat, etc.
- Communication: mail, nudge, broadcast, peek
- Services: daemon, start, stop, up, down, shutdown
- Workspace: rig, crew, init, install, git-init, namepool
- Configuration: account, theme, hooks, issue, completion
- Diagnostics: status, doctor, prime, version, help
Also renamed molecule to mol as the primary command name
(molecule is now an alias).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When running `gt crew at` from inside tmux:
- No longer auto-links the target session as a tab
- Just prints "Started X. Use C-b s to switch."
- User stays in their current pane
When running from outside tmux:
- Default: attach to the session (existing behavior)
- With -d/--detached: start session without attaching
This gives users more control over tmux session navigation and
reduces confusion for tmux newcomers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds support for managing multiple Claude Code accounts in Gas Town:
- accounts.json config parsing in mayor/ directory
- gt account list/add/default commands
- GT_ACCOUNT env var support with priority resolution
- --account flag on gt spawn and gt crew at commands
- CLAUDE_CONFIG_DIR injection into tmux sessions
Priority order: GT_ACCOUNT env var > --account flag > default from config
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- .beads-ephemeral/ -> .beads-wisp/
- Rename doctor checks: EphemeralCheck -> WispCheck
- Update all docs to use 'transient' for polecats, 'wisp' for molecules
- Preserve 'ephemeral' only as descriptive adjective for wisps
- Steam engine metaphor: wisps are steam vapors that dissipate
Part of Christmas launch wisp terminology unification.
Add two new doctor checks:
1. persistent-role-branches: Detects crew/*, witness/rig, refinery/rig
directories not on main branch. Persistent roles should work directly
on main to avoid orphaned work.
2. beads-sync-orphans: Detects code changes on beads-sync branch that
weren't merged to main, catching cases where merges lose code changes.
Also adds ensureMainBranch() to crew attach to auto-switch persistent
roles to main at session start.
Closes gt-p9zh
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix crew sessions missing theme application (ConfigureGasTownSession)
- Add theme persistence to .gastown/config.json
- gt theme <name> now saves to config
- gt theme apply reads from config, falls back to hash-based default
- Improve rig detection using GT_RIG env var and path parsing
- gt theme shows whether theme is configured or default
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add explicit "Run gt prime" to the crew resume prompt and mention
checking in-progress issues for better context recovery.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update gt-5af with full Deacon design (AI agent, not just Go daemon)
- Create 8 implementation tasks as children of gt-5af
- Add AGENTS.md for agent onboarding
- Fix crew restart timing (add debounce, delay for Claude init)
- Add SendKeysDelayedDebounced to tmux for better prompt injection
Deacon will monitor Mayor/Witnesses proactively and handle lifecycle
requests from Mayor/Witnesses/Crew reactively.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When `gt crew at` detects Claude has exited (shell running), or when
`gt crew restart` is used, now sends a crew-specific prompt after priming:
"Read your mail, act on anything urgent, else await instructions."
This gives crew workers clear direction on resume without requiring
manual prompting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tmux status bar theming for Gas Town sessions:
- Per-rig color themes auto-assigned via consistent hashing
- 10 curated dark themes (ocean, forest, rust, plum, etc.)
- Special gold/dark theme for Mayor
- Dynamic status line showing current issue and mail count
- Mayor status shows polecat/rig counts
New commands:
- gt theme --list: show available themes
- gt theme apply: apply to running sessions
- gt issue set/clear: agents update their current issue
- gt status-line: internal command for tmux refresh
Status bar format:
- Left: [rig/worker] role
- Right: <issue> | <mail> | HH:MM
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix ~50 errcheck warnings across the codebase:
- Add explicit `_ =` for intentionally ignored error returns (cleanup,
best-effort operations, etc.)
- Use `defer func() { _ = ... }()` pattern for defer statements
- Handle tmux SetEnvironment, KillSession, SendKeysRaw returns
- Handle mail router.Send returns
- Handle os.RemoveAll, os.Rename in cleanup paths
- Handle rand.Read returns for ID generation
- Handle fmt.Fprint* returns when writing to io.Writer
- Fix for-select with single case to use for-range
- Handle cobra MarkFlagRequired returns
All tests pass. Code compiles without errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add `gt crew restart <name>` command that kills the tmux session and
starts fresh with Claude. Unlike `refresh`, this does not send handoff
mail - it is a clean slate restart. Useful when a crew member gets
confused or needs context cleared.
Alias: gt crew rs
Resolves: gt-1fl
🤝 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 200ms delay after NewSession before sending keys to fix race
condition where shell is not ready (mayor.go, crew.go)
- Use merge-request type instead of task for gt mq submit (mq.go)
Fixes gt-tulx
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
filepath.SplitList is for PATH-like env vars (colon/semicolon separated),
not for splitting file paths. This caused inferRigFromCwd to always fail
since SplitList returns the whole path as one element, making the fallback
logic never trigger.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Check pane_current_command to detect if Claude is still running
- If shell is detected (bash, zsh, etc.), Claude exited - restart it
- Re-prime after restart with gt prime
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- gt crew at: auto-detect crew from cwd, run gt prime after launch
- Polecats now use git worktrees from refinery (faster than clones)
- Updated architecture.md for two-tier beads mail model
- Town beads (gm-*) for Mayor mail/coordination
- Rig .beads/ symlinks to refinery/rig/.beads
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add remaining crew subcommands for user-managed workspaces:
- gt crew list: List crew workspaces with session/git status
- gt crew at/attach: Start or attach to tmux session
- gt crew remove: Remove workspace with safety checks
- gt crew refresh: Context cycling with mail-to-self handoff
- gt crew status: Show detailed workspace status with mail info
All commands support --rig flag for explicit rig selection and
--json output where appropriate.
Closes: gt-cik.9
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements gt-cik.2: Create crew workspace command with:
- internal/crew/types.go: CrewWorker type definition
- internal/crew/manager.go: Manager for crew lifecycle
- internal/crew/manager_test.go: Unit tests
- internal/cmd/crew.go: CLI command with --rig and --branch flags
Crew workers are user-managed persistent workspaces that:
- Clone repo into <rig>/crew/<name>/
- Create optional feature branch (crew/<name>)
- Set up mail directory for delivery
- Initialize CLAUDE.md with crew worker prompting
- Are NOT registered with witness (user-managed)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>