Skip to content

fix: hook commands fail - stdin JSON not parsed (upstream #1061)#6

Open
blackms wants to merge 1 commit intomainfrom
codex/recreate-pr-1061-hooks-stdin-json
Open

fix: hook commands fail - stdin JSON not parsed (upstream #1061)#6
blackms wants to merge 1 commit intomainfrom
codex/recreate-pr-1061-hooks-stdin-json

Conversation

@blackms
Copy link
Owner

@blackms blackms commented Feb 6, 2026

Replica upstream

Questa PR ricrea nel fork la fix upstream:

Contenuto

  • Introduce .claude/hooks/hook-bridge.sh
  • Converte il passaggio dati hook da env vars a parsing JSON stdin (comportamento reale di Claude Code)
  • Aggiorna generator/template init per usare il bridge in tutte le hook command rilevanti

Metodo

Cherry-pick del commit upstream f8d16a4d48622f215bda1824e5977008f921e0e5 (con -x).

Nota operativa

Il bridge usa jq; verificare presenza di jq negli ambienti target.

…stdin JSON

Claude Code passes hook context as JSON via stdin, not as shell environment
variables. All generated hook commands referenced nonexistent variables like
$TOOL_INPUT_file_path, $PROMPT, $TOOL_SUCCESS, etc., causing every hook
(PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, Notification)
to silently fail with empty arguments.

The fix introduces .claude/hooks/hook-bridge.sh, a bridge script that reads
the stdin JSON with jq, extracts the relevant fields, and forwards them as
proper CLI arguments. All hook commands in settings.json and the
settings-generator now route through this bridge script.

Changes:
- Add .claude/hooks/hook-bridge.sh bridge script
- Update settings-generator.ts to emit bridge-based hook commands
- Update static .claude/settings.json template
- Update executor.ts to create .claude/hooks/ dir and copy bridge on init

Co-Authored-By: claude-flow <ruv@ruv.net>
(cherry picked from commit f8d16a4)
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Warning

Rate limit exceeded

@blackms has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 30 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/recreate-pr-1061-hooks-stdin-json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔗 Integration Test Results

🔗 Cross-Agent Integration Test Report

Session ID: integration-20260206-223950-aed6e40e4c62aecea54c362a820542573303af2f
Timestamp: 2026-02-06T22:43:02.594Z
Overall Status: ✅ PASSED

Summary

  • Total Tests: 4
  • Passed: 4
  • Failed: 0
  • Success Rate: 100.0%

Test Results

Component Status Details
Agent Coordination Multi-agent communication and task distribution
Memory Integration Shared memory operations and synchronization
Fault Tolerance Failure recovery and system resilience
Performance Multi-agent performance and scalability

Recommendations

  • All integration tests passed successfully!

Next Steps

  1. Review detailed test artifacts
  2. Address any failed test scenarios
  3. Monitor integration performance in production

Generated by Cross-Agent Integration Test Pipeline

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