Check what you leaked

Weavekeep removes secrets before it stores anything. Your agents do not: they keep their own transcripts on your machine, as plain text. weavekeep scan finds the secrets in those transcripts and tells you where they are.

Why transcripts hold secrets

Claude Code and Codex write every session to a file: your prompts, the agent's replies, every command it ran and what the command printed. If you pasted an API key into a prompt, or a tool printed a .env file or a URL with a password in it, that text is in the transcript. It stays there until you delete the file.

AgentTranscripts
Claude Code~/.claude/projects/, one folder per project. With CLAUDE_CONFIG_DIR set, projects/ in that folder
Codex~/.codex/sessions/, one folder per day. With CODEX_HOME set, sessions/ in that folder

Run a scan

Terminal
weavekeep scan

The scan reads every .jsonl file in those folders, and then checks the Weavekeep store. On a terminal it shows a progress line while it reads. Large transcript folders can take a while.

The scan only reads. It never changes, moves or deletes a transcript, and it never creates a Weavekeep database.

Read the result

! Found 3 likely secrets in 2 projects (Claude Code 1, Codex 2). Rotate them, then delete or redact the transcripts.
12 more matches look like placeholders or test values. Show them with --all.

  1. Anthropic API key  sk-ant-…a1F9  1a34ecfaa68c
     3 times in Claude Code, first 2026-10-13, last 2h ago
     Project ~/projects/shop
     ~/.claude/projects/-home-you-projects-shop/6c1f2a9e-0b7d-4e55-9a1c-2f3e4d5c6b7a.jsonl
     ~/.claude/projects/-home-you-projects-shop/0d4b8e21-77aa-4c3e-8f10-9e8d7c6b5a49.jsonl
  2. Secret in DB_PASSWORD  …aple  8a4c666f0e1d
     1 time in Codex, seen yesterday 09:27
     Project ~/projects/api
     ~/.codex/sessions/2026/10/21/rollout-2026-10-21T09-14-02-0199f3a1.jsonl
  3. Password in a URL  …x7Q2  473b6398a021
     1 time in Codex, seen yesterday 09:21
     Project ~/projects/api
     ~/.codex/sessions/2026/10/21/rollout-2026-10-21T09-14-02-0199f3a1.jsonl

Scanned 3 transcripts (1.9 KB).
✓ The Weavekeep store is clean (3 rows, 1 file).

The values above are made up. The first line counts the secrets that look real; the second counts the matches Weavekeep did not list, see Placeholders and test values. Each secret is listed once, however many times and in however many files it appears. Most recently seen comes first. For each one you get:

  • The kind: the rule that matched, such as Anthropic API key, GitHub token or Password in a URL. A KEY=value secret shows its name, as in Secret in DB_PASSWORD. The same rules as the secret filter are used.
  • The masked value and a fingerprint. See Masking and fingerprints.
  • How often and when: the number of times it appears, which agents, and when it was first and last seen. The time comes from the transcript line, or from the file when the line has none.
  • The project: the folder the session ran in.
  • The files: up to three, most recent first, then and N more files.

When nothing is found:

✓ No secrets found in 412 transcripts (812.4 MB).

✓ The Weavekeep store is clean (8,214 rows, 37 files).

When every match looks like a placeholder or a test value:

✓ No likely secrets in 92 transcripts (390.9 MB). 158 matches look like placeholders or test values (--all to list).

A line like Codex: nothing in ~/.codex/sessions means that agent has no transcripts on this machine. Files or folders that could not be read are skipped and listed in a Skipped … warning. Symbolic links are not followed; a line like Claude Code: skipped 2 symlinks (not followed). counts the ones that point to a folder or a transcript.

Placeholders and test values

Transcripts are full of text that looks like a secret and is not: API_KEY=your-api-key, access_token: missing, a link to a provider's key settings page, code such as password = ${DB_PASSWORD}, or the made-up keys in documentation and tests, like an AWS key ending in EXAMPLE or a token ending in abcd. Weavekeep hides matches that look like placeholders or test values, and counts them on the first lines instead.

To see them too:

Terminal
weavekeep scan --all

They come after the likely secrets, each marked [unlikely]:

  4. Secret in ACCESS_TOKEN  … (7 chars)  b6f47d947a91  [unlikely]
     1 time in Claude Code, seen 2026-10-02

A real key is very rarely hidden. If you know a key was pasted somewhere and the scan does not list it, run it again with --all.

