No. 050 Write a skill
Write a hook that {action} after every {event}
Use when one repeated workflow should become a file the agent can load
- Claude Code
- Codex
- Cursor
- Write a skill
write a hook that {action} after every {event}
When to use
“Write a hook that {action} after every {event}” fits when one repeated workflow should become a file the agent can load, because it says “write a hook that {action} after every {event}”, after you replace {action}, {event} with names from the repo.
One filled message for “Write a hook that {action} after every {event}” is: write a hook that record the test command after every a file save
When not to use
Leave “Write a hook that {action} after every {event}” unused when the process is a one-off, or it is still changing every time you do it, because “write a hook that {action} after every {event}” points the other way
How to run it
Claude Code
Claude Code takes “Write a hook that {action} after every {event}” as one paste at the repo root. Do not also save .claude/commands, or “write a hook that {action} after every {event}” replays on the next task.
Codex
Codex takes “Write a hook that {action} after every {event}” as a paste above the task. Leave AGENTS.md unchanged so the next thread does not inherit “write a hook that {action} after every {event}”.
Cursor
Cursor should see “Write a hook that {action} after every {event}” only as a chat paste of “write a hook that {action} after every {event}” for this turn. A file at .cursor/rules would keep applying after the turn ends.
Comparison
对比待补
This before-and-after was not run on this machine.
Related
- Stage: Write a skill
- Same stage: Connect {server} via MCP so you can read its {data} directly
来源:Anthropic · https://code.claude.com/docs/en/prompt-library · 2026-12-01