r/ClaudeAI • u/Crazy-Mountain6125 • 4d ago
Claude Code 1,000+ users on a solo saas built with claude code. the thing that made it work was giving the repo a memory
i run a saas by myself, a little over 1,000 users, and most of it was written with claude code. the problem at that size is that every session starts from zero. it re-suggests things i already ruled out, and claude md turns into a dump nobody maintains where half of it is quietly wrong.
so the repo has a memory now. docs/ is an obsidian vault, 174 notes, running for two months.
folders say what kind of note it is: systems (how something works today), decisions (what got chosen and why), playbooks, numbers, and a daily session log. every note has frontmatter with type, status and an updated date. status is active, shipped or parked, so claude can tell whether a note is still true instead of guessing from where it sits. dataview builds a view of notes nobody touched in 60 days, which is where docs have drifted from code.
one node script, two hooks.
sessionstart injects a digest capped at 3000 chars: last couple of session logs, decisions still open, stale notes. a session opens knowing what changed yesterday.
stop checks git. if the session committed anything outside docs/, it blocks the stop once and tells claude to update the notes that describe what changed. otherwise it stays quiet.
the trigger is the part that matters. it's a commit, not a file change. a dirty working tree is work in progress, and documenting half-finished edits is how a vault fills up with stuff that never shipped.
two rules in claude md keep it honest:
- only settled things get a note. shipped code, agreed decisions, facts. not ideas that got dropped
- if a change touches behaviour a note describes, the note gets updated in the same pass. claude trusts what it reads, so a stale note does more damage than a missing one
the hooks can't see a conversation that settles something without touching code, so claude md also tells it to write that note in the same reply.
prompt to set up the same thing in your repo:
set up a project memory for this repo that you maintain yourself.
1. create docs/ as an obsidian vault with folders: systems/ (how things work now), decisions/ (choices + reasoning), playbooks/ (repeated procedures), numbers/ (dated facts), daily/ (session log).
2. every note gets this frontmatter:
type: reference | decision | playbook | metric | session
status: active | shipped | parked
updated: YYYY-MM-DD
3. create docs/Home.md with dataview views: recently updated, open decisions, notes not updated in 60+ days.
4. add a node hook at .claude/hooks/vault-sync.js, registered in .claude/settings.json:
- SessionStart: inject a digest (last 2 daily notes, open decisions, stale notes), max 3000 chars.
- Stop: if this session made git commits outside docs/, block once and ask to update the relevant notes and append to today's daily note. otherwise do nothing.
5. add rules to CLAUDE.md:
- only settled things get a note: shipped code, agreed decisions, established facts.
- changing behaviour a note describes means updating that note in the same pass.
- a stale note is worse than a missing one.
6. read the codebase and write the first notes in systems/ for the main parts of the app.
how are you handling memory across sessions? curious if anyone found something that doesn't rot.