返回
RCreddit.com
22
·6小时前·开发者社区 · RSS

PSA: your claude code sessions are on disk as plaintext json, including everything you ever pasted

查看原文
Claude开源代码

热度趋势

趋势数据积累中

百分比基于当前可用热度信号,而非评论数或独立用户人数。

推荐理由

这条记录涉及编程工具或代码能力更新,适合开发者评估工作流变化和可复用价值。

i went looking for something i'd done weeks ago & found out claude code keeps the whole thing locally. this seems to be news to a lot of people so here it is.

they live in ~/.claude/projects/ / .jsonl, one folder per project, one file per session. on windows that's C:\Users\you\.claude\projects\.

each line is a json object. user turns, assistant turns, and crucially the tool calls & their results, so it's not just the conversation, it's what actually got run and what came back.

three things that made it worth knowing:

grep works. rg "some command" ~/.claude/projects finds the thing you half remember from three weeks ago, in the session where you actually ran it.

you can audit what an agent really did rather than what it said it did. the tool_result entries are the ground truth.

they're bigger than you'd think. one project on my machine has 71 session files, and the largest single session is 35mb. if you've been using it daily since launch, that's real disk.

worth knowing: they're plaintext json, so whatever you pasted into a session is sitting there unencrypted. if you've ever pasted a key into a prompt, it's in one of those files.

anyone doing anything smarter with them? i've only got as far as grep.