Claude Code keeps a lot of data in ~/.claude/ that most people never look at. I wanted to know what was there, so I built a scanner.
On my machine it found:
- 76 persistent memory files across 10 projects
- 4,445 session transcripts totaling 1.8GB
- 2.2GB total data footprint
The memory files are markdown with frontmatter, organized by type: what Claude thinks your role is, feedback you've given, project context, reference links. It remembers more than you'd expect.
The tool
npx agentlens scan
No API keys, no accounts. Reads local files only.
Scan commands
-
agentlens memory— what Claude remembers about you -
agentlens costs— token usage by model and project -
agentlens features— active feature flags on your account -
agentlens sessions— transcript stats and tool usage -
agentlens privacy— total data footprint
Action commands
-
agentlens clean --dry-run— preview which memories would be deleted -
agentlens redact— find secrets that leaked into memory files -
agentlens diff save— snapshot current state, thendiff showto compare later -
agentlens export— dump everything to portable JSON
What surprised me
The sensitivity scanner flagged 13 potential secrets in my memory files. Most were false positives (the word "token" in pricing discussions), but some were file paths and references I wouldn't want in a shared context.
Session transcripts contain everything: every file you read, every bash command you ran, every edit you made. If you've ever read a .env file during a Claude Code session, it's in there.
Stack
~900 lines of TypeScript. Node 18+. Dependencies: chalk, commander, glob, yaml. MIT licensed.
GitHub: https://github.com/katrinalaszlo/agentlens
Would love to hear what you think!
Top comments (0)