Home › All prompts › What Did My Agent Actually Do? Read Your Claude Code Session History

Mini pack

Free

What Did My Agent Actually Do? Read Your Claude Code Session History

You gave Claude Code a big job and came back to "All done!" The app seems fine, but the final message often won't tell you the whole story. These 9 free prompts help you find the history Claude Code keeps on your computer, turn a long run into a plain timeline, check every command and whether it really finished, look for risky moves and leaked keys, and choose how long that history should stay.

Find the history Claude Code keeps on your computer, turn a long run into a plain timeline, check for risky commands and leaked keys, and decide how long that history should stay.

9 prompts in 4 sections. Replace everything in [BRACKETS IN CAPS], then copy and paste into your AI tool.

Download the free PDF

PDF, 16 pages

Written for use with

  • Claude Code: all 9 prompts are pasted into a new Claude Code session, opened in the project being checked. Prompts 1.1, 1.2, 2.1, 2.2, 3.1, 3.2 and 3.3 only read the project's saved transcripts and report, skipping the current chat's own file and never running commands they find; 4.1 writes one short, secret-free notes file and 4.2 changes cleanupPeriodDays, both shown first and only after a "go". No prompt deletes anything; clearing history is left to the reader running claude purge with --dry-run first. The core rule: read the history, don't repeat it, so secrets are reported by location and kind, never by value (3.2 uses count-only searches).
  • Session history: transcripts stored as JSONL at ~/.claude/projects/<project>/<session-id>.jsonl (folder named after the project path, non-alphanumerics turned into "-"), CLAUDE_CONFIG_DIR, an internal line format that changes between versions, subagent transcripts, plaintext and not encrypted (a .env read or printed credential lands in the transcript), cleanupPeriodDays (default 30, whole number, minimum 1, 0 rejected, silent background sweep after a session starts), file snapshots for /rewind cleaned on the same schedule, history.jsonl, /export, /rename, claude -n, the session picker (Space to preview, Ctrl+A for all projects), the Ctrl+O transcript viewer, claude purge with --dry-run (formerly claude project purge, deletes only local data) and /feedback transcripts kept 5 years were checked against Anthropic's Claude Code sessions, Claude directory, settings, settings reference, data usage, checkpointing, interactive mode, tools and permissions pages and the changelog on Nov 21, 2026.
  • Left out: JSONL field names and parsing recipes (the docs call the format internal), turning transcripts off entirely, Desktop and Cowork retention details (one "check the docs" line), and any third-party transcript scanners; readers are told never to paste transcripts into other chats or sites.
  • Not repeated here: rules before the agent acts point to Claude Code Guardrails (2.1 for blocking secret-file reads); agent-written progress reports to Leave Claude Code Running Without It Getting Stuck; git-diff review to Only Change What I Asked; live proof checks to Spec and Tests First; rotating a leaked key to Ship It Safe 8.1; vetting add-ons to Install Skills, Plugins and MCP Servers Without Getting Burned.
  • No stats or X claims: no numbers beyond Anthropic's own documented defaults, no X posts quoted, and no affiliate or sponsor copy.

Written for use with Claude Code. Not yet tested against it.

All 9 prompts

  1. 1.1 Where Is My Session History?
  2. 1.2 Turn One Session Into a Plain Timeline
  3. 2.1 Every Command It Ran, in Plain English
  4. 2.2 Did It Really Finish What It Said?
  5. 3.1 Flag the Risky Moves
  6. 3.2 Did a Key or Password End Up in My History?
  7. 3.3 What Did It Fetch, Search or Install?
  8. 4.1 Save the Sessions Worth Keeping
  9. 4.2 Choose How Long History Stays

Section 1: Find Your Session History

1.1 Where Is My Session History?

Untested: not yet run against a model.

Use this when you've never looked at Claude Code's saved sessions and want to see what's there for this project and how long it will last. It's a read-only tour, so nothing changes.

Fill in: [HOW MANY SESSIONS TO LIST] (e.g. "the last 10", or "everything from this week").

Don't change, move or delete any files. I'm a beginner, and I want to see the session history Claude Code keeps for this project.

