feat: expand agents (10), skills (20), and hooks (11) with profile system
Agents: - Add YAML frontmatter (model, tools) to all 7 existing agents - New agents: planner (opus), build-error-resolver (sonnet), loop-operator (sonnet) Skills: - search-first: research before building (Adopt/Extend/Compose/Build) - verification-loop: full quality gate pipeline (Build→TypeCheck→Lint→Test→Security→Diff) - strategic-compact: when and how to run /compact effectively - autonomous-loops: 6 patterns for autonomous agent workflows - continuous-learning: extract session learnings into instincts Hooks: - Profile system (minimal/standard/strict) via run-with-profile.sh - config-protection: block linter/formatter config edits (standard) - suggest-compact: remind about /compact every ~50 tool calls (standard) - auto-tmux-dev: suggest tmux for dev servers (standard) - session-save/session-load: persist and restore session context (Stop/SessionStart) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
31
.claude/hooks/session-save.sh
Executable file
31
.claude/hooks/session-save.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Save session context on stop for restoration in next session
|
||||
# Event: Stop
|
||||
# Saves: branch, modified files, recent commits, phase
|
||||
|
||||
SESSION_DIR="${CLAUDE_PROJECT_DIR:-.}/.claude/sessions"
|
||||
mkdir -p "$SESSION_DIR"
|
||||
|
||||
SESSION_FILE="$SESSION_DIR/latest.json"
|
||||
|
||||
# Gather session state
|
||||
BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
|
||||
MODIFIED=$(git diff --name-only 2>/dev/null | head -20 | jq -R -s 'split("\n") | map(select(. != ""))')
|
||||
STAGED=$(git diff --cached --name-only 2>/dev/null | head -20 | jq -R -s 'split("\n") | map(select(. != ""))')
|
||||
RECENT_COMMITS=$(git log --oneline -5 2>/dev/null | jq -R -s 'split("\n") | map(select(. != ""))')
|
||||
PHASE=$(grep -m1 'Current Phase' "${CLAUDE_PROJECT_DIR:-.}/docs/phases-plan.md" 2>/dev/null || echo "unknown")
|
||||
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
# Write session file
|
||||
cat > "$SESSION_FILE" << ENDJSON
|
||||
{
|
||||
"timestamp": "$TIMESTAMP",
|
||||
"branch": "$BRANCH",
|
||||
"phase": "$PHASE",
|
||||
"modified_files": $MODIFIED,
|
||||
"staged_files": $STAGED,
|
||||
"recent_commits": $RECENT_COMMITS
|
||||
}
|
||||
ENDJSON
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user