Mac YOLO Safeguards

Redact API keys from Claude Code and Codex logs

Coding agents keep a full transcript of every session on your Mac. When an agent reads a .env file, runs curl with a bearer token, or prints a config, that key is now saved in plain text in the transcript too.

On my own Mac I counted 1,428 API keys, tokens and passwords in 316 transcripts from the last 30 days.

Where the transcripts are

AgentFolder
Claude Code~/.claude/projects/ (one .jsonl file per session)
Codex~/.codex/sessions/ (one rollout-*.jsonl file per session, by date)
oh-my-pi~/.omp/agent/sessions/
Grok CLI~/.grok/

Check by hand

This lists transcripts that contain something shaped like an Anthropic, OpenAI, GitHub, AWS or Stripe key. It prints file names only, never the keys:

grep -rlE 'sk-ant-[A-Za-z0-9_-]{20,}|sk-proj-[A-Za-z0-9_-]{20,}|ghp_[A-Za-z0-9]{36}|AKIA[0-9A-Z]{16}|sk_live_[A-Za-z0-9]{20,}' \
  ~/.claude/projects ~/.codex/sessions 2>/dev/null | wc -l

Deleting those files loses your session history, and editing them by hand is risky while an agent is still writing to one.

Fix it in two clicks

The free Mac YOLO Safeguards menu bar app scans the Claude Code, oh-my-pi and Grok folders and shows how many secrets it found. Codex sessions are added in the next release. Click the button and it replaces each one with [REDACTED]. Everything else in the transcript stays byte for byte the same, so you keep your history, and sessions changed in the last 2 minutes are left alone. It runs on your Mac and sends nothing anywhere.

A key that has already sat in a log should still be treated as exposed. Redaction stops the file from leaking it again, for example in a backup, a shared bug report or a synced folder.

Download for Mac (free)

The scan needs Node.js (brew install node). Cursor keeps its chat history in a database rather than text files, so the scan does not cover Cursor yet.