Skip to content

Add session start hook for version check#106

Merged
nhorton merged 5 commits intomainfrom
claude/add-version-check-hook-EB51v
Jan 21, 2026
Merged

Add session start hook for version check#106
nhorton merged 5 commits intomainfrom
claude/add-version-check-hook-EB51v

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Jan 21, 2026

Adds a version check that runs at session start and warns users if their Claude Code version is below the minimum (2.1.14). Older versions have known bugs that may cause issues with DeepWork functionality.

The warning is printed to stderr with clear messaging about the issue and a suggestion to run /update to update Claude Code.

claude and others added 5 commits January 21, 2026 20:41
Adds a version check that runs at session start and warns users if
their Claude Code version is below the minimum (2.1.14). Older versions
have known bugs that may cause issues with DeepWork functionality.

The warning is printed to stderr with clear messaging about the issue
and a suggestion to run /update to update Claude Code.
- Use hookSpecificOutput.additionalContext to pass version warning to
  Claude's context, enabling it to inform users appropriately
- Keep visual stderr warning for immediate user visibility
- Add comprehensive test suite (17 tests) covering version comparison,
  warning output, hook conformance, and edge cases
- Fix graceful handling when claude command is not available
Prevent the hook from running multiple times per session by checking
an environment variable at the start. SessionStart hooks can trigger
on resume, clear, etc., and we only want to show the warning once.
The test expected `/update` in stderr but the script outputs
"Update your version of Claude Code" instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@nhorton nhorton merged commit 09dc472 into main Jan 21, 2026
4 checks passed
@nhorton nhorton deleted the claude/add-version-check-hook-EB51v branch January 21, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants