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

オープン 初心者向け
#1,248 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
json, python
領域
tooling

調査の方向性

.claude/settings.jsonと、issue内でリンクされているClaude Code hooksのリファレンスから始めてください。3つすべてのhookがツール入力をどのように読み取り、コンテキストを返すかを確認し、次に、library/os.poに対して説明されているEdit payloadがリマインダーを発生させる一方で、.pyファイルの編集では発生しないことを検証してください。3つのリマインダーがhook contextとしてClaudeに届き、無関係なファイルではリマインダーが発生しなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
286
フォーク
229
平均マージ
13時間 7分
マージ済み PR(30日)
7

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python/python-docs-zh-tw のほかの issue

python/python-docs-zh-tw の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。