Skip to content
Go back

Claude Code's hidden conversation history (and how to actually use it)

Updated:  at  05:35 AM

Claude Code saves every conversation you have. Every single one, sitting right there in ~/.claude/history.jsonl.

But here’s the thing: if you closed that terminal window three days ago and now you’re trying to remember how you fixed that authentication bug, good luck finding it.

What Claude Code gives you (updated)

The built-in tools have gotten better, but they’re still limited. One heads up: these are terminal commands. Run them before starting Claude Code, not during a chat.

For your most recent work:

claude --continue
# or just
claude -c

This picks up exactly where you left off in your last session. Great for “I stepped away for lunch and need to continue.”

For browsing recent sessions:

claude --resume

This used to only show 3 conversations. Now it gives you an interactive picker with more sessions, timestamps, and project names. Better than it was, but still only surfaces recent stuff.

If you remember the session ID, you can jump directly to it:

claude --resume abc123def456

This works great for the last few hours or days. But if you’re trying to find that database optimization conversation from two weeks ago? Still a problem.

The solution: a better /history command

Here’s the fix. Create a custom slash command that shows your ENTIRE conversation history in a clean, scannable format.

First, create the commands directory if you haven’t already:

mkdir -p ~/.claude/commands

Then create the history command file:

cat > ~/.claude/commands/history.md << 'EOF'
Please read my global conversation history from ~/.claude/history.jsonl and present it in an easy-to-scan format.

For each conversation, show:
- Entry number
- Date/time (human readable format: "Nov 10, 2025 15:48")
- Project name (just the folder name, not full path)
- First 60-80 characters of the conversation topic
- Session ID (if available)

IMPORTANT: Format as a plain text table with properly padded columns (NOT markdown tables).

Focus on the most recent 10 conversations in the first table. If there are more, show another 5-7 in an "Additional Recent Conversations" table.

At the end, include:
---
💡 Tip: Resume any conversation by running:
- claude --resume 
- claude --resume to see an interactive list of recent sessions
EOF

Done. Now type /history in any Claude Code session (start a new one) and you’ll see something like this:

Recent Conversation History (Most Recent 10)

| #  | Date               | Project           | Topic                                              | Session ID    |
|----|--------------------|--------------------|---------------------------------------------------|---------------|
| 68 | Nov 10, 2025 09:32 | astro-blog         | Let's add PostHog analytics to track page views... | abc123def456  |
| 67 | Nov 9, 2025 16:45  | tip-calculator     | Help me set up GitHub actions for deployment...    | 789xyz123abc  |
| 66 | Nov 8, 2025 14:22  | client-project     | Debug this payment webhook race condition...       | qwe456rty789  |

Each row shows when it happened, which project, what you were working on, and the session ID to resume.

Why this actually matters

Last week I was debugging a payment flow, got pulled into a meeting, and completely forgot where I was. Came back hours later, typed /history, found “Debug this payment webhook race condition”, ran claude --resume with that session ID, and picked up exactly where we left off.

All the context, all the files, the entire approach—right there waiting.

The command lives in ~/.claude/commands/, so it works across all your projects. Just type /history wherever you are.

No more re-explaining problems. No more “how did I fix that last time?” Just find it, resume it, ship it.

Power user tips

A few more things worth knowing:

VS Code extension for visual browsing

If you prefer clicking around instead of terminal commands, check out the Claude Code Assist extension (agsoft.claude-history-viewer).

Install it from the VS Code marketplace, and you get a sidebar that shows all your conversations with diffs, search, and one-click resumption. Particularly useful if you’re already living in VS Code.

Where conversations actually live

Quick clarification: ~/.claude/history.jsonl is the index, but full conversations live in ~/.claude/projects/ organized by your project paths. Each project gets its own directory with complete conversation data.

You rarely need to touch these directly, but it’s good to know they exist if you’re backing things up or moving between machines.

Essential slash commands while you’re working

Inside a Claude Code session, these commands help manage your conversation:

I use /clear constantly. Finish a task? Clear it. Switch to something different? Clear it. Keeps Claude focused on what matters right now instead of carrying around dead context. I hope I get around to writing about this. My work load says otherwise.

Auto-compaction is a thing

Claude Code automatically compacts conversations when you get close to the 200K token limit. It creates a summary and replaces older messages so you can keep working indefinitely. You’ll see a notification when it happens, and you can check /context to monitor token usage. Be perpared for a little break when this happens it takes Claude Code a few minutes to compact the conversations.

I hit this this limit often, but it’s good to know it won’t just fail when you do.


Another heads up: if your terminal is too small, the table formatting might get wonky. But just tell Claude Code to fix it and it’ll adjust.

If this was helpful, check out my updated Claude Code workflow with background tasks, MCPs, and all the other features that make it indispensable. Also, if you haven’t discovered the double-tap Escape trick to edit your previous prompts, that one’s a game changer too.

Try it out and let me know if this helps you too.



Previous Post
How to edit your previous prompt in Claude Code
Next Post
Claude Code is still crushing it - My updated workflow