Enable Opt-In Hooks
Turn on auto-format, auto-lint, skill-compliance, and skill-extract-reminder — hooks the kit ships disabled by default.
Four of the kit's twelve hooks ship disabled by default because they can be slow or conflict with project configs:
| Hook | What it does | Why it's opt-in |
|---|---|---|
auto-format | Runs the project formatter after every edit | Slow on large files; can fight with editor formatters |
auto-lint | Runs the linter after every edit | Slow; many projects already do this in the editor |
skill-compliance | Checks edited files against active skill checklists | Adds latency proportional to skill count |
skill-extract-reminder | Reminds Claude to extract discoveries as skills | Can be noisy mid-task |
The other eight (protect-files, branch-protect, block-dangerous-commands, conventional-commit, secret-scan, unicode-scan, loop-detect, task-complete-notify) are deterministic and fast, so they're enabled by default.
Verify what's currently active
cat .claude/settings.json | jq '.hooks'The eight always-on hooks should be listed under PreToolUse and PostToolUse. Any of the four opt-in hooks present means it's already enabled.
Enable an opt-in hook
Add to .claude/settings.json under the appropriate lifecycle. The four opt-in hooks plug into different phases:
auto-format and auto-lint — PostToolUse
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write|NotebookEdit",
"hooks": [
{ "type": "command", "command": ".claude/hooks/auto-format.sh" },
{ "type": "command", "command": ".claude/hooks/auto-lint.sh" }
]
}
]
}
}If you already have a PostToolUse block matching Edit|Write|NotebookEdit (the default kit ships one for secret-scan / unicode-scan / loop-detect), append to its hooks array — don't add a second PostToolUse block with the same matcher.
skill-compliance — PostToolUse
{ "type": "command", "command": ".claude/hooks/skill-compliance.sh" }Same lifecycle as auto-format. Runs after edits to verify the file complies with any active skill's checklist.
skill-extract-reminder — UserPromptSubmit
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": ".claude/hooks/skill-extract-reminder.sh"
}
]
}
]
}
}This one's different — it triggers on user prompts, not tool calls.
Use the --profile strict shortcut
If you're installing the kit fresh and want all four enabled:
npx @tansuasici/claude-code-kit init --profile strictThis enables all opt-in hooks at install time. Equivalent to manually editing .claude/settings.json, just faster.
Configure formatter / linter commands
auto-format.sh and auto-lint.sh look at your project to decide what to run:
| Detected | auto-format | auto-lint |
|---|---|---|
package.json with format script | npm run format | — |
package.json with lint script | — | npm run lint |
prettier in deps | npx prettier --write | — |
eslint in deps | — | npx eslint --fix |
pyproject.toml with [tool.ruff] | ruff format | ruff check --fix |
Cargo.toml | cargo fmt | cargo clippy --fix |
go.mod | gofmt -w | — |
If detection fails, the hook exits 0 (no error, no formatting). You can add a project-specific override in .claude/hooks/project/.
Verify
After enabling, edit any source file in a Claude Code session. You should see:
auto-format: file is reformatted on saveauto-lint: lint output appended to Claude's viewskill-compliance: warnings if the edit violates an active skill's rulesskill-extract-reminder: occasional reminders to run/skill-extractor
Disable / revert
Remove the hook entry from .claude/settings.json. No state to clean up — hooks are stateless shell scripts.
When to NOT enable these
- Large files (10k+ lines):
auto-formatandauto-lintwill add 5-30s to every edit. Disable for those projects. - Pair-programming with AI in the editor: your editor's formatter will fight
auto-format. Pick one. - CI-only formatting policy: if your team enforces format/lint only at PR time, the kit's hooks duplicate work.
Related
- Hooks guide — full hook system reference
- Hook source code — exact shell of every hook
- Settings file structure —
.claude/settings.jsonoverview
Add a Project-Specific Skill
Create a custom /skill-name that lives in your project, complementing the kit's built-in audit and workflow skills.
Customize CLAUDE.project.md
Add stack-specific rules that override kit defaults and survive --upgrade. The project overlay is where your team's idiosyncrasies live.