Closed
Conversation
mksglu
added a commit
that referenced
this pull request
Apr 25, 2026
…2 hook sites (#322) All 22 hook files used raw JSON.parse(raw) which throws SyntaxError on empty/whitespace stdin. On Ubuntu linuxbrew installs, Claude Code can pipe empty stdin to SessionStart hooks, causing "Failed with non-blocking status code" errors and silently disabling session continuity features. Add parseStdin() helper to session-helpers.mjs that strips BOM, trims whitespace, and returns {} for empty input. Replace all 22 JSON.parse(raw) call sites across 6 adapters (Claude Code, Gemini CLI, VS Code Copilot, Cursor, Codex CLI, Kiro) with parseStdin(raw). Tests: 6 unit tests for parseStdin + 21 empty-stdin resilience tests covering every hook file across all adapters. 70/70 pass. Closes #322 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Fixed comprehensively on
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / Why / How
It fixes a claude code startup error. I'm not sure, if it affects other platforms as well.
Affected platforms
Test plan
Nothing - just a one-liner.
Checklist
npm testpassesnpm run typecheckpassesnextbranch (unless hotfix)Cross-platform notes
On claude code on Ubuntu (installed via linuxbrew), I saw this error at startup: