|
22 | 22 | ] |
23 | 23 | }, |
24 | 24 | "hooks": { |
25 | | - "_comment": "Hooks run shell commands on Claude Code lifecycle events. type:command runs a script; timeout is in seconds. ${CLAUDE_PROJECT_DIR} resolves to the repo root. The two memory hooks below are LIVE. The commented blocks under _disabled_* are teaching examples: copy one up into its matching event array to activate it.", |
26 | 25 | "SessionEnd": [ |
27 | 26 | { |
28 | 27 | "hooks": [ |
|
44 | 43 | } |
45 | 44 | ] |
46 | 45 | } |
47 | | - ], |
48 | | - "_disabled_PostToolUse_example": { |
49 | | - "_comment": "TEACHING EXAMPLE (inactive because the key is _disabled_*, not a real event name). Rename to PostToolUse to activate. This runs Ruff to auto-format any Python file right after Claude edits it, so demo code is always clean on screen. The matcher scopes it to file-writing tools. The hook script is expected at hooks/scripts/auto-format-python.sh.", |
50 | | - "value": [ |
51 | | - { |
52 | | - "matcher": "Edit|Write|MultiEdit", |
53 | | - "hooks": [ |
54 | | - { |
55 | | - "type": "command", |
56 | | - "command": "bash ${CLAUDE_PROJECT_DIR}/hooks/scripts/auto-format-python.sh", |
57 | | - "timeout": 30 |
58 | | - } |
59 | | - ] |
60 | | - } |
61 | | - ] |
62 | | - }, |
63 | | - "_disabled_PreToolUse_example": { |
64 | | - "_comment": "TEACHING EXAMPLE (inactive). Rename to PreToolUse to activate. This is where a secret-scan guard would sit: a script that inspects a pending Write/Edit for a hardcoded key and exits non-zero (exit 2 = deny) to block the write. Enforces the secrets-security rule at the tool boundary, not just by convention.", |
65 | | - "value": [ |
66 | | - { |
67 | | - "matcher": "Edit|Write|MultiEdit", |
68 | | - "hooks": [ |
69 | | - { |
70 | | - "type": "command", |
71 | | - "command": "bash ${CLAUDE_PROJECT_DIR}/hooks/scripts/secret-scan-guard.sh", |
72 | | - "timeout": 15 |
73 | | - } |
74 | | - ] |
75 | | - } |
76 | | - ] |
77 | | - } |
| 46 | + ] |
| 47 | + }, |
| 48 | + "_hooks_comment": "Hooks run shell commands on Claude Code lifecycle events. type:command runs a script; timeout is in seconds. ${CLAUDE_PROJECT_DIR} resolves to the repo root. The two memory hooks under hooks{} (SessionEnd, SessionStart) are LIVE. The two _hooks_disabled_*_example keys below are teaching examples: copy one into the hooks{} object under its matching event name to activate it. They are NOT nested under hooks{} because the settings loader validates every key there as a lifecycle event name and warns on anything else.", |
| 49 | + "_hooks_disabled_PostToolUse_example": { |
| 50 | + "_comment": "TEACHING EXAMPLE (inactive). Move this array into hooks.PostToolUse to activate. This runs Ruff to auto-format any Python file right after Claude edits it, so demo code is always clean on screen. The matcher scopes it to file-writing tools. The hook script is expected at hooks/scripts/auto-format-python.sh.", |
| 51 | + "value": [ |
| 52 | + { |
| 53 | + "matcher": "Edit|Write|MultiEdit", |
| 54 | + "hooks": [ |
| 55 | + { |
| 56 | + "type": "command", |
| 57 | + "command": "bash ${CLAUDE_PROJECT_DIR}/hooks/scripts/auto-format-python.sh", |
| 58 | + "timeout": 30 |
| 59 | + } |
| 60 | + ] |
| 61 | + } |
| 62 | + ] |
| 63 | + }, |
| 64 | + "_hooks_disabled_PreToolUse_example": { |
| 65 | + "_comment": "TEACHING EXAMPLE (inactive). Move this array into hooks.PreToolUse to activate. This is where a secret-scan guard would sit: a script that inspects a pending Write/Edit for a hardcoded key and exits non-zero (exit 2 = deny) to block the write. Enforces the secrets-security rule at the tool boundary, not just by convention.", |
| 66 | + "value": [ |
| 67 | + { |
| 68 | + "matcher": "Edit|Write|MultiEdit", |
| 69 | + "hooks": [ |
| 70 | + { |
| 71 | + "type": "command", |
| 72 | + "command": "bash ${CLAUDE_PROJECT_DIR}/hooks/scripts/secret-scan-guard.sh", |
| 73 | + "timeout": 15 |
| 74 | + } |
| 75 | + ] |
| 76 | + } |
| 77 | + ] |
78 | 78 | }, |
79 | 79 | "_commands_comment": "Slash commands are NOT declared here. They are markdown files in .claude/commands/. This repo ships two GenAI-on-Azure commands: /deploy-genai (pre-deploy gate + azd deploy walkthrough) and /eval-prompts (run the prompt-eval suite). Open .claude/commands/*.md to read or edit them. Type / in the CLI to list all available commands.", |
80 | 80 | "_mcpServers_comment": "Project-scoped MCP servers for the Claude Code CLI live in .mcp.json at the repo root (the documented team-share location the CLI reads and prompts to approve on clone), NOT here. See .mcp.json for microsoft-learn, oreilly-july20-documentmcp, oreilly-july20-memorymcp, and github. A parallel .vscode/mcp.json registers the document server for VS Code's Copilot." |
|
0 commit comments