Skip to content

Commit a76c081

Browse files
committed
docs: document the agent hooks and their trust requirement
- Describe the shared format-on-edit hook and the Claude Code and Codex configuration files in the generated project's README - State that both tools apply the configuration only in a trusted project, and that Codex additionally needs the hook trusted through /hooks before it runs
1 parent 9a444ab commit a76c081

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ your-project/
131131
- `.codex/hooks.json`: the same `PostToolUse` hook for Codex
132132
- `.agents/hooks/format-python.sh`: the hook script, runs `ruff format` and `ruff check --fix` on the edited file
133133

134+
Both tools apply this configuration only in a trusted project. Claude Code asks once when you open the
135+
project; Codex additionally requires reviewing and trusting the hook with `/hooks`, and silently skips it
136+
until then.
137+
134138
## Q&A
135139

136140
### How do I run type checking?

‎template/README.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@ uv run ruff check .
3030
uv run ruff check . --fix
3131
```
3232

33+
### AI Coding Agents
34+
35+
Rules for agents live in `AGENTS.md` (`CLAUDE.md` imports it). A shared hook formats and lints every Python
36+
file right after Claude Code or Codex edits it, and reports the remaining diagnostics back to the agent:
37+
38+
- `.agents/hooks/format-python.sh`: the hook script, runs `ruff format` and `ruff check --fix`
39+
- `.claude/settings.json`: Claude Code permissions and the `PostToolUse` hook (committed; put personal
40+
overrides in `.claude/settings.local.json`, which is git-ignored)
41+
- `.codex/hooks.json`: the same `PostToolUse` hook for Codex
42+
43+
Both tools require the project to be trusted before they apply its configuration:
44+
45+
- Claude Code: accept the trust prompt the first time you open the project.
46+
- Codex: trust the project, then review and trust the hook with `/hooks`. Until you do, Codex skips the
47+
hook without reporting an error.
48+
3349
### Docker Development
3450

3551
The template includes a complete Docker setup:

0 commit comments

Comments
 (0)