claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Ability to access "transcripts" after a session

Open jonastemplestein opened this issue 10 months ago • 5 comments

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)

jonastemplestein avatar Mar 04 '25 17:03 jonastemplestein

Related: https://github.com/anthropics/claude-code/issues/371

ammario avatar Mar 06 '25 19:03 ammario

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.

junoatwork avatar Mar 19 '25 19:03 junoatwork

Related suggestion: ability to access cost tracking after a session as well, as you can in interactive mode.

htxryan avatar Apr 04 '25 20:04 htxryan

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!)

ezyang avatar May 25 '25 02:05 ezyang

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.

wolffiex avatar May 25 '25 15:05 wolffiex

@bcherny could you please elaborate on how is this now completed? How does one access chat history with claude code?

futpib avatar Jun 02 '25 12:06 futpib

Sigh, I guess I'll vibe code something up

ezyang avatar Jun 08 '25 23:06 ezyang

https://github.com/ezyang/claude-logbook

ezyang avatar Jun 09 '25 02:06 ezyang

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:

claude_code_log.webm

daaain avatar Jun 15 '25 17:06 daaain

Hi @bcherny , this was closed as completed. How to use the solution you implemented? How was this completed? What are the changes?

Nek-12 avatar Jun 26 '25 10:06 Nek-12

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

jakelevirne avatar Jul 01 '25 23:07 jakelevirne

I created a tool to solve this for myself: https://github.com/kym6464/claude-code-tools

Uses daaain/claude-code-log under the hood

kym6464 avatar Jul 13 '25 02:07 kym6464

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.

github-actions[bot] avatar Aug 11 '25 14:08 github-actions[bot]