summaryrefslogtreecommitdiff
path: root/hooks/hooks.json
AgeCommit message (Collapse)Author
2026-03-15fix: stop firing SessionStart hook on --resumejesse
Resumed sessions already have injected context in their conversation history. Re-firing the hook was redundant and could cause issues. The hook now fires only on startup, clear, and compact. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01fix: use double quotes for CLAUDE_PLUGIN_ROOT in SessionStart hookatian8179
Replace single quotes with escaped double quotes around ${CLAUDE_PLUGIN_ROOT} in hooks.json so the shell variable expands correctly on Linux. Single quotes prevent variable expansion, causing the hook to fail with 'No such file or directory'. Closes #577
2026-02-21fix: quote CLAUDE_PLUGIN_ROOT for spaces, use POSIX-safe path resolutionJesse Vincent
- Quote ${CLAUDE_PLUGIN_ROOT} in hooks.json to handle paths with spaces (e.g. "C:\Users\Robert Zimmermann\...") - Replace bash-only ${BASH_SOURCE[0]:-$0} with POSIX-safe $0 in run-hook.cmd so the Unix path doesn't break on dash (/bin/sh) Addresses: #518 (spaces in path), Ubuntu/Debian compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21fix: restore polyglot wrapper to fix Windows hook window spawningJesse Vincent
Claude Code spawns hook commands with shell:true + windowsHide:true, but on Windows the execution chain cmd.exe -> bash.exe causes Git Bash (MSYS2) to allocate its own console window, bypassing the hide flag. This creates visible terminal windows that steal focus on every SessionStart event (startup, resume, clear, compact). The fix: - Rename session-start.sh to session-start (no extension) so Claude Code's .sh auto-detection regex doesn't fire and prepend "bash" - Restore run-hook.cmd polyglot wrapper to control bash invocation on Windows (tries known Git Bash paths, then PATH, then exits silently if no bash found) - On Unix, the polyglot's shell portion runs the script directly This avoids Claude Code's broken .sh auto-prepend, gives us control over how bash is invoked on Windows, and gracefully handles missing bash instead of erroring. Addresses: #440, #414, #354, #417, #293 Upstream: anthropics/claude-code#14828
2026-02-12Make SessionStart hook synchronous so using-superpowers loads before first turnJesse Vincent
When async is true, the hook may not complete before the model starts responding, meaning the using-superpowers skill instructions aren't in context for the first message.
2026-02-05fix: run SessionStart hook async to prevent Windows terminal freezeJesse Vincent
The synchronous SessionStart hook blocked the TUI from entering raw mode on Windows, freezing all keyboard input. The pure-bash escape_for_json function is O(n^2) on Git Bash, taking 60+ seconds. Running the hook async prevents the freeze while still injecting superpowers context. Multiple users confirmed this workaround. Fixes #404, #413, #414, #419
2026-01-23fix: Windows hook execution for Claude Code 2.1.x (#331)Jesse Vincent
* fix: convert shell scripts from CRLF to LF line endings Add .gitattributes to enforce LF line endings for shell scripts, preventing bash errors like "/usr/bin/bash: line 1: : command not found" when scripts are checked out on Windows with CRLF. Fixes #317 (SessionStart hook fails due to CRLF line endings) Files converted: - hooks/session-start.sh - lib/brainstorm-server/start-server.sh - lib/brainstorm-server/stop-server.sh - lib/brainstorm-server/wait-for-feedback.sh - skills/systematic-debugging/find-polluter.sh Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: update Windows hook execution for Claude Code 2.1.x Claude Code 2.1.x changed the Windows execution model: it now auto-detects .sh files in hook commands and prepends "bash " automatically. This broke the polyglot wrapper because: Before: "run-hook.cmd" session-start.sh (wrapper executes) After: bash "run-hook.cmd" session-start.sh (bash can't run .cmd) Changes: - hooks.json now calls session-start.sh directly (Claude Code handles bash) - Added deprecation comment to run-hook.cmd explaining the change - Updated RELEASE-NOTES.md Fixes #317, #313, #275, #292 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-01Add Windows support for plugin hooks (#134)Jesse Vincent
* feat: Add Windows support for session-start hook - Create polyglot session-start.cmd that works in both CMD and bash - Update hooks.json to use the .cmd polyglot launcher - Replace sed/awk with pure bash for JSON escaping (Windows compatibility) The polyglot script uses a heredoc trick: - CMD sees the @echo off block and runs bash.exe with cygpath conversion - Bash sees a heredoc and skips to the Unix section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Add execute permission to session-start.cmd for Unix 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: Add comprehensive polyglot hooks documentation - Add docs/windows/polyglot-hooks.md explaining the cross-platform technique - Add reusable run-hook.cmd wrapper for parameterized hook execution - Document how the polyglot works in CMD vs bash - Include troubleshooting section and related GitHub issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: Add polyglot hook test script for macOS/Linux Run ./test-polyglot.sh from repo root to verify: - Required files exist with execute permissions - Simple wrapper (session-start.cmd) produces valid JSON - Parameterized wrapper (run-hook.cmd) works - Heredoc correctly skips CMD block on Unix 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Use direct pipe to jq in test to avoid variable escaping issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor: Use single reusable run-hook.cmd for all hooks - Remove session-start.cmd in favor of run-hook.cmd - Update hooks.json to use: run-hook.cmd session-start.sh - Simplify test script to only test run-hook.cmd This makes it easy to add more hooks - just create the .sh file and add a line to hooks.json pointing to run-hook.cmd with the script name. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Simplify run-hook.cmd CMD block Pass path directly to bash instead of using cygpath in a subshell. The complex quoting was causing issues on Windows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: Remove test-polyglot.sh Testing complete - polyglot hooks work on Windows and macOS. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
2025-10-15Revert "Reapply "Move superpowers plugin into plugins/superpowers-bootstrap ↵Jesse Vincent
subdirectory"" This reverts commit 0fdea80a7d6b2e5d6b2d3e59ff2ca378ecd56cc0.
2025-10-15Reapply "Move superpowers plugin into plugins/superpowers-bootstrap ↵Jesse Vincent
subdirectory" This reverts commit d6ac9a8b5d5884413b194330653b6aa336d3c87a. turns out this worked. it's just that anthropic changed claude's startup hook output
2025-10-15Revert "Move superpowers plugin into plugins/superpowers-bootstrap subdirectory"Jesse Vincent
This reverts commit 809956f3bff3a9eb9891f08ce8dd41504e4a5af1.
2025-10-15Move superpowers plugin into plugins/superpowers-bootstrap subdirectoryJesse Vincent
This restructures the repo to support multiple plugins by moving the current plugin into a subdirectory. The plugin continues to be published as "superpowers" in the marketplace.
2025-10-09Add clear and compact to SessionStart matcherJesse Vincent
2025-10-09Fix hooks.json structure: wrap in top-level 'hooks' keyJesse Vincent
2025-10-09Fix SessionStart hook: use command type with scriptJesse Vincent
- Changed from invalid 'type: json' to 'type: command' - Created session-start.sh script that outputs JSON - Script creates ~/.superpowers/ and injects context
2025-10-09Fix SessionStart hook: add hookEventName fieldJesse Vincent
The hookSpecificOutput requires hookEventName to be set.
2025-10-09Initial commit: Superpowers plugin v1.0.0Jesse Vincent
Core skills library as Claude Code plugin: - Testing skills: TDD, async testing, anti-patterns - Debugging skills: Systematic debugging, root cause tracing - Collaboration skills: Brainstorming, planning, code review - Meta skills: Creating and testing skills Features: - SessionStart hook for context injection - Skills-search tool for discovery - Commands: /brainstorm, /write-plan, /execute-plan - Data directory at ~/.superpowers/