Please:
1. Find this project's transcript folder. Claude Code's docs say it's under ~/.claude/projects/, in a folder named after this project's path with every character that isn't a letter or number turned into "-". If the CLAUDE_CONFIG_DIR environment variable is set, look under that folder instead of ~/.claude. Tell me the exact path you found.
2. List [HOW MANY SESSIONS TO LIST] in a short table: date and time last changed, file size, and a few words about what the session was about (from the first message I typed). Don't print any other content from the files.
3. Mark the newest file: that's probably this chat, so say so.
4. Check my settings files (~/.claude/settings.json, .claude/settings.json and .claude/settings.local.json) for "cleanupPeriodDays". Tell me the value and which file it's in, or say it isn't set, which means the default of 30 days.
5. Tell me, in one or two sentences, when the oldest session in the list is likely to be deleted.
Then stop.

Tips to customize: Claude Code may ask before reading files outside your project folder. That's expected; allow it for this check. To browse sessions without the agent, run claude --resume (or /resume inside a session) to open the session picker: press Space to preview a session and Ctrl+A to see sessions from every project on this computer. For the session you're in right now, Ctrl+O opens the transcript viewer with every tool call. Your typed prompts are also saved separately in ~/.claude/history.jsonl, which is what the up arrow uses.

1.2 Turn One Session Into a Plain Timeline

Untested: not yet run against a model.

Use this when a long session is over and you want to know what happened, in order, without reading the raw file. It's for a short timeline of what you asked, what the agent did and what it changed.

Fill in: [WHICH SESSION] (e.g. "the most recent one before this chat", "yesterday afternoon's session about the login page", or a file path from Prompt 1.1).

Don't change any files. Read one past session's transcript and tell me what happened, in plain English.

The session: [WHICH SESSION]

The transcript is a JSONL file in this project's folder under ~/.claude/projects/. Skip the newest file if it's this chat. The file can be big, so search it for what you need instead of printing it whole, and remember the line format is internal to Claude Code and can change, so tell me if something doesn't make sense.

Please give me:
1. One sentence: what I asked for.
2. A numbered timeline of the main steps, 15 lines or fewer, with times if the file has them.
3. Files it read, files it edited or created, and files it deleted or moved, as three short lists.
4. Any errors it hit, and what it did about each one.
5. What it said at the end, in one sentence.
If any of this includes an API key, password or token, write "(hidden)" in its place. Then stop.

Tips to customize: If the session used subagents, the docs say their transcripts sit in a subagents/ folder next to the main file, so ask the agent to include them. A file changed by a terminal command (not by Claude's edit tools) only shows up as a command, so check Prompt 2.1 too. To get a readable copy of a session yourself, resume it with claude --resume [SESSION NAME] and run /export [FILE NAME], which saves the conversation as plain text. Keep that file out of git, since it holds everything the transcript does.

Section 2: See What It Actually Did

2.1 Every Command It Ran, in Plain English

Untested: not yet run against a model.

Use this when you want to know exactly which terminal commands the agent ran during a session, and which of them changed something. It's for a full list, explained, with the risky ones on top.

Fill in: [WHICH SESSION] (as in Prompt 1.2).

Don't change any files and don't run any of the commands you find. List every terminal command the agent ran in one past session.

The session: [WHICH SESSION]

Please:
1. Find every command it ran with its Bash tool in that transcript (and in its subagents folder, if there is one).
2. Put them in a table, in order: the command, what it does in one plain sentence, and whether it only looked at things or changed something.
3. For commands that changed something, say what changed: files, packages, git history, a database, or something online.
4. Flag any command that failed, and whether the agent noticed.
5. Put a short "look at these first" list at the top for anything that deleted, overwrote, pushed, installed, or used sudo.
If a command contains a key, password or token, write "(hidden)" in its place. Then stop.

Tips to customize: A long session can run hundreds of commands. If the table gets too long, ask for "only the ones that changed something". If a command in the list confuses you, ask "what would happen if I ran this again?" before doing anything with it. Claude Code's docs say /rewind doesn't undo files that only terminal commands changed, so git is your way back for those.

2.2 Did It Really Finish What It Said?

Untested: not yet run against a model.

Use this when the agent ended with "Done!" or "All tests pass" and you want to check that against what really happened in the session. It's for comparing what it claimed with what the record shows.

Fill in: [WHICH SESSION] (as in Prompt 1.2), [WHAT I ASKED FOR] (one line, e.g. "add a password reset page and make the tests pass").

Don't change any files and don't run anything. Compare what the agent said at the end of a past session with what the transcript shows it actually did.

The session: [WHICH SESSION]
What I asked for: [WHAT I ASKED FOR]

Please:
1. Quote the agent's final summary (shortened if it's long).
2. Make a list of every claim in it, like "tests pass", "added X", "fixed Y".
3. For each claim, find the evidence in the transcript: the command it ran and what the output said, or the file it edited. Mark each claim "shown", "partly shown" or "no evidence".
4. List anything I asked for that it never did, and any step it skipped, worked around or turned off (for example a skipped test or a disabled check).
5. List errors or warnings in the output that the summary didn't mention.
Then stop. Don't fix anything yet.

