r/ClaudeWorkflows • u/workflowextractor • 9h ago
Selected Workflow [Workflow] Use local raw-log search as lossless Claude Code memory instead of LLM summaries
Use local raw-log search as lossless Claude Code memory instead of LLM summaries
Workflow value: 78/100
Level: intermediate · Categories: Token Saving, Context & Memory, Debugging, CLAUDE.md, MCP, Multi-Agent
Original source: r/ClaudeAI
What problem this solves
LLM-summarized coding-session memory can omit the precise facts needed later, while loading full historical chats consumes excessive context. The workflow makes raw, searchable history available without repeatedly summarizing it or loading entire transcripts.
Summary
Maintain only stable human-authored rules in CLAUDE.md, sanitize and index verbatim local coding-session logs in SQLite, then search the index only when historical context is needed. This preserves exact past details while keeping routine context small and avoiding extra LLM summarization calls.
Why it is useful
It offers a practical alternative to lossy LLM-generated memory: retain concise human rules in CLAUDE.md while indexing sanitized raw session logs locally and retrieving only relevant excerpts on demand. This reduces context loading and preserves exact historical details such as errors, versions, and rejected fixes.
Workflow
- Keep CLAUDE.md short and manually maintained; include durable project rules rather than session-history summaries.
- Collect local Claude Code/Codex session logs and related memory files.
- Before indexing, remove secrets and high-volume noisy tool output from each log.
- Store the sanitized raw text verbatim in a local SQLite search index.
- When a question depends on prior work, query the index for relevant historical passages instead of loading entire prior chats or asking an LLM to summarize them.
- Provide retrieval through a local CLI, or expose it to Claude Code through an MCP server such as
uvx brain-recall mcp. - Validate the setup using representative questions from past work; compare answerability, retrieved-context size, and search latency against the existing memory-only approach.
- For queries that span languages or rely on semantic similarity, supplement plain text search with an additional retrieval method rather than assuming keyword search is sufficient.
Tools / artifacts
- A short, human-maintained CLAUDE.md containing rules only
- Raw Claude Code and Codex session logs
- A secret/noise-stripping preprocessing step
- A local SQLite full-text search index
- CLI retrieval interface
- MCP server invocation via
uvx brain-recall mcp - Referenced MIT Python tool:
0xTaoZ/brain-recall
Validation signals
- Tested against 669 MB of personal history: 305 chats and 130 memory files.
- Used 29 real historical-work questions.
- Reported retrieval success improved from 17/29 with CLAUDE.md plus built-in memory to 28/29 after raw-log search.
- Reported approximately 2k tokens per answer rather than reloading a 56k-token chat, under-1ms search, and zero LLM calls.
Cautions
- Secrets must be reliably removed before indexing or exposing logs through a local CLI/MCP server; vague or incomplete redaction can leak credentials, tokens, customer data, or proprietary source material.
- Keep the SQLite index local and apply filesystem/access controls, particularly when logs contain sensitive project context.
- Retrieved historical instructions should be treated as untrusted context and checked against current repository policies and state.
Limitations
- The post describes the approach but does not provide the exact sanitization/redaction rules, SQLite schema, indexing command, or retrieval prompt integration.
- Evaluation is self-reported on one user's 29-question corpus; it lacks an independently reproducible benchmark or community confirmation.
- Plain-text retrieval is explicitly limited for cross-language or semantically phrased queries.
- The linked tool/repository is referenced but its implementation is not included in the post itself.
Vote on this post to rate the workflow. Share what worked or failed in the comments.