A personal lessons-learned archive for Claude Code. Capture the gotchas, dead-ends, and corrected assumptions Claude makes during a session, then recall the relevant ones via semantic search at the start of a future session — so the same mistake isn't repeated by a stateless model with no memory of the prior conversation.
- Next.js 16 (App Router) on Vercel
- MongoDB Atlas —
lessonscollection with a vector search index over a 512-dim Voyage embedding - Auth.js v5 with GitHub OAuth + MongoDB adapter
- Companion npm package
claudewall(incli/) registers/lessonand/recallslash commands for Claude Code
There is one GitHub OAuth App, callback https://claudewall.com/api/auth/callback/github. GitHub OAuth apps allow only one callback URL, so local dev and Vercel preview deployments can't complete a real GitHub sign-in against it — auth flows are tested on the production deploy.
cp .env.local.example .env.local(or use the pre-filled.env.localon this machine)- Install + run:
npm install npm run dev
- Iterate on UI, lesson rendering, recall page, etc. Sign-in and full
/api/l/*flows are easiest to test on the deployed site.
Required env vars:
MONGODB_URIMONGODB_DB(defaults toclaudewall)AUTH_SECRET(node -e "console.log(require('crypto').randomBytes(32).toString('base64'))")AUTH_GITHUB_ID,AUTH_GITHUB_SECRET(callbackhttps://claudewall.com/api/auth/callback/github)AUTH_URL=https://claudewall.comNEXTAUTH_URL=https://claudewall.comVOYAGE_API_KEY(Voyage AI — embeddings for/recall)
cli/ is excluded from the Vercel deploy via .vercelignore.
In Atlas → Search → Vector Search Indexes, create lessons_vector_index on the lessons collection of the claudewall database with:
{
"fields": [
{
"type": "vector",
"path": "embedding",
"numDimensions": 512,
"similarity": "cosine"
},
{
"type": "filter",
"path": "authorId"
}
]
}The authorId filter scopes recall queries to the requesting user's own lessons.
Users authorize once with:
npx claudewall initThat writes a bearer token to ~/.claudewall/config.json and installs:
~/.claude/commands/lesson.md—/lessonslash command (capture)~/.claude/commands/recall.md—/recallslash command (retrieve)
In any Claude Code session:
/lesson— Claude proposes structured lessons from the recent transcript, you pick which to keep/recall <free text>— pulls up to 3 of your prior lessons most relevant to a situation you're in now
| Path | Purpose |
|---|---|
/ |
Redirect to /l |
/l |
Your lessons (signed-in only) |
/l/[id] |
Single lesson detail |
/l/recall |
Browser recall UI (semantic search over your archive) |
/u/[handle] |
Profile (lesson count; full list only when viewing your own) |
/cli/approve |
Browser approval page for the CLI device flow |
/api/l/submit |
POST — bearer-auth submit (used by /lesson) |
/api/l/recall |
GET — bearer or session auth, returns up to 3 lessons |
/api/cli/{start,poll} |
CLI device-flow auth |
/api/auth/[...nextauth] |
Auth.js |
users,accounts,sessions,verification_tokens— managed by Auth.js MongoDB adapterlessons—{ authorId, title, trigger, mistake, correction, tags[], weight, embedding[], createdAt, ... }cli_codes,cli_tokens— CLI device-flow auth state