I have minions now: little Claude Code automations that capture my sessions, organize my drafts, and write my journal entries. Here’s how I built them using hooks, commands, and skills.
The Problem
I wanted to document my learning consistently but manual journaling felt like overhead. Writing entries after the fact meant forgetting context and details. I needed a system that:
- Captured sessions automatically as they happened
- Organized captures into themes
- Generated polished entries without starting from scratch
What I Learned
Claude Code has four extensibility points that make this possible:
Hooks
Hooks run shell scripts on events. The SessionEnd hook captures every
conversation:
# capture-session.sh
TRANSCRIPT_PATH=$(echo "$HOOK_INPUT" | jq -r '.transcript_path')
CONVERSATION=$(jq -r '
select(.type == "user" or .type == "assistant") |
select(.message.content != null) |
"**" + (.type | ascii_upcase) + "**: " + .message.content
' "$TRANSCRIPT_PATH")
cat > "$DRAFT_FILE" << EOF
---
captured: $(date -Iseconds)
project: ${PWD##*/}
session_id: $(echo "$HOOK_INPUT" | jq -r '.session_id')
status: draft
---
$CONVERSATION
EOFThe hook reads JSON from stdin, extracts the transcript path, parses the conversation,
and saves it to ~/garden/drafts/. No user action required.
Commands
Commands are reusable prompts stored as markdown files. The /drafts command
analyzes captured sessions:
# drafts.md
1. List files in `~/garden/drafts/`
2. Read each draft's frontmatter and content
3. Group drafts by learning theme (not project name)
4. Suggest journal entries with summaries
5. Save analysis to journal-plan.md
6. Move analyzed drafts to gardening/ subdirectorySkills
Skills are multi-step workflows with tool access. The journal-writer skill defines
voice and structure:
# journal-writer/SKILL.md
## Voice and Style
- First person: "I learned...", "I discovered..."
- Conversational but technical
- Honest about struggles
## Entry Structure
1. Brief intro paragraph
2. ## The Problem - what was I trying to solve?
3. ## What I Learned - technical content with code
4. ## Key Takeaways - bullet points
5. See also: wikilinks to related topicsThe /journal command loads this skill and synthesizes drafts into polished entries
that match the defined voice.
The Complete Flow:
Session ends → capture-session.sh → drafts/YYYY-MM-DD_HHMMSS.md
↓
/drafts → groups by theme → drafts/YYYYMMDD-journal-plan.md
↓
/journal N → journal-writer skill → journal/YYYY-MM-DD-slug.md
Each stage is automated but gives me control points to review and refine.
Key Takeaways
- Hooks are shell-only: They can’t invoke Claude directly, just run commands. Good for capture, not synthesis.
- Commands are prompts: They expand inline in the conversation. Use for repeatable instructions.
- Skills define voice: They run in subagents with fresh context. Perfect for complex multi-step workflows.
- Context management matters: The
/journalcommand runs in a subagent to avoid exhausting the main conversation’s context window. - Automation + control: Each stage is automatic but allows manual intervention when needed.
The distinction between hooks, commands, and skills wasn’t obvious at first. I tried to make hooks do synthesis (impossible - they’re shell-only) and commands handle complex workflows (wrong tool - use skills). Understanding when to use each made the architecture click.
See also: Claude Code, Automation, Git, GitHub Actions, Bash