Tips to customize: "No evidence" doesn't always mean "not done". It means the record doesn't prove it, so run the check yourself. If something was skipped, start a fresh session for the fix and paste the list in. To make the agent show proof as it works next time, see our Spec and Tests First pack.

Section 3: Check for Risky Moves and Leaked Secrets

3.1 Flag the Risky Moves

Untested: not yet run against a model.

Use this when you want to scan recent sessions for the actions that can really hurt: deletes, force pushes, hard resets, database changes and reading secret files. It's for a short list with dates, not a full review.

Fill in: [HOW FAR BACK] (e.g. "the last 7 days" or "all sessions in this project").

Don't change any files and don't run any of the commands you find. Check this project's past Claude Code sessions for risky actions.

How far back: [HOW FAR BACK]

The transcripts are the JSONL files in this project's folder under ~/.claude/projects/ (skip this chat's own file). Search them; don't print them whole.

Look for:
- Deleting: rm -rf, or deleting folders or many files at once
- Git: push --force or -f, reset --hard, clean -f, deleting branches, rewriting history
- Databases: DROP, TRUNCATE, DELETE without a WHERE, migrations or resets run against a real database
- Secret files: reading .env files, key files, credential files or anything in ~/.ssh
- Other: sudo, chmod 777, piping a script from the internet straight into a shell, changing files outside this project

For each hit, give me: the session date, the action in plain words, the file or command involved, and whether it looks like it actually ran or was blocked or denied.
If anything you show contains a key, password or token, write "(hidden)" in its place.
End with the 3 hits I should look at first, and why. Then stop.

Tips to customize: A hit isn't automatically bad. Deleting a build folder is normal; deleting your migrations folder isn't. Ask "was this part of what I asked for?" about each one. If the agent reads secret files more often than you'd like, our Claude Code Guardrails pack (Prompt 2.1, Lock Away My Secret Files) shows how to block those reads with permission rules.

3.2 Did a Key or Password End Up in My History?

Untested: not yet run against a model.

Use this when you've pasted a key into the chat, or the agent read your .env file, and you want to know which transcripts now hold secrets. It's for finding them without printing them.

Fill in: [MY SECRET NAMES] (the names of your keys, not the values, e.g. "STRIPE_SECRET_KEY, SUPABASE_SERVICE_ROLE_KEY, OPENAI_API_KEY", or "check my .env.example for the names").

Don't change any files. Check whether API keys, passwords or tokens appear in this project's Claude Code transcripts. This is important: never print a secret value, not even part of one. Anything you print gets saved into this chat's transcript too.

My secret names: [MY SECRET NAMES]

Please:
1. Search the JSONL files in this project's folder under ~/.claude/projects/ (skip this chat's own file). Only use commands that print file names and counts, like grep -l or grep -c, never the matching lines.
2. Look for: the secret names above followed by a value, common key formats (keys that start with sk-, sk_live_, pk_live_, ghp_, xox, AKIA or eyJ), "BEGIN PRIVATE KEY", and passwords inside database URLs.
3. Give me a table: which file (session date), what kind of secret it seems to be, and how many times it shows up. No values.
4. For each kind of secret you found, tell me which service it belongs to and that I should rotate it there.
5. Tell me which sessions I might want to keep anyway, and which I could clear once the keys are rotated.
Then stop. Don't delete anything.

