I Built an AI Memory System Because I Got Tired of Repeating Myself
AI has no memory. Every conversation starts from zero. And I was sick of it.
I'm a production manager in live entertainment - concerts, theater, events. I work with hundreds of crew members, complex schedules, and zero margin
for error. When I started using AI (specifically Claude) to help with my work, I hit a wall immediately:
Every. Single. Session. Started. Over.
"I prefer snake_case for variables."
"Remember, I'm building for iOS with SwiftData."
"Don't use emojis unless I ask."
"My shows use IATSE crew structure."
I'd type these preferences daily. Sometimes hourly. My context window was filling up with repetitive information, my costs were climbing, and the AI
wasn't actually learning from our work together.
So I built Claudarity - a memory system that tracks what works, what doesn't, and automatically provides context when needed.
## The Problem: AI Goldfish Syndrome
Current AI assistants are like having a brilliant colleague with amnesia:
- No memory between sessions
- No learning from past mistakes
- No tracking of what approaches work for you
- No cost optimization or feedback loops
You end up either:
- Wasting tokens re-explaining everything
- Copy-pasting the same context repeatedly
- Losing valuable insights when the chat resets
For a developer building production systems, this isn't just annoying - it's expensive and inefficient.
## The Solution: Claudarity
Claudarity is an AI memory system that integrates with Claude Code via hooks and automation. It:
✅ Auto-tracks wins & losses - When I say "awesome" or "shit", it captures the full conversation context
✅ Remembers what works - SQLite database with full-text search for instant recall
✅ Suggests context - Automatically surfaces relevant past experiences
✅ Monitors costs - Tracks API usage and identifies optimization opportunities
✅ Learns from mistakes - "Losses" become lessons for future sessions
✅ Captures session summaries - When Claude compacts a conversation, the summary is saved
### Real-World Example
Before Claudarity:
Me: "Build a settings view for my iOS app"
Claude: builds generic settings with emoji headers
Me: "No emojis, use SwiftData models, follow my existing architecture"
Claude: "Oh sorry, let me fix that..."
After Claudarity:
Me: "Build a settings view for my iOS app"
Claude: checks memory, sees I hate emojis and use SwiftData
Claude: builds it correctly the first time
## Architecture: How It Works
Claudarity uses an event-driven architecture with bash hooks that trigger on specific Claude Code events:
bash
# Hook fires when user sends a message
~/.claude/hooks/user-prompt-submit.sh
# Detects praise/criticism phrases
if [[ "$user_message" =~ awesome|sick|dope|noice ]]; then
log_win "$conversation_context"
elif [[ "$user_message" =~ shit|damn|no ]]; then
log_loss "$conversation_context"
fi
Tech Stack
- Database: SQLite with FTS5 (full-text search)
- Integration: Bash hooks for Claude Code events
- Search: Custom slash command /gomemory <query>
- Storage: Markdown backups + structured DB
- Architecture: Event-driven, polling-based detection
Data Model
CREATE TABLE wins (
id INTEGER PRIMARY KEY,
timestamp TEXT,
project TEXT,
pattern TEXT, -- What triggered the win
context TEXT, -- Full conversation snippet
summary TEXT, -- AI-generated summary
files_touched TEXT -- Quick reference
);
CREATE TABLE losses (
-- Same structure, but for mistakes
);
CREATE TABLE session_summaries (
-- Captures conversation compaction summaries
);
The Hook System
Claudarity integrates via hooks that fire on:
1. User message submit - Detects feedback phrases
2. Plan mode exit - Captures implementation plans
3. Context triggers - Auto-surfaces relevant memories
4. Session compaction - Saves AI-generated summaries
Results: What Changed
After 30 days of using Claudarity:
📊 234 wins tracked - Successful patterns identified
❌ 42 losses logged - Mistakes avoided in future
💰 ~40% cost reduction - Less context repetition
⚡ 80% faster onboarding - AI remembers my style
🧠 Continuous learning - System gets smarter over time
Real Win Example
Here's an actual win entry from my database:
# Win: sick
**Time:** 2025-12-01 17:06:02
**Project:** myroproductions
**Pattern:** sick
## AI Summary
Renamed the `/memory` command to `/gomemory` to avoid conflicts
with CLI built-in commands. Updated all references throughout the
Claudarity system.
## Quick Context
Files: log-feedback.sh, context-aware-start.sh,
CONTEXT-AWARE-SUGGESTIONS.md
## User Message
sick
Now when I work on similar tasks, Claudarity surfaces this experience automatically.
The Workflow
1. I work with Claude normally
2. When something works, I say "awesome" or "sick"
3. Claudarity captures the full context as a "win"
4. When I make a mistake, I say "shit" or "damn"
5. Claudarity logs it as a "loss" to avoid repeating
6. Next session, Claude can query memories with /gomemory <topic>
7. Relevant context surfaces automatically based on keywords
Code Snippet: Win Detection
Here's the core logic for detecting and logging wins:
# Detect praise patterns (case-insensitive, up to 5 words)
praise_phrases=(
"awesome" "sick" "dope" "noice" "rad"
"hell yeah" "i agree" "perfect"
)
user_message="$1"
word_count=$(echo "$user_message" | wc -w)
if [ "$word_count" -le 5 ]; then
for phrase in "${praise_phrases[@]}"; do
if echo "$user_message" | grep -iq "^${phrase}$"; then
# Capture full conversation context
context=$(get_recent_context)
# Generate AI summary
summary=$(summarize_conversation "$context")
# Store in database
sqlite3 "$DB_PATH" <<EOF
INSERT INTO wins (timestamp, project, pattern, context, summary)
VALUES (datetime('now'), '$PROJECT', '$phrase', '$context', '$summary');
EOF
# Show confirmation
echo "✅ Win logged: $phrase"
break
fi
done
fi
What's Next
I'm open-sourcing the core Claudarity system. The roadmap:
- Clean up the codebase for public release
- Create installation scripts for easy setup
- Add support for other AI assistants (ChatGPT, etc.)
- Build a web dashboard for visualizing wins/losses
- Integrate vector embeddings for semantic search
- Create templates for domain-specific memory systems
Why This Matters
AI is only as useful as its ability to learn from your workflow.
Claudarity isn't just a memory system - it's a feedback loop that makes AI incrementally better at working with you specifically. Every win teaches it
what you like. Every loss prevents future mistakes.
For developers building real products with AI, this kind of persistent learning is the difference between:
- A tool that helps occasionally
- A system that actually understands your domain
Try It Yourself
I'm planning to release Claudarity on GitHub in the coming weeks. If you're interested:
1. Follow me here on Dev.to for updates
2. Connect on LinkedIn [your-profile]
3. Check my GitHub for the release: github.com/nicolasmyers
Want to build something similar for your workflow? Here's what you need:
- Hook system in your AI tool (Claude Code has this built-in)
- SQLite database with FTS5
- Event detection for feedback signals
- AI summarization for context capture
The whole system is ~500 lines of bash and SQL. You can build your own in a weekend.
Closing Thoughts
I built Claudarity because I was frustrated. Now it's an essential part of how I work with AI.
The best tools solve your own problems first. If you're repeating yourself to AI, you need a memory system. If you're losing context between sessions,
you need persistent storage. If you're not learning from wins and losses, you're leaving performance on the table.
Claudarity gave my AI a memory. Now it's time to give yours one too.
---
What's your biggest frustration with AI assistants? Drop a comment - I'd love to hear what memory systems you're building or what problems you're
trying to solve.
If this was useful, follow for more posts on AI infrastructure, building in public, and making AI work in the real world.
🔧 Building AI tools for live entertainment
🎭 Production Manager turned AI Systems Architect
🤖 Creator of Claudarity
---
P.S. - The name "Claudarity" is a portmanteau of "Claude" + "Solidarity". Because good tools should feel like a partner, not a service.
Top comments (0)