mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
a9c36fc852
- hooks/security/ai-bash-guard: PreToolUse with type:agent — AI-powered bash security guard using haiku subagent - settings/hooks/subagent-lifecycle-logger: SubagentStart/SubagentStop audit trail to .claude/agent-log.jsonl - agents/security/read-only-auditor: security auditor with frontmatter hooks blocking Write/Edit/Bash while active
26 lines
1.1 KiB
JSON
26 lines
1.1 KiB
JSON
{
|
|
"description": "Audit trail for subagent invocations using SubagentStart and SubagentStop lifecycle hooks. Every time Claude spawns or finishes a subagent, a timestamped JSON entry is appended to .claude/agent-log.jsonl — recording the agent name, event type, and ISO timestamp. Provides an offline, zero-dependency log for debugging multi-agent workflows, tracking which agents ran and in what order, and estimating AI usage per session.",
|
|
"hooks": {
|
|
"SubagentStart": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "mkdir -p .claude && printf '{\"event\":\"SubagentStart\",\"agent\":\"%s\",\"ts\":\"%s\"}\\n' \"${CLAUDE_AGENT_NAME:-unknown}\" \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\" >> .claude/agent-log.jsonl"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"SubagentStop": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "mkdir -p .claude && printf '{\"event\":\"SubagentStop\",\"agent\":\"%s\",\"ts\":\"%s\"}\\n' \"${CLAUDE_AGENT_NAME:-unknown}\" \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\" >> .claude/agent-log.jsonl"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|