Original Reddit post

claude code stores your sessions locally, but there is no good way to search them. i wanted to ask things like: how did we set up the docker environment for this? what session did we edit registry.py last and what was my reason? what are the wildest moments in our entire session history? most search tools don’t work well on coding sessions because they either use vector retrieval which gets stuff that’s similar but not exactly what you’re looking for, or don’t give enough control to the agent. i built a way for claude to search its session history: prompts, replies, tool calls, file edits, and sub-agents. it works retroactively on the sessions you’ve already had, then updates live. if you want to find how you set up an mcp server or a website, or you want to find the exact session that made a specific change to a file, your agent can do that. if you’re interested in the mechanics, this is what claude would write: sql SELECT v.id, v.score, m.session_id, m.content FROM vec_ops( ‘similar:how the system works architecture diverse suppress:website landing page design tagline’, ‘SELECT id FROM messages WHERE type = ‘‘assistant’’’ ) v JOIN messages m ON v.id = m.id ORDER BY v.score DESC LIMIT 5 this finds the 5 assistant messages that are most similar to how the system works architecture , while suppressing messages that are similar to website landing page design tagline . that is how you get the old architecture thread instead of five landing page drafts. most vector search tools can only do the former, not the latter! i wrote a paper on this approach (link below). also, since the tool is in SQL the mcp instructions are pretty light — claude already knows how to use the mechanics. curl -sSL https://getflex.dev/install.sh | bash -s – claude-code github: https://github.com/damiandelmas/flex paper: https://arxiv.org/abs/2603.22587 website: https://getflex.dev/ if you try it out, let me know what breaks or what you’d want added. installation & indexing took about 20 minutes on my session history. after that it updates live. everything stays on your computer. i’m curious what kinds of searches y’all would be up to. disclosure: i’m the developer. flex is free, MIT licensed, and open source. submitted by /u/damian-delmas

Originally posted by u/damian-delmas on r/ClaudeCode