Updated February 2026. The built-in session tools have improved a lot since I first wrote this. The
/resumepicker is actually good now,/exportexists, and session metadata is way richer. I’ve rewritten sections to reflect what’s current. The custom/historycommand still works and still earns its keep for a global bird’s-eye view.
Claude Code saves every conversation you have. Every single one, sitting right there in ~/.claude/history.jsonl. Mine has over 1,300 entries at this point. I don’t know whether to be proud or concerned.
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 through the built-in tools alone.
Table of contents
Open Table of contents
What Claude Code gives you now
The built-in tools have gotten significantly better since I first wrote this post (to the point where I considered deleting the whole article, but my SEO brain wouldn’t let me). Here’s what you get out of the box.
Continue your most recent session:
claude --continue
# or just
claude -c
This picks up exactly where you left off in your last session for the current directory. Great for “I stepped away for lunch and need to continue.” I use this one daily.
Browse and resume any recent session:
claude --resume
# or
claude -r
When I originally wrote this, the picker was bare-bones. Now it shows an interactive list with session summaries, message counts, git branch names, and timestamps. You can press A to toggle between current directory and all projects, or B to filter by your current git branch. It’s kind of nice now.
If you have the session ID handy, jump straight to it:
claude --resume abc123def456
Resume from inside a session:
This is the one that made me update the post. You don’t have to exit Claude Code to switch sessions anymore. Just type /resume during any conversation and the same picker comes up. If you bounce between tasks a lot (hi, that’s me), this is huge.
Name your sessions:
/rename auth-refactor
Give a session a human-readable name so you can find it later without squinting at auto-generated summaries. I wish I’d started doing this sooner. Past Kent left Future Kent a lot of sessions called “explain this function” and they’re all useless now.
Save or export a conversation:
/export my-session.md
Saves the full conversation to a file (or your clipboard if you skip the filename). Useful for documentation, sharing with teammates, or just having a record outside of Claude’s internal storage. I’ve started exporting sessions before big refactors so I have a paper trail of the reasoning.
These built-in tools cover most day-to-day needs. But if you have hundreds of sessions across dozens of projects and you want a single global view of everything (the “what was I even working on last Thursday?” problem), keep reading.
The custom /history command
The built-in /resume picker is great for browsing sessions, but it shows session-level data (summaries, message counts). The custom /history command reads the raw history.jsonl file, which logs every individual prompt you’ve ever sent. If you’re trying to find a specific thing you typed two weeks ago but can’t remember which session it was in, this is the one that finds it.
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 <session-id>
- claude --resume (to see an interactive list of recent sessions)
EOF
Done. Now type /history in any Claude Code session 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. It’s basically git log for your Claude conversations.
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.
Where conversations actually live
Quick clarification on the file structure, because people ask about this a lot (and I had to go digging myself to figure it out):
~/.claude/history.jsonl is the global index. Each line is a JSON object with your prompt text, timestamp, project path, and session ID. Think of it as a log of every input you’ve ever sent across every project. It grows forever. Mine is over 600KB and counting.
~/.claude/projects/ is where full session data lives. Each project gets its own directory (named after the project path, with dashes replacing slashes) containing:
- Individual session files as
.jsonl(the complete conversation transcript) - A
sessions-index.jsonwith the good metadata: auto-generated summaries, message counts, git branches, creation and modification timestamps - A
memory/directory for auto-memory (MEMORY.md)
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. I’ve also found sessions-index.json useful for quickly checking how many sessions I’ve burned through on a project. The answer is always “more than I expected.”
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 and Codex 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 (which, let’s be real, most of us are).
Essential slash commands while you’re working
Inside a Claude Code session, these commands help manage your conversation:
/clear- Wipes conversation history completely. Use this between tasks to keep context fresh./compact- Summarizes your conversation to save tokens while keeping important context. You can add focus instructions too:/compact focus on the auth changes./context- Visualizes your current context usage as a colored grid. Helps you understand when you need to clear or compact./cost- Shows token usage and cost stats for the session. Don’t look at this one too often if you value your peace of mind./stats- Visualizes your daily usage, session history, and streaks. Fun to look at, occasionally humbling.
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 from three problems ago.
Search your command history
Press Ctrl+R inside Claude Code to reverse-search through your previous inputs. Same as bash’s reverse search. Type a few characters and it finds matching commands you’ve sent before. Press Ctrl+R again to cycle through older matches, Tab to accept one.
Not the same as searching conversation content, but surprisingly useful when you’re trying to remember that exact prompt you used last time. I keep rediscovering prompts I forgot I wrote and thinking “past me was actually pretty clever.” (Past me also wrote a lot of bad ones, but we don’t talk about those.)
Rewinding and editing previous messages
Sent a prompt and immediately realized you forgot something? Or Claude went off in a direction you didn’t want and now you’re three messages deep trying to course correct?
Double-tap Escape to open the rewind menu. You can jump back to any previous point in the conversation, undo Claude’s changes to your files, and try again with a different prompt. No new message cluttering up your context. No “actually, what I meant was…” Just rewind and redo.
Single-tap Escape is useful too. It interrupts Claude mid-response while preserving your context, so you can redirect before it finishes going the wrong way.
I wrote a full breakdown of the double-Escape trick if you want the details, but the short version is: stop sending correction messages and start rewinding instead. Your context window will thank you.
Clearing and deleting conversation data
A few different levels here depending on what you actually want:
Clear the current session’s context (keeps the session on disk, just resets what Claude remembers):
/clear
Delete specific session files (permanently removes conversation data):
# Find your project's session directory
ls ~/.claude/projects/
# Delete a specific session file
rm ~/.claude/projects/-Users-you-Code-project/SESSION_ID.jsonl
Delete everything (nuclear option, removes all conversation history across all projects):
rm ~/.claude/history.jsonl
rm -rf ~/.claude/projects/*/
That last one is irreversible, so maybe don’t do it at 2am. Claude Code will recreate the files on the next session, so nothing breaks. You just lose all your history.
Auto-compaction is a thing
Claude Code automatically compacts conversations when you get close to the context window 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 usage. Be prepared for a little break when this happens. It takes Claude Code a minute or so to compact.
I hit this limit often (maybe too often), but it’s good to know it won’t just fail when you do. One tip: keep persistent instructions in your CLAUDE.md file rather than repeating them in conversation, because early messages can get summarized away during compaction. Anything in CLAUDE.md survives no matter what.
Another heads up: if your terminal is too small, the table formatting from /history 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 rewind and edit your previous prompts, that one changed everything for me.
Want more Claude Code productivity tips? I also wrote about the thinking trigger words that control how hard Claude reasons through problems.