Your shell history remembers every secret.
Exported API keys, curl tokens, database passwords and keys pasted into Claude Code or Codex all sit in plain text under your home folder. smash scrubs them out once a day, in place, and leaves the rest of your history alone.
curl -fsSL https://keysmash.website/install.sh | sh
then smash to set up and previewsmash run to scrub nowsmash log to see what changed
⚠ Rewrites your history and agent logs in place, with no backups. Read the risks before you run it ↓
: 1729500010:0;export OPENAI_API_KEY=sk-proj-9fK2mQx7Lp4V : 1729500020:0;curl -H "Authorization: Bearer ghp_7Qm2Lx9Vt4Rz" api.github.com : 1729500030:0;mysql -u root -pS3cr3tPass! app : 1729500040:0;git push origin main : 1729500050:0;aws configure set aws_secret_access_key wJalrXUtnFEMI/K7 ✓ 4 secrets redacted · 0 rejected · today's lines untouched
Four steps, once a day.
A background job (launchd on macOS, a systemd timer on Linux) checks only what's new since the last run. Only suspicious lines ever leave your machine, and every answer is checked before a byte changes.
Filter locally
Key formats,
KEY=value, bearer tokens, URL credentials and random-looking strings are spotted on your machine.Model confirms
Suspicious lines go to OpenAI or Anthropic in batches; only lines with a real secret come back, masked.
Verify
An answer is used only if it's your original line with spans replaced by
[REDACTED].Rewrite in place
Atomic rewrite, byte-for-byte except the redactions. Lines added meanwhile are kept.
What ships
- Preview first. Counts per source, and nothing is sent until you confirm.
- Cleans four sources. zsh and bash history, Claude Code and Codex sessions, and both prompt histories.
- Incremental. Only new lines are checked, and clean ones are never re-sent.
- Today stays. Lines dated today wait for tomorrow, and live agent sessions are skipped.
- Catches up. A run missed during sleep or downtime happens afterwards.
- Audit log.
smash logshows files and counts, never the text.
Stay in control
# stop the daily job, keep smash for manual runs launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.smash.daily.plist rm ~/Library/LaunchAgents/com.smash.daily.plist smash run # whenever you like
# stop the daily timer, keep smash for manual runs systemctl --user disable --now smash.timer rm ~/.config/systemd/user/smash.{service,timer} systemctl --user daemon-reload smash run # whenever you like
smash update # install the latest release, checksum verified smash uninstall # removes the job, ~/.smash and the binary; asks first
Redaction is permanent, and smash keeps no backups. Rotate any key it finds: if it was on disk, assume it was read.
Know the risks
smash changes files you may care about. Read this before your first run.
- Redaction is permanent.No backups, on purpose: a backup would be another copy of the secret. Anything wrongly masked is gone too.
- Old agent sessions may not resume.Claude Code and Codex replay their logs on resume; an older session smash edited may fail or lose earlier reasoning. Today's and active sessions are never touched.
- Suspicious lines go to a provider.Flagged lines, which can include real secrets, are sent to OpenAI or Anthropic to be confirmed.
- It can miss secrets.Both the filter and the model are heuristics. Rotate any key you find: if it was on disk, assume it was read.
- Not protection against malware.Anything running as you can read your history before it's cleaned, and smash's config with its key.
- Open shells can write old lines back.A running shell keeps history in memory. Restart open terminals after a run.