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 three extensibility points that make this possible: hooks, commands, and skills.
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:
flowchart TD A([Session ends]) -->|capture-session.sh| B[drafts/YYYY-MM-DD_HHMMSS.md] B -->|/drafts groups by theme| C[drafts/YYYYMMDD-journal-plan.md] C -->|/journal N + journal-writer skill| D[journal/YYYY-MM-DD-slug.md]
Each stage is automated but gives me control points to review and refine.
What the minions don’t do
It would be easy to read this and assume the entries write themselves. They don’t, and that distinction matters to me.
The minions do the hard, tedious work: capturing every session before I forget it, preserving the muscle memory of how I actually solved something, and grouping the raw material into themes. That capture is what makes this whole thing worth building — I never lose a learning again, whether it’s for my future self digging back through old decisions or for a peer I want to share something with.
But the soul and voice of a post is never automated. High-quality writing depends on continuous refinement — tuning the tone, reworking the structure, deciding what to cut — and every entry passes through my own review before it ships. The skill drafts in my voice; it doesn’t get the final word. I do.
So if you’re reading this: it’s curated, not auto-generated. The minions remember so I don’t have to. The judgment, the care, and the final pass are mine. That’s the bond I want to keep with anyone who reads my work.
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.
- Capture is automated, voice is not: The minions remember my learnings so I never lose them; the curation, tone, and final review stay mine. The content is curated, not auto-generated.
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