The Weavekeep store check

The scan also reads everything Weavekeep has stored: the database, including forgotten and replaced items, the files that hold large items, and your memory files. It opens the database read-only.

If an agent keeps writing to Weavekeep while the scan reads it, the scan says The Weavekeep store changed during the scan. Run it again. instead of calling it clean, and exits 1.

The store should hold no secrets, because the filter removes them first. If the scan finds some, it says so, even when they look like placeholders or test values, with one of three causes: text was stored while WEAVEKEEP_NO_SCRUB=1 was set, it was stored by an older version, or it was typed into a memory file. To remove a secret from a memory file, edit the line. To remove it from the database, see Forget and export: forgetting hides it, and only weavekeep uninstall --purge removes it from disk.

What to do next

  1. Rotate the secret first. Revoke the key or change the password with whoever issued it, and put the new one where it belongs. The old value was on disk in plain text, and possibly sent to the agent's model provider as part of the session. Deleting the file does not undo that.
  2. Then clean up the transcripts, if you want to. The scan lists the files. You can delete them, or open them and remove the value. Weavekeep never does this for you. Your agent resumes sessions from these files, so a deleted session can no longer be resumed.
  3. Run weavekeep scan again to check nothing is left.

Options

OptionWhat it doesDefault
--agent <name>Only claude, codex or weavekeep (the store). Repeat it, or separate names with commasAll three
--project <path>Only secrets seen in this project or in a folder below itEvery project
--allAlso list matches that look like placeholders or test valuesOff
--limit <n>How many secrets to list, 1 to 10,00020. With --json, all
--jsonPrint JSON instead of textOff
Terminal
weavekeep scan --agent claude --project ~/code/shop
weavekeep scan --agent weavekeep
weavekeep scan --json > leaks.json

Unlike search, scan looks at every project unless you pass --project. With --project, a secret whose project is unknown is left out.

When there are more secrets than --limit, the list ends with Showing 20 of 57. and tells you how to see all of them.

--json prints the same report with full paths and ISO times, and always includes every match, as if --all were given. Each secret has kind, confidence (likely, or unlikely for a placeholder or test value), key, masked, fingerprint, length, agents, projects, occurrences, first_seen, last_seen, files (up to three) and file_count. total is the number found before --limit, and likely and unlikely split it. scanned and store say what was read: scanned has a symlinks count per source, and store has findings (secrets in the store, after --project), likely_findings (how many of those look real), error (why it could not be read) and changed (during_scan if it kept changing while it was read, wal_without_shm if an unfinished write was left behind; null otherwise). The JSON never holds a secret either.

Exit codes

CodeMeaning
0The scan ran, whether it found secrets or not
1Nothing could be read (there was something to scan, and none of it could be opened), or the Weavekeep store check could not run: the database could not be read, or it changed during both reads
2Usage error, such as an unknown --agent or a --limit out of range

A scan that finds secrets still exits 0. To act on findings in a script, read likely from --json.

Masking and fingerprints

No secret is ever printed, in the terminal or in --json.

  • The masked value keeps a known prefix that says what the secret is (sk-ant-, ghp_, AKIA, xoxb- and so on), then …, then at most the last 4 characters. Only a key of that kind keeps its prefix: a password that happens to start with sk- shows none. The last characters are shown only when the secret is long enough that they give nothing away.
  • Short secrets show nothing of themselves: just …, with the length, as in … (8 chars).
  • A private key shows only its -----BEGIN … PRIVATE KEY----- line.
  • The fingerprint is 12 hex characters that stand for the secret within one report. The same secret has the same fingerprint, so you can see that two masked values are one secret. Fingerprints change on every run, so someone who sees a shared report cannot use them to test guesses. To check that a rotated secret is gone, look for its kind, masked value and files in a new scan.

What the scan does not cover

  • Cursor. Its chats live in a SQLite database, not in transcript files. --agent cursor is a usage error.
  • Other agent files. Only Claude Code's projects/ folder and Codex's sessions/ folder are read, and only .jsonl files in them. Other files, such as history.jsonl in ~/.claude or ~/.codex, are not scanned. Symbolic links are not followed.
  • Anything outside your agents and Weavekeep: shell history, .env files, your code.
  • Secrets in formats the filter does not know, such as a password typed in plain prose. Detection is pattern based. See Known limits.

See CLI commands for the short reference.

On this page