Tips to customize: Rotate first, clean up second. A rotated key is useless even if an old copy stays on disk. Our Ship It Safe pack (Prompt 8.1, I Leaked an API Key: What Do I Do Right Now?) walks through rotating. To clear a project's history after that, see Prompt 4.2. Before you send a session to Anthropic with /feedback, keep in mind their docs say transcripts shared that way are kept for 5 years. Never paste transcripts into other chats or websites to "check" them.

3.3 What Did It Fetch, Search or Install?

Untested: not yet run against a model.

Use this when you want to know what the agent reached outside your computer during a session: web pages it opened, searches it ran, outside tools it called and packages it installed. It's for a list of everything that came in from the internet.

Fill in: [WHICH SESSION] (as in Prompt 1.2, or "all sessions from the last 7 days").

Don't change any files and don't open any of the links you find. List everything the agent reached outside this computer in a past session.

The session: [WHICH SESSION]

Please list, from the transcript:
1. Web pages it fetched (the WebFetch tool) and searches it ran (the WebSearch tool): the address or search, and why it seemed to need it.
2. Calls to MCP servers or other connected tools: which server, and what it asked for.
3. Packages it installed or added (npm, pnpm, yarn, pip and so on): the package name, and whether it was already in my project.
4. Commands that sent data out, like curl or wget with data, git push, or deploy commands.
5. Anything it pulled from the internet and then ran.
For each one, mark it "expected" (clearly part of my task) or "check this". If a URL or command contains a key, token or password, write "(hidden)" in its place. Then stop.

Tips to customize: Pay most attention to packages you didn't ask for. A misspelled package name is a classic trick, so check that each new one is the real, popular package with that name. For checking skills, plugins and MCP servers before you add them, see our Install Skills, Plugins and MCP Servers Without Getting Burned pack.

Section 4: Keep the Right Amount of History

4.1 Save the Sessions Worth Keeping

Untested: not yet run against a model.

Use this when a session holds decisions or fixes you'll want months from now, and you don't want it to disappear when old transcripts are deleted. It's for a short, secret-free notes file in your project.

Fill in: [WHICH SESSION] (as in Prompt 1.2), [NOTES FILE] (e.g. "docs/session-notes/2026-11-21-login-fix.md").

Create one new file, [NOTES FILE], with a short record of one past session. Show me the text before you save it, and don't change any other files.

The session: [WHICH SESSION]

Write it in 30 lines or fewer:
1. The date and one sentence on what I asked for.
2. What was done: files changed, with one line each.
3. Decisions we made, and why.
4. Problems we hit and how they were solved.
5. Anything left unfinished.
Never copy keys, passwords, tokens or personal data into this file. Write "(hidden)" instead. Don't copy the transcript itself.

Tips to customize: This file lives in your project, so it stays as long as you want and can go in git, unlike the transcript. Give important sessions a name so you can find them later: /rename [NAME] inside a session, or start one with claude -n [NAME]. Then claude --resume [NAME] takes you back, as long as the transcript hasn't been deleted yet. Claude Code's docs say rewinding also needs saved file snapshots, which are cleaned up on the same schedule, so an old session may not rewind.

4.2 Choose How Long History Stays

Untested: not yet run against a model.

Use this when you want to keep transcripts for a shorter or longer time than the 30-day default, or clear out a project's history. It's for picking a number that fits you, and making the change only after you agree.

Fill in: [HOW I USE CLAUDE CODE] (e.g. "I resume old sessions a lot", "I often paste keys and want less lying around", or "I don't know yet").

Help me choose how long Claude Code should keep my session history. Don't change any files until I say "go", and don't delete anything.

How I use Claude Code: [HOW I USE CLAUDE CODE]

Please:
1. Tell me my current cleanupPeriodDays value and which settings file it's in, or that it's the default of 30 days.
2. Explain the trade-off in plain words: a shorter period means fewer old secrets on my disk, but I lose the ability to resume or rewind sessions older than that. A longer period keeps more of both.
3. Recommend a number of days for me, and say which file it should go in (~/.claude/settings.json for all my projects).
4. Warn me that when a shorter period takes effect, older transcripts are deleted without a message, so I should save anything I want first (with a notes file or /export).
5. Show me the exact change to the settings file and wait for my "go".
6. If I also want to clear this project's history now, don't do it yourself. Give me the command to run in my own terminal, starting with the --dry-run preview.

