WHAT NEW IN X10.30 FRI

X 上的 AI 合集档案 · 22 个合集 · 60,637 条

claudeVIDEO

Claude Code hooks 配置与 Jev 分流思路

帖子讲用 .claude/settings.json 的 hooks 在编辑、提交、停止等节点自动跑格式化和测试,并提出把工具选择、重试等确定性分支交给 Jev 判断,只把需要推理的交给大模型。

delost
@thedelost8 天前收录原推发布于 2026.10.21
delost @thedelost原推发布于 2026.10.21
在 X 上打开原推

this is pure f*cking goldmine: Anthropic just shared one of the best tricks for Claude Code it runs your own shell commands automatically at fixed points in the session, so the checks you always forget just happen every time 1. create .claude/settings.json in your repo with a "hooks" block 2. add a PostToolUse hook matched to Edit|Write that runs your formatter on every file Claude touches 3. add a PreToolUse hook on Edit|Write that blocks writes to protected paths: exit code 2 and the edit never lands 4. add a Stop hook that runs your test suite before Claude is allowed to call the task done 5. add a UserPromptSubmit hook that drops the branch and git status into context on every prompt the whole thing is deterministic: it is your shell running, not the model choosing to JEV engineering is the same move one layer down: the forks that need no thinker (which file, which tool, retry or stop) go to JEV in milliseconds, and the big models only see the ones that split > let Claude write the code. > let the hooks enforce the rules. > let JEV decide what deserves Claude. paste this and the prompt into Claude Code ↓ "Set up hooks in .claude/settings.json for this repo: 1. PostToolUse on Edit|Write: run my formatter on the edited file. 2. PreToolUse on Edit|Write: block writes to protected paths and exit 2. 3. Stop: run the test suite and keep me from calling it done if it fails. 4. Route fast deterministic forks (tool choice, path selection, retries) through JEV. Show me every change as a diff first. No edits until I say go." ↳ http://code.claude.com/docs/en/hooks-guide save it, it'll come in handy

这条是引用着另一条写的:x.com/hanakoxbt/status/2112245381601878026

x.com/thedelost/status/2112641008756564360采集于 2026.10.21 10:04