gsd-check-update.js looked for hooks in configDir/hooks/ (e.g.,
~/.claude/hooks/) but the installer writes hooks to
configDir/get-shit-done/hooks/. This mismatch caused false stale
hook warnings that persisted even after updating.
Also clears the update cache during install so the next session
re-evaluates hook versions with the correct path.
Closes#1249
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gsd-workflow-guard.js was missing the // gsd-hook-version: {{GSD_VERSION}}
header that all other hook files have. The stale hook detection in
gsd-check-update.js scans all gsd-*.js files for this header and flags
any without it as stale (hookVersion: 'unknown'). This caused a
persistent '⚠ stale hooks — run /gsd:update' warning in the statusline
even on the latest version.
Added the version header to gsd-workflow-guard.js. Running /gsd:update
will reinstall the hook with the correct version stamp.
gsd-check-update.js scanned ALL .js files in the hooks directory and
flagged any without a gsd-hook-version header as stale. This incorrectly
flagged user-created hooks (e.g. guard-edits-outside-project.js),
producing a persistent 'stale hooks' warning that /gsd:update couldn't
resolve.
Fix: filter hookFiles to f.startsWith('gsd-') && f.endsWith('.js')
since all GSD hooks follow the gsd-* naming convention.
Includes regression test validating the filter excludes user hooks.
Closes#1200
New opt-in PreToolUse hook that warns when Claude edits files outside
a GSD workflow context (no active /gsd: command or subagent).
Soft guard — advises, does not block. The edit proceeds but Claude
sees a reminder to use /gsd:fast or /gsd:quick for state tracking.
Enable: set hooks.workflow_guard: true in .planning/config.json
Default: disabled (false)
Allows without warning:
- .planning/ files (GSD state management)
- Config files (.gitignore, .env, CLAUDE.md, settings.json)
- Subagent contexts (executor, planner, etc.)
Includes 3s stdin timeout guard and silent fail-safe.
Closes#678
* fix: hook version tracking, stale hook detection, and stdin timeout increase
- Add gsd-hook-version header to all hook files for version tracking (#1153)
- Install.js now stamps current version into hooks during installation
- gsd-check-update.js detects stale hooks by comparing version headers
- gsd-statusline.js shows warning when stale hooks are detected
- Increase context monitor stdin timeout from 3s to 10s (#1162)
- Set +x permission on hook files during installation (#1162)
Fixes#1153, #1162, #1161
* feat: add /gsd:session-report command for post-session summary generation
Adds a new command that generates SESSION_REPORT.md with:
- Work performed summary (phases touched, commits, files changed)
- Key outcomes and decisions made
- Active blockers and open items
- Estimated resource usage metrics
Reports are written to .planning/reports/ with date-stamped filenames.
Closes#1157
* test: update expected skill count from 39 to 40 for new session-report command
- fix(frontmatter): handle CRLF line endings in extractFrontmatter,
spliceFrontmatter, and parseMustHavesBlock — fixes wave parsing on
Windows where all plans reported as wave 1 (#1085)
- fix(hooks): remove duplicate const cwd declaration in
gsd-context-monitor.js that caused SyntaxError on every PostToolUse
invocation (#1091, #1092, #1094)
- feat(state): add 'state begin-phase' command that updates STATUS,
Last Activity, Current focus, Current Position, and plan counts
when a new phase starts executing (#1102, #1103, #1104)
- docs(workflow): add state begin-phase call to execute-phase workflow
validate_phase step so STATE.md is current from the start
Add hooks.context_warnings config option (default: true) that allows
users to disable the context monitor hook's advisory messages. When
set to false, the hook exits silently, allowing Claude Code to reach
auto-compact naturally without being interrupted.
This is useful for long unattended runs where users prefer Claude to
auto-compact and continue rather than stopping to warn about context.
Changes:
- hooks/gsd-context-monitor.js: Check config before emitting warnings
- get-shit-done/templates/config.json: Add hooks.context_warnings default
- get-shit-done/workflows/settings.md: Add UI for the new setting
Fixes#976
The context monitor uses imperative language ("STOP new work
immediately. Save state NOW") that overrides user preferences and
causes autonomous state saves in non-GSD sessions. Replace with
advisory messaging that informs the user and respects their control.
- Detect GSD-active sessions via .planning/STATE.md
- GSD sessions: warn user, reference /gsd:pause-work, but don't
command autonomous saves (STATE.md already tracks state)
- Non-GSD sessions: inform user, explicitly say "Do NOT autonomously
save state unless the user asks"
- Remove all imperative language (STOP, NOW, immediately)
Closes#884
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hooks hardcode ~/.claude/ as the config directory, breaking setups
where Claude Code uses a custom config directory (e.g. multi-account
with CLAUDE_CONFIG_DIR=~/.claude-personal/). The update check hook
shows stale notifications and the statusline reads from wrong paths.
- gsd-check-update.js: check CLAUDE_CONFIG_DIR before filesystem scan
- gsd-statusline.js: use CLAUDE_CONFIG_DIR for todos and cache paths
Closes#870
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The context monitor and statusline hooks wait for stdin 'end' event
before processing. On some platforms (Windows/Git Bash), the stdin pipe
may not close cleanly, causing the script to hang until Claude Code's
hook timeout kills it — surfacing as "PostToolUse:Read hook error" after
every tool call. Add a 3-second timeout that exits silently if stdin
doesn't complete, preventing the noisy error messages.
Closes#775
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The statusline uses a hardcoded 80% scaling factor for context usage,
but Claude Code's actual autocompact buffer is 16.5% (usable context is
83.5%). This inflates the displayed percentage and causes the context
monitor's WARNING/CRITICAL thresholds to fire prematurely.
Replace the 80% scaling with proper normalization against the 16.5%
autocompact buffer. Adjust color thresholds to intuitive levels
(50/65/80% of usable context).
Closes#769
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three files had hardcoded `.claude` paths that break OpenCode and
Gemini installations where the config directory is `.config/opencode`,
`.opencode`, or `.gemini` respectively.
Changes:
- hooks/gsd-check-update.js: add detectConfigDir() helper that checks
all runtime directories for get-shit-done/VERSION, falling back to
.claude. Used for cache dir, project VERSION, and global VERSION.
- commands/gsd/reapply-patches.md: detect runtime directory for both
global and local patch directories instead of hardcoding ~/.claude/
and ./.claude/
- workflows/update.md: detect runtime directory for local and global
VERSION/marker files, and clear cache across all runtime directories
Closes#682
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gemini CLI uses AfterTool as the post-tool hook event name, not
PostToolUse (which is Claude Code's event name). The installer was
registering the context monitor under PostToolUse for all runtimes,
causing Gemini to print "Invalid hook event name" warnings on every
run and silently disabling the context monitor.
Changes:
- install.js: use runtime-aware event name (AfterTool for Gemini,
PostToolUse for others) when registering context monitor hook
- install.js: uninstall cleans up both PostToolUse and AfterTool
entries for backward compatibility with existing installs
- gsd-context-monitor.js: runtime-aware hookEventName in output
- docs/context-monitor.md: document both event names with Gemini
example
Closes#750
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On Windows, child.unref() alone is insufficient for proper process
detachment. The child process remains in the parent's process group,
causing Claude Code to wait for the hook process tree to exit before
accepting input.
Adding detached: true allows the child process to fully detach on
Windows while maintaining existing behavior on Unix.
Closes#466
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Code enforces an 80% context window limit as a safety mechanism.
The statusline was showing the raw percentage, which meant the bar never
reached 100% before Claude ran out of context.
This change scales the percentage so that:
- 0% real usage = 0% displayed
- 80% real usage (the actual limit) = 100% displayed
Color thresholds are adjusted accordingly to maintain the same visual
progression (green -> yellow -> orange -> red with skull).
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Rolled back the intel system due to overengineering concerns:
- 1200+ line hook with SQLite graph database
- 21MB sql.js dependency
- Entity generation spawning additional Claude calls
- Complex system with unclear value
Removed:
- /gsd:analyze-codebase command
- /gsd:query-intel command
- gsd-intel-index.js, gsd-intel-session.js, gsd-intel-prune.js hooks
- gsd-entity-generator, gsd-indexer agents
- entity.md template
- sql.js dependency
Preserved:
- Model profiles feature
- Statusline hook
- All other v1.9.x improvements
-3,065 lines removed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All GSD hooks now use gsd- prefix. Installer updated to clean up old
statusline.js file and hook registration from previous installs.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Wrap intel content in <codebase-intel> tags in plan-phase.md
- Use ENTITY_DIR constant in isEntityFile() instead of hardcoded path
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add handleQuery() function to route query actions
- Support dependents and hotspots query types
- Route query actions via stdin handler before Write/Edit
- Return JSON results to stdout for Claude consumption
- regenerateEntitySummary() now async, prefers graph when available
- Falls back to entity-file-based summary if no graph.db
- Stdin handler properly awaits async regeneration
- SessionStart hook injects graph-backed summary into context
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- generateGraphSummary() queries SQLite graph for rich summary
- Includes dependency hotspots with accurate counts from edges
- Groups nodes by type for module overview
- Tracks total relationships
- Target < 500 tokens for context injection
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- getHotspots() queries top N files by dependent count
- getNodesByType() groups nodes by type with counts
- getDependents() uses recursive CTE for transitive traversal
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add syncEntityToGraph() to upsert nodes and edges on entity write
- Entity id derived from filename, node body contains metadata as JSON
- Wiki-links [[target]] become edges with depends_on relationship
- Delete old edges before inserting new ones for clean updates
- Graph sync runs before summary regeneration
- Silent failures ensure Claude is never blocked
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add getSQL() for cached sql.js WASM initialization
- Add loadGraphDatabase() to create or load graph.db
- Add persistDatabase() to export in-memory DB to disk
- Singleton pattern avoids repeated WASM init overhead
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add sql.js ^1.12.0 dependency for WASM SQLite
- Add GRAPH_SCHEMA constant with nodes/edges tables
- Nodes use virtual id from JSON body for upserts
- Edges indexed by source and target for relationship queries
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- SessionStart now reads pre-generated summary.md directly
- No more JSON parsing of potentially large index.json
- Added guidance: .planning/intel/ should always be gitignored
(changes constantly, can be regenerated with /gsd:analyze-codebase)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New intel-prune.js hook runs after each Claude response.
Checks if indexed files still exist, removes stale entries.
Fast (only fs.existsSync checks) and silent (never blocks).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Hook now checks if .planning/intel/ exists before indexing.
This prevents polluting non-GSD projects with intel files.
Directory is created by:
- /gsd:new-project (during setup)
- /gsd:analyze-codebase (explicit user action)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Read session metadata from stdin
- Check for startup/resume source
- Read index.json and conventions.json from .planning/intel/
- Silent exit if no intel files present
The update check script always looked for VERSION in ~/.claude/get-shit-done/,
but GSD can be installed locally in ./.claude/get-shit-done/. This caused
false "update available" notifications when using local installations.
Changes:
- Check project directory first, then fall back to global
- Remove unused execSync import
On Windows, the detached spawn option creates a visible console window.
Combined with npm (which is a .cmd batch file), this causes a brief
window flash that steals focus from the user's terminal.
- Remove detached: true (not needed, child.unref() handles non-blocking)
- Add windowsHide: true to both spawn() and inner execSync()
- Convert statusline.sh and gsd-check-update.sh to Node.js
- Remove gsd-notify.sh (blocking popups, not true toasts)
- Remove --force-notify and --no-notify flags from installer
- Use `node` command for cross-platform hook execution
Fixes#114
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
STATE.md reflects project state, not session state. It persists across
sessions and shows misleading info like "Phase complete" from previous
work. Now only uses session-scoped todo list.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The hook was grepping for `current_phase:` and `status:` but STATE.md
uses `Phase:` and `Status:`. Now shows actual phase info instead of
always falling back to "Ready for input".
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Alerts user when Claude stops (task complete, needs input, etc.)
with context about what completed. Works on Mac (osascript alert),
Linux (notify-send/zenity), and Windows (PowerShell MessageBox).
Follows same optional install pattern as statusline:
- Prompts in interactive mode if existing hook detected
- --force-notify to replace existing
- --no-notify to skip installation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds SessionStart hook that checks npm in background, caches result.
Statusline shows "⬆ /gsd:update │" when update available.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>