diff --git a/docs/claude/global-claude-settings.md b/docs/claude/global-claude-settings.md index 6fcdc3425..54f194b92 100644 --- a/docs/claude/global-claude-settings.md +++ b/docs/claude/global-claude-settings.md @@ -306,6 +306,8 @@ Restart Claude Code or run `/hooks`. From then on your hooks fire alongside the **Disabling:** empty the arrays, or delete the file. The dispatcher exits 0 in both cases. +**Ready-made personal hooks** that add doc-gates for the `docs/claude/` guides are described in [global-settings/README.md → Optional: personal hooks you can borrow](../../global-settings/README.md#optional-personal-hooks-you-can-borrow). They are optional and not part of the global settings. + ### 9. MCP servers — not configured here `settings.json` does not read an `mcpServers` key ([Claude Code docs](https://code.claude.com/docs/en/debug-your-config#check-common-causes)), so MCP servers are **not** part of the global settings. Versions up to 2.4.0 shipped a dead `mcpServers` block with 7 Playwright browsers; it never loaded anything and was removed in 2.4.1. Configure MCP servers at one of the two supported scopes instead: diff --git a/global-settings/README.md b/global-settings/README.md index e3510e58d..807f77cc8 100644 --- a/global-settings/README.md +++ b/global-settings/README.md @@ -188,6 +188,16 @@ rm ~/.claude/user-hooks.json The dispatcher never blocks Claude regardless of state — a broken personal hook exits with a warning to stderr and Claude keeps going. +### Optional: personal hooks you can borrow + +[`hooks/` in ConductionNL/readonly-mirror-wilco-claude-plans](https://github.com/ConductionNL/readonly-mirror-wilco-claude-plans/tree/main/hooks) holds one developer's personal hooks, run through this dispatcher. They add to the guards here and are not part of the global settings: nothing in this directory depends on them, and you can take any of them or none. The repo is a private, read-only mirror; Conduction developers can read it and fork it. + +- `tool-context.sh` (`PreToolUse`, `PostToolUse`, `Stop`, `PreCompact`) refuses the first write to certain files until the matching guide in [`docs/claude/`](../docs/claude/) has been read in that session. The files and guides are: a hydra skill → `writing-skills.md`, `lib/Controller/*.php` → `writing-controllers.md`, an openspec `spec.md` → `writing-specs.md`, `evals.json` → `skill-evals.md`, an ADR → `writing-adrs.md`, and `src/**/*.vue` → `frontend-standards.md`. It also re-runs `update-skill-overview.sh` after hydra skill edits, and gates hotfix tags and releases behind a playbook. +- `plan-context.sh` (`UserPromptSubmit`) points Claude at those guides, and at notes in that repo, when your prompt is about such work. +- `read-markers.sh` is the read log both scripts share. It records which parts of a file were read, so a guide that was only partly read does not count as read. + +[`hooks/README.md`](https://github.com/ConductionNL/readonly-mirror-wilco-claude-plans/blob/main/hooks/README.md) describes every rule and the `user-hooks.json` entries. The scripts are written for that developer's own setup. The paths, the plans tree and the role lines in the messages are theirs, so adapt them before you register a copy (see [Enabling per-user hooks](#enabling-per-user-hooks)). The production read-only guard started there and has been part of `block-write-commands.sh` since v2.6.0. + ## Not part of the global settings: your own `~/.claude/CLAUDE.md` The global settings decide what Claude is *allowed* to do. How Claude should *work* for you — scope, handover format, commit language, when to ask first — goes in your personal `~/.claude/CLAUDE.md`, which Claude Code loads in every session. That file is deliberately not shipped from this directory: it is not versioned, not `chattr +i`-locked, and an update never touches it.