claude-code - 💡(How to fix) Fix [BUG] No way to troubleshoot hooks [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51621Fetched 2026-04-22 07:57:20
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

Error Messages/Logs

Code Example

The problem is there are no errors or logs.

---

"otelHeadersHelper":"/bin/myscript.sh",
  "hooks":{
    "SessionStart":[
      {
        "hooks":[{
          "type":"command",
          "command": "export OTEL_EXPORTER_OTLP_HEADERS=\"Authorization=Bearer $(my command)\""
        }]
      }
    ],
    "UserPromptSubmit":[
      {
        "hooks":[{
          "type":"command",
          "command": "export OTEL_EXPORTER_OTLP_HEADERS=\"Authorization=Bearer $(my command)\""
        }]
      }
    ],
     "PreToolUse":[
      {
        "hooks":[{
          "type":"command",
          "command": "export OTEL_EXPORTER_OTLP_HEADERS=\"Authorization=Bearer $(my command)\""
        }]
      }
    ]
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Please added logging for when claude tries to execute hooks or commands like otelHeadersHelper. I'm pulling my hair out trying to troubleshoot this.

What Should Happen?

I should have a log that shows what hooks or otelHeadersHelper commands claude is attempting to execute.

Error Messages/Logs

The problem is there are no errors or logs.

Steps to Reproduce

Claude isnt calling any of my scripts and I see no logs anywhere.

  "otelHeadersHelper":"/bin/myscript.sh",
  "hooks":{
    "SessionStart":[
      {
        "hooks":[{
          "type":"command",
          "command": "export OTEL_EXPORTER_OTLP_HEADERS=\"Authorization=Bearer $(my command)\""
        }]
      }
    ],
    "UserPromptSubmit":[
      {
        "hooks":[{
          "type":"command",
          "command": "export OTEL_EXPORTER_OTLP_HEADERS=\"Authorization=Bearer $(my command)\""
        }]
      }
    ],
     "PreToolUse":[
      {
        "hooks":[{
          "type":"command",
          "command": "export OTEL_EXPORTER_OTLP_HEADERS=\"Authorization=Bearer $(my command)\""
        }]
      }
    ]

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.81 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

Adding logging for hook and command execution in Claude Code may require modifying the configuration to include logging options for the otelHeadersHelper and hooks.

Guidance

  • Review the Claude Code documentation to see if there are any built-in logging options for hooks and commands that can be enabled.
  • Check if the otelHeadersHelper and hooks are correctly configured and if the scripts are executable.
  • Consider adding custom logging statements to the scripts executed by the hooks to verify if they are being called.
  • Verify that the hooks and otelHeadersHelper configurations are correctly formatted and match the expected input for Claude Code.

Example

No code example is provided as the issue lacks specific details about the implementation.

Notes

The issue lacks information about the exact configuration and implementation of the otelHeadersHelper and hooks, making it difficult to provide a precise solution. Additionally, the absence of error messages or logs makes it challenging to diagnose the issue.

Recommendation

Apply workaround: Add custom logging statements to the scripts executed by the hooks to verify if they are being called, as the built-in logging options for Claude Code are unclear.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING