Claude Code history: finding what your team's agents did last week

Where Claude Code and Codex keep session history, how to resume it, and how a team finds what everyone's agents did last week and why, tested on our own repo.

By Scott Strang

Last updated

The short answer. Claude Code saves each session as a transcript on your own machine, under ~/.claude/projects/; in the terminal it deletes them after 30 days by default, and claude --resume opens a picker. Codex saves its sessions under ~/.codex/sessions/ and reopens them with codex resume. Neither tool shows you a teammate's local sessions. To know what your team's agents did last week and why, have every session leave a short "what changed and why" where the team already looks (the pull request, or a weekly log in the repo), and read that instead of transcripts.

Claude Code and Codex store your session history on your laptop

Both tools write every session, your full conversation history, to local files as you work, which is enough to get your own session back. The files aren't shared, aren't meant to be read by hand, and Claude Code in the terminal deletes them after 30 days by default.

Claude CodeCodex CLI

Tested on Claude Code 2.1.283 and Codex CLI 0.146.0, Nov 20, 2026. Claude Code's docs say its transcript format "is internal" and can change on any release, so don't build on parsing the files.

Resuming a Claude Code or Codex session takes one command

Reopen the session you just left. In the same folder:

claude --continue
codex resume --last

Find an older one. Run claude --resume and start typing to filter. Press Ctrl+W to include your other worktrees, or Ctrl+A for every project on the machine. You can paste a pull request URL into the search to find the session that created that PR, or run claude --from-pr <number> to open the picker filtered to that PR's sessions. In Codex, codex resume --all lists sessions from every folder.

Resume by ID from anywhere. claude --resume <session-id> works from any directory; Claude Code looks in the current project and its worktrees first, then the others.

Ask an old session a question without opening it:

claude -p --resume <session-id> --output-format json "In 3 lines: what changed and why" | jq -r '.result'

Search or browse with another tool. Open-source viewers such as claude-history (a terminal search for Claude Code and Codex) read the same local files. They're fine for one person; they still see only your machine.

Keep history longer than 30 days. Add this to ~/.claude/settings.json (0 is rejected; pick a large number):

{ "cleanupPeriodDays": 365 }

We asked "what did our agents do last week?" three ways

We took our go-to-market repo, where our GTM and content work runs through Claude Code and Codex, and one week (Mon Nov 9 to Sun Nov 15, 2026), and answered the question a lead asks on Monday: what did the team's agents do, and why? Most of that week's work was one person's. So we added a harder question about a teammate's work from a month earlier (Oct 19): why does /save-draft, the skill our writers use to save blog drafts, merge its own pull request, and is that safe?

Where we lookedWhat it held for Nov 9–15The teammate's "why" (Oct 19)Time

What this showed:

  1. Local history is one person deep. 329 files on one laptop for one week, and none of anyone else's work.
  2. The pull request is the free record that already works, because the agent already writes what changed and why in it. It misses everything that didn't become a merged PR.
  3. A short summary per session beats a transcript. The teammate's two-sentence summary answered the question; the full session (494 lines) was there if we needed it.
  4. A shared record holds only what gets recorded. The 36 Ledger sessions and the 329 local transcripts were counted separately, and we didn't trace which records overlap, so don't read one as a share of the other. Past sessions can be imported later.

History stops at one person, one laptop, one tool and 30 days

For one person, local history works: you lost a session, you find it. For a team, every limit multiplies: you pick up a teammate's half-finished branch, or review a change their agent made on Tuesday, and the session that explains it is on their laptop.

Monday's questionYour own historyA teammate's history

Five people using two tools is ten separate histories on five laptops, and none of them answers "why" without someone reading a transcript.

The team-sized fix: every session leaves a "what and why" where the team looks

You don't need everyone's transcripts. You need a few lines per session, in a place the whole team already reads, kept longer than 30 days. Three steps, each catching what the one before misses. The test: a teammate's session on Tuesday shows up in Monday's log or PR list without you asking them.

1. Make the pull request say why

Your agents already write PR descriptions. Ask for the same three things every time. Add .github/pull_request_template.md:

## What changed
 
## Why
 
## What's left or was tried and dropped

And one line in your AGENTS.md or CLAUDE.md, so every agent fills it in:

- Every PR description fills in What changed, Why, and What's left from the template. "Why" names the problem, not the diff.

This covers everything that merges. Look back over a week with:

gh pr list --state merged --limit 1000 --search "merged:2026-11-09..2026-11-15" --json number,title,author

2. Log every session to a weekly file in the repo

For work that never becomes a PR, add a SessionEnd hook. When a Claude Code session ends, it asks that session for three lines and appends them, with the date, git user and branch, to .agent-log/<year>-W<week>.md. Commit the folder like any other file.

Save as .claude/hooks/log-session.sh and make it executable (chmod +x):

#!/usr/bin/env bash
# SessionEnd hook: append a 3-line summary of the ending session to a weekly log.
set -euo pipefail
[ -n "${AGENT_LOG_RUNNING:-}" ] && exit 0   # don't log the summary run itself
input=$(cat)
sid=$(printf '%s' "$input" | jq -r '.session_id')
cwd=$(printf '%s' "$input" | jq -r '.cwd')
cd "$cwd"   # resume looks sessions up by working directory
# Always write to the repo root, even if the session started in a subdirectory.
root=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
summary=$(AGENT_LOG_RUNNING=1 claude -p --resume "$sid" --no-session-persistence \
  --output-format json \
  "In at most 3 lines: what changed, why, and what is left. No secrets, no file contents." \
  | jq -r '.result')
