Ability to access "transcripts" after a session
We'd like to get a "chat transcript" (ideally including tool calls) after each session. We'd use that to improve our prompting (by showing Claude the transcript and asking it where our prompts were bad)
Related: https://github.com/anthropics/claude-code/issues/371
I'd also love this. In addition to #371 to save the session for CC, keeping transcripts is super helpful for sharing successful sessions with colleagues to learn by example. Simonw's llm logs by default, for example, which enables some more cool post-hoc usecases.
Related suggestion: ability to access cost tracking after a session as well, as you can in interactive mode.
The raw data for this is all in ~/.claude, while claude code team should support this directly it probably is a day of vibe coding to build something on this. (Psst, if you open sourced claude code, I bet someone would have already sent a PR for this!)
Of course you can do what you want with your data, but we don't recommend building anything on top of the structure as it currently is in ~/.claude
This is still changing and we make no guarantee about the format or content. A supported log feature does make sense, but isn't a priority for us right now.
@bcherny could you please elaborate on how is this now completed? How does one access chat history with claude code?
Sigh, I guess I'll vibe code something up
https://github.com/ezyang/claude-logbook
Hope you don't mind @ezyang but I forked your tool and ran with it 😅 also pushed to PyPi, but changed the name in case you want to develop and publish yours separately.
So just run:
uvx claude-code-log --open-browser
And you'll get your entire Claude Code transcripts processed and rendered:
Hi @bcherny , this was closed as completed. How to use the solution you implemented? How was this completed? What are the changes?
Here's another approach I built if you're interested in outputting to markdown. (Free, not yet open source, but getting ready to)
https://docs.specstory.com/specstory/quickstart#claude-code
SpecStory provides simple flags to manage your Claude Code conversations:
# Run Claude Code through SpecStory wrapper (default)
specstory
# Sync all Claude Code sessions to markdown files
specstory -s
# Generate markdown for a specific session
specstory -u <session-uuid>
# Run with verbose output to see what's happening
specstory -s --verbose
Automatic capture: Running specstory launches Claude Code and captures conversations Project-based organization: Sessions are saved in .specstory/history/ with timestamps Batch conversion: Use -s flag to convert all existing sessions to markdown Git-friendly: All output is clean markdown, perfect for version control
I created a tool to solve this for myself: https://github.com/kym6464/claude-code-tools
Uses daaain/claude-code-log under the hood
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.