Claude Code .po reminder hooks never fire: $CLAUDE_TOOL_INPUT is not set
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 .claude/settings.json 和 issue 中連結的 Claude Code hooks 參考文件開始。檢查這三個 hook 如何讀取工具輸入並回傳上下文,接著確認針對 library/os.po 描述的 Edit payload 會觸發提醒,而編輯 .py 檔案則不會。完成條件是三則提醒都以 hook 上下文傳達給 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 分鐘
- 30 天內合併 PR
- 7
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/python-docs-zh-tw 的其他 Issue
-
Translate `library/calendar.po`可能已有人在做 @lilwad-0730 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
python/python-docs-zh-tw#1264 ·
維護者通常 1 天內回覆
-
Translate `c-api/file.po`可能已有人在做 @lilwad-0730 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
python/python-docs-zh-tw#1262 ·
維護者通常 1 天內回覆
-
Translate `howto/enum.po`可能已有人在做 @mattwang44 於 977 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 62/100
python/python-docs-zh-tw#829 ·
維護者通常 1 天內回覆
-
Translate `c-api/number.po`可能已有人在做 @lilwad-0730 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 55/100
python/python-docs-zh-tw#1260 ·
維護者通常 1 天內回覆
-
Translate `c-api/hash.po`可能已有人在做 @lilwad-0730 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 55/100
python/python-docs-zh-tw#1257 ·
維護者通常 1 天內回覆
查看 python/python-docs-zh-tw 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
hkust-nlp/Toolathlon#101 ·
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 78/100
SkyTruth/cerulean-cloud#219 ·
-
area:security priority:low size:small
難度 2/5 1-3 小時 新手友好度 84/100
RonaldHensbergen/composable-data-stack#1217 ·
維護者通常 1 天內回覆
-
good first issue help wanted
難度 2/5 1-3 小時 新手友好度 88/100
blixvip/BlendClone#27 ·
-
難度 2/5 1-3 小時 新手友好度 74/100