Tips to customize: Claude Code's docs say cleanupPeriodDays must be a whole number of at least 1, and 0 is rejected. The cleanup runs in the background after a session starts. To clear one project's history, run claude purge [PROJECT PATH] --dry-run in your terminal to see what it would delete, then the same command without --dry-run; it lists everything and asks before deleting. The docs say it deletes data only on your computer, and older versions called it claude project purge. Sessions started in the Claude desktop app follow their own rules, so check the docs if you use it.

Get new free packs in your inbox

Optional. Every prompt here is free, and you don't need to sign up to use any of them. We email when we add new free packs. Unsubscribe anytime.

More free packs: Vibe Code Starter Pack Ship It Safe Fix My Bugs Ship It Live Make It Pretty Get Paid Signup Emails That Actually Arrive Lovable Credit Saver One Rules File for Every AI Tool Make Your Claude Code Limit Last Graduate From Lovable First App Store Submission Survive Your First Traffic Spike Get Found on Google First 100 Users Two AIs, One Project It Broke in Production Hit the Slop Wall? Refactor Without Breaking Everything Vibe Code From Your Phone AI Reverse Engineering Run Several AI Agents at Once Claude Code Guardrails Let AI Review Your AI's Code Make Your Cursor Usage Last Privacy Policy and Terms That Match Your App Install Skills, Plugins and MCP Servers Without Getting Burned Say What You Mean Prompt Injection: Don't Let a Web Page or a Strange File Hijack Your Agent Hit Your Limit Mid-Task? Switch AI Tools Without Losing Your Place Don't Let the AI Delete Your Data: Safe Database Changes Make the AI Teach You While It Builds Bolt Token Saver v0 to Production Claude Code Subagents and Skills for Beginners Logins, Tokens and JWTs in Plain English Put Your Web App on Their Phone Add AI Features in Lovable Is Anyone Using It? Simple Analytics for Vibe Coders Use the Cheap Model for the Easy Stuff: Claude Code Model Mixing Ship Updates Without Breaking the Live App: Preview Links, Checks and One-Click Rollback Try to Break It: Stress-Test Your App Before Strangers Do Claude Code Memory: Stop It Forgetting Your Decisions Fix Your Lovable Security Warnings Without Breaking the Live App What Will My App Cost to Run? A Monthly Bill You Can Predict Leave Claude Code Running Without It Getting Stuck Put Your Lovable App on Autopilot: Automations That Check and Report for You Spec and Tests First: Tell the Agent When It's Done Only Change What I Asked: Stop the AI Rewriting Code You Didn't Mention Stop Getting 429'd: Call Other People's APIs Without Hitting Limits Use the Current Version: Stop the AI Writing Outdated Library Code Your First Google Play Launch: Get Through the 12-Tester, 14-Day Closed Test Will Anyone Want It? Check Your App Idea Before You Build Claude Code Code Mode: Try It Without Breaking Your Safety Checks Coding With Gemini 4 Neon: Make It Double-Check Its Own Work Understand the App You Already Built: A Guided Tour of Your Own Code Your Guess Might Be Wrong: Make the AI Find the Real Cause Before It Fixes Replit Missions: Give Agents a Goal, a Budget and Approval Rules Make Your Antigravity Quota Last: Pick the Right Gemini Model and Check /usage Turn a Claude Artifact Into a Desktop App, Without Giving It Too Much Access Built It for Work? Make Sure Only Your Team Can Open It Plan Before It Builds: Use GitHub Spec Kit So the Agent Builds the Right Thing Saves That Stick: Fix Data That Disappears Rebuilt Your Site With AI? Make Sure Google Can Still See Every Page Subscriptions and Paywalls: Gate Features by Plan Your AI App Builder Is Shutting Down: Get Your Code, Data and Domain Out Your Own Android App From a Prompt: Build It in Google AI Studio and Put It on Your Phone Backups You Can Actually Restore: Check, Copy and Test Your Supabase Data Accessibility Pass Before You Ship: Make Your App Work With a Keyboard, a Screen Reader and Zoom Update Your Dependencies Without Breaking the App: npm Updates, Audits, Major Upgrades and Dependabot