A sentiment-aware ASCII cat companion for Claude Code's statusline that generates dynamic motivational phrases.
catcode.mov
Catcode analyzes your conversation with Claude and displays a cute ASCII cat with contextual phrases in your Claude Code statusline:
(=^.^=) | Stay focused today
(=o.o=) | Deep thinking mode
(=-.=) | Progress through struggle
The cat faces and phrases are dynamically generated by Claude's Haiku model based on the sentiment of your latest message - nothing is hardcoded!
- Dual Mode Operation: Works as both a standalone console tool and Claude Code statusline integration
- Dynamic Generation: Cat ASCII and motivational phrases are generated live by Claude Haiku model
- Sentiment Analysis: Responds appropriately to positive, negative, and neutral messages
- Smart Caching: UUID-based caching prevents API spam during statusline updates
- Fast Performance: Sub-second cached responses suitable for ~300ms statusline updates
- Node.js 18+
- Claude Code installed:
npm install -g @anthropic-ai/claude-code
- Authenticated Claude CLI:
claude doctor
-
Clone and setup:
git clone <this-repo> cd catcode chmod +x catcode.sh
-
Test console mode:
./catcode.sh "I'm feeling great today!" # Output: (=^.^=) | Celebrate small victories
-
Configure statusline in
~/.claude/settings.json
:{ "statusLine": { "type": "command", "command": "/path/to/catcode/catcode.sh", "padding": 0 } }
Console Mode:
# Direct argument
./catcode.sh "This is frustrating"
# Output: (=-.=) | Patience builds strength
# Via stdin
echo "Working on the project" | ./catcode.sh
# Output: (=o.o=) | Steady progress counts
Statusline Mode: When configured in Claude Code settings, catcode automatically:
- Receives session JSON via stdin
- Parses the transcript file to find your latest message
- Generates contextual cat + phrase based on sentiment
- Updates your statusline with motivational companion
- Input Processing: Detects JSON (statusline mode) vs plain text (console mode)
- Message Extraction: For statusline mode, parses Claude Code JSONL transcript to get latest user message
- Sentiment Analysis: Uses Claude Haiku to classify sentiment (positive/negative/neutral)
- Dynamic Generation: Prompts Claude to generate appropriate cat ASCII + 3-5 word motivational phrase
- Caching: Stores results by message UUID to avoid redundant API calls
✅ PRODUCTION READY - Full dual-mode operation implemented
✅ Phase 1 COMPLETE - Console prototype with dynamic generation
✅ Phase 2 COMPLETE - Statusline integration with real JSONL parsing
See roadmap.md for detailed development progress.
- Model: claude-3-5-haiku-20241022 for fast, cost-effective generation
- Cache Location:
~/.cache/catcode/
(respects XDG_CACHE_HOME) - Response Format:
(<cat-ascii>) | <motivational-phrase>
- Update Frequency: Optimized for Claude Code's ~300ms statusline refresh rate
- No output: Check
claude doctor
and model availability - Wrong format: Verify jq is installed for JSON parsing
- Slow responses: Check cache directory permissions
- API errors: Ensure Claude CLI is authenticated
A fun little project demonstrating Claude Code's statusline feature with headless API calls and transcript parsing.