You've Already Solved This Bug. You Just Can't Find the Session.
February 26, 2026
I was debugging a React Native mock issue — jest.resetAllMocks() was destroying module-level mock implementations. Screens that passed yesterday were crashing today.
I knew I'd fixed this exact thing before. Same project, same error pattern. I remembered the session. I remembered being frustrated. I even remembered the fix involved using plain functions instead of jest.fn(() => value). But I couldn't find the session where I'd worked through it.
Claude Code stores every session as a JSONL file in ~/.claude/projects/. One file per session, timestamped messages, full conversation history. It's all there. You just can't search it.
I had hundreds of sessions across a dozen projects. Each one a flat file with no metadata, no title, no index. Finding "that one session where I fixed the mock issue" meant opening files one at a time and scrolling.
The gap I wanted to fill
Claude Code has /resume to pick up recent sessions. It shows you the last few, sorted by date. That's it. No search. No "find every session where I talked about Supabase." No "what did I do in the looksmaxx project last Tuesday."
The data is right there on disk. Every conversation you've ever had with Claude Code, fully preserved. It's just not queryable. (Other tools like claude-code-history-mcp and claude-historian-mcp have since approached this problem too — it's clearly something people want.)
This felt like something that should take an afternoon. It took three days.
The hard part was scoring
Building a file reader that parses JSONL and extracts messages? Easy. Indexing by project path and date? Straightforward. The hard part was search.
Keyword matching is useless when your sessions contain thousands of lines of code, tool outputs, error messages, and conversation. Search for "mock" and you get every session that ever ran a test. Search for "resetAllMocks" and you miss the session where you discussed the concept without using that exact word.
So each session gets scored against the query. Not full-text search — relevance scoring. The first message and last message get heavier weight because they frame the session. Project path matches boost the score. Recency matters. The result is a ranked list where the session you're actually looking for tends to show up first.
The naming problem
Search gets you close. Names get you there instantly.
After I found that mock-fixing session, I named it "RN mock reset destroys implementations." Next time the same bug appears — and it will, because jest.resetAllMocks() is a footgun that never stops firing — I can find it by name.
The names are stored alongside the session metadata. They persist across restarts. They show up in search results. It's a small feature that changes how you think about sessions: they stop being disposable conversations and start being reference material.
What surprised me
Two things I didn't expect.
First: how many sessions I actually had. 505 sessions in about three months. That's 5-6 sessions per day. Each one a focused problem-solving conversation that I'd been treating as ephemeral. The amount of institutional knowledge sitting in those files — debugging approaches, architecture decisions, why a specific implementation was chosen over alternatives — was genuinely surprising.
Second: the MCP server pattern made it composable. I built Claude Sessions as a CLI skill first. It worked, but only in Claude Code. Rewriting it as an MCP server meant any tool that speaks the protocol can query your session history. Claude Desktop, Cursor, custom agents — they all get session search for free. The 6 tools (list_sessions, search_sessions, show_session, name_session, unname_session, session_stats) are the same whether you're in a terminal or an IDE.
The real value
I use this daily now. Not dramatically — I'm not searching old sessions every hour. But when I hit a problem I know I've solved before, I find the answer in seconds instead of minutes. When I start a new session on a project, I check session_stats to see how much history exists. When I have a breakthrough debugging session, I name it so future-me can find it.
The thing about Claude Code sessions is that they're conversations with an expert who has full context on your codebase. Every session is a mini knowledge base. Letting that knowledge disappear after you close the terminal is a waste.
154 tests. 6 MCP tools. Works with any client that speaks the protocol.
npm install -g @iteachyouai/claude-session-skill