Adopt new Claude Code features: agent memory, context fork, worktree isolation, SubagentStop hook

- Add `memory: project` to 14 specialist agents for cross-session learning
- Add `context: fork` + `agent:` to 6 analysis skills to preserve main context
- Add `isolation: worktree` to prototyper agent for safe throwaway experiments
- Add SubagentStop hook to complete agent audit trail (start + stop logging)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Donchitos
2026-03-09 13:58:05 +11:00
parent 7d08e396e3
commit 392e3befec
23 changed files with 136 additions and 64 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/bash
# Claude Code SubagentStop hook: Log agent completion for audit trail
# Tracks when agents finish and their outcome
#
# Input schema (SubagentStop):
# { "agent_id": "agent-abc123", "agent_name": "game-designer", ... }
INPUT=$(cat)
# Parse agent name -- use jq if available, fall back to grep
if command -v jq >/dev/null 2>&1; then
AGENT_NAME=$(echo "$INPUT" | jq -r '.agent_name // "unknown"' 2>/dev/null)
else
AGENT_NAME=$(echo "$INPUT" | grep -oE '"agent_name"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"agent_name"[[:space:]]*:[[:space:]]*"//;s/"$//')
[ -z "$AGENT_NAME" ] && AGENT_NAME="unknown"
fi
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
SESSION_LOG_DIR="production/session-logs"
mkdir -p "$SESSION_LOG_DIR" 2>/dev/null
echo "$TIMESTAMP | Agent completed: $AGENT_NAME" >> "$SESSION_LOG_DIR/agent-audit.log" 2>/dev/null
exit 0