Skip to content

Claude Code .po reminder hooks never fire: $CLAUDE_TOOL_INPUT is not set #1248

Open

Description

@faizjamal0111-svg

The three hooks in .claude/settings.json grep $CLAUDE_TOOL_INPUT for .po". Claude Code doesn't set that variable; it sends the tool call as JSON on stdin (hooks reference: https://code.claude.com/docs/en/hooks). So the grep never matches and none of the reminders print.

Fixing the variable alone isn't enough: for PreToolUse and PostToolUse, plain stdout on exit 0 goes to the debug log, not to Claude. To reach Claude, the hook returns the text as additionalContext. For the PreToolUse one (needs jq):

"command": "case \"$(jq -r '.tool_input.file_path // empty')\" in *.po) echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"[Translation Context] Remember: Use skills translate-po, terminology-check, validate-translation. Check doc-translate/references/terminology.md for terms.\"}}' ;; esac"

The two PostToolUse hooks are the same with "hookEventName":"PostToolUse" and their own text. Tested with the JSON Claude Code sends for an Edit to library/os.po: before, no output; after, the JSON above, and an edit to a .py file prints nothing.

Found this while testing Claude Code hooks for Paveo; uvx paveo doctor flags all three. Happy to open a PR with the fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions