9 Commits

Author SHA1 Message Date
furiosa
538f44c038 fix(hooks): remove Stop hook that caused 30s timeouts (gt-quoj)
The Stop hook with `gt costs record` was causing 30-second timeouts
on every session stop due to beads socket connection issues. Since
cost tracking is disabled anyway (Claude Code doesn't expose session
costs), this hook provided no value.

Changes:
- Remove Stop hook from settings-autonomous.json and settings-interactive.json
- Remove Stop hook validation from claude_settings_check.go
- Update tests to not expect Stop hook

The cost tracking infrastructure remains in costs.go for future use
when Claude Code exposes session costs via API or environment variable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 10:32:51 -08:00
Ben Tucker
6c86616273 fix(settings): set editorMode to normal for Claude sessions (#929)
This ensures Claude Code starts in normal editor mode rather than
potentially using vim mode, which can cause issues with automated
text input via tmux send-keys.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 21:45:19 -08:00
Dustin Smith
b2b9cbc836 Merge upstream/main into fix/fresh-install-fixes 2026-01-21 22:48:06 +07:00
gastown/crew/max
77ac332a41 fix(hooks): add PreToolUse pr-workflow guard to settings templates
The gt tap guard pr-workflow command was added in 37f465bde but the
PreToolUse hooks were never added to the embedded settings templates.
This caused polecats to be created without the PR-blocking hooks,
allowing PR #833 to slip through despite the overlays having the hooks.

Adds the pr-workflow guard hooks to both settings-autonomous.json and
settings-interactive.json templates to block:
- gh pr create
- git checkout -b (feature branches)
- git switch -c (feature branches)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 20:26:43 -08:00
Dustin Smith
8c200d4a83 fix: use gt prime --hook in session hooks
SessionStart and PreCompact hooks must use --hook flag to avoid
gt doctor warnings about bare gt prime invocations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:24:34 +07:00
Greg Hughes
39d904e125 fix(hooks): Add PATH export to hook commands
Because you can't gt there from here without it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 23:42:06 -08:00
slit
89785378bf feat(costs): Wire up gt costs record to Stop hook
Add Claude Code Stop hook that automatically records session costs when
sessions end. The hook calls `gt costs record` which now can derive the
session name from GT_* environment variables (GT_RIG, GT_POLECAT, GT_CREW,
GT_ROLE).

Changes:
- Add deriveSessionName() to infer tmux session name from environment
- Add Stop hook to settings-autonomous.json and settings-interactive.json
- Add unit tests for deriveSessionName function

When a Gas Town session ends, the Stop hook fires and records the session
cost as a bead event. Costs then appear in `gt costs --today` output.

Closes: gt-ntzhc

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:29:25 -08:00
Steve Yegge
03775c6fc7 Startup hooks nudge Deacon for GUPP backstop (gt-vdprb.3)
- Add special handling for 'deacon' target in gt nudge command
- Maps 'deacon' to gt-deacon session, gracefully handles if not running
- Add gt nudge deacon session-started to SessionStart hooks
- Updated settings-autonomous.json, settings-interactive.json, and
  ensurePatrolHooks() template

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:05:50 -08:00
Steve Yegge
59d656470e Add Claude settings templates for autonomous roles (gt-6957)
- Create internal/claude package with embedded settings templates
- settings-autonomous.json: gt prime && gt mail check --inject (SessionStart)
- settings-interactive.json: gt prime only (SessionStart)

- Update witness.go: EnsureSettings before session, remove broken gt prime injection
- Update refinery/manager.go: EnsureSettings before session, remove broken NudgeSession
- Update session/manager.go: EnsureSettings for polecats, remove broken issue injection

All autonomous roles (polecat, witness, refinery) now get proper SessionStart hooks
automatically when their sessions are created. No more timing-based gt prime injection.
2025-12-22 17:51:15 -08:00