log="$root/.agent-log/$(date +%G-W%V).md"
mkdir -p "$root/.agent-log"
{
  printf '## %s · %s · %s\n' "$(date +%Y-%m-%d)" "$(git config user.name || whoami)" \
    "$(git branch --show-current 2>/dev/null || echo '-')"
  printf '%s\n' "$summary"
  printf 'Session: %s\n\n' "$sid"
} >> "$log"

Then register it in .claude/settings.json:

{
  "hooks": {
    "SessionEnd": [
      { "hooks": [ { "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/log-session.sh", "timeout": 60 } ] }
    ]
  }
}

The timeout matters: SessionEnd hooks get 1.5 seconds by default, and a per-hook timeout raises that to at most 60. In our test the summary took 14 seconds. Each summary resumes the whole session to ask one question, so the cost grows with the session's length. The log is written after the session ends, so commit .agent-log/ with your next change or once a week. The hook needs jq. It covers Claude Code only; for Codex, ask the agent to append its three lines before it finishes (the setup prompt below adds that rule).

3. Read it on Monday

Once a week, by whoever leads:

cat .agent-log/$(date -v-7d +%G-W%V).md        # macOS
cat .agent-log/$(date -d '7 days ago' +%G-W%V).md   # Linux

Read last week's log and merged PRs side by side. Look for work that was started and dropped, changes nobody planned, and anything you'd want an agent to know next time. That last one goes into AGENTS.md or your decision log.

We use the PR habit, and SageOx instead of the hook

Step 1 is our habit: 105 of the 115 pull requests our go-to-market repo merged in the week of Nov 9, 2026 link to the session that produced them. For step 2 we use SageOx (below) instead of the hook; we built and ran the hook on Nov 20 to check that it works without us. Checked Nov 20, 2026.

Where SageOx helps

The fix above works without us. SageOx is a context layer for teams of people and agents; it isn't an agent, and it works alongside Claude Code and Codex. With SageOx, each session is recorded and summarized without a hook you maintain, and sessions that never became a pull request are kept too.

  • Recorded coding sessions are summarized into the repo's Ledger (a shared history of the team's sessions) through the agent's own hooks, once ox is set up in the repo. Claude Code and Codex sessions you ran before installing can be imported.
  • Anyone on the team can list and read them. Each teammate who records adds to the same list: ox session list --all shows every recorded session with its title and summary; ox session download <name> and ox session view <name> --text open the full session.
  • Pull requests can link back to the session: your agent adds a credit line (ox pr header) when it opens the PR, so "why did this change?" is one click from the PR.
  • Search across sessions, recorded meetings (Discussions) and docs with ox query. In our test it found the meeting where we discussed the feature, but not the session itself; for "which session did X", list first.
  • You choose what's shared. Sessions can stay on your machine until you upload them, recording can be turned off per user, repo or team, and built-in secret redaction runs on recorded sessions (security).

See how a team finds what it already knows →

Have your agent do it

Paste this into Claude Code or Codex at the root of a repo. It commits nothing until you approve the diff.

Set up a weekly record of what this team's coding agents did, and why.
1. If .github/pull_request_template.md doesn't exist, create it with three sections:
   What changed, Why, What's left or was tried and dropped. If it exists, add any
   missing section. Don't remove anything.
2. Add one line to AGENTS.md (or CLAUDE.md if that's the only file): every PR
   description fills in What changed, Why, and What's left; "Why" names the problem.
3. Add a Claude Code SessionEnd hook at .claude/hooks/log-session.sh that resumes the
   ending session with `claude -p --resume`, asks for at most 3 lines (what changed,
   why, what's left; no secrets, no file contents), and appends them with the date,
   git user and branch to .agent-log/<ISO year>-W<ISO week>.md under the Git root
   (git rev-parse --show-toplevel), not the session's directory. Guard it with an env
   variable so the summary run doesn't log itself. Register it in .claude/settings.json
   with "timeout": 60. Tell me if jq is missing.
4. Add a rule to AGENTS.md for agents without that hook (such as Codex): before
   finishing a task, append the same 3 lines to this week's .agent-log file.
5. Make sure .agent-log/ is not in .gitignore.
6. Then show me last week's merged PRs (gh pr list --state merged with last week's
   dates) and list any whose description has no "Why".
Show me the diff before committing anything.

Questions

Does Claude Code keep a history of my sessions? Yes. Every session is saved as you work to ~/.claude/projects/<project>/<session-id>.jsonl on your machine. Terminal sessions are deleted after 30 days unless you raise cleanupPeriodDays; sessions from the Claude desktop app are kept longer.

How do I see my full Claude Code history? Run claude --resume and press Ctrl+A in the picker to list sessions from every project on your machine. To read one as text, resume it and run /export.

Where are the Claude Code logs? Session transcripts are in ~/.claude/projects/, one folder per working directory. For Codex, look in ~/.codex/sessions/, sorted by date.

Can I see my teammates' Claude Code sessions? Not local ones: each lives on the laptop that ran it. Cloud and Remote Control sessions can be shared one link at a time (Team and Enterprise share within your organization). For a whole week, share a summary instead, in the pull request or a weekly log file in the repo, or use a shared session record.

Is "Claude Code agent teams" the same thing? No. Agent teams is an experimental Claude Code feature, off by default, that coordinates several Claude Code sessions on one person's task. This guide is about people on a team seeing each other's agents' work.

Sources

Read Nov 20, 2026: Claude Code: manage sessions · Claude Code settings: cleanupPeriodDays · Claude Code hooks: SessionEnd · Claude Code: share a cloud or Remote Control session · Codex CLI reference: codex resume · codex resume --help on Codex CLI 0.146.0. Tests: Claude Code 2.1.283, Codex CLI 0.146.0 and ox 0.23.0 on one of our repos, Nov 20, 2026.

More on why it was built this way