whereismyai
Claude Scrub
Claude Scrub is a command-line tool that redacts secrets from Claude Code history files on disk.
Claude Scrub finds and redacts sensitive data stored in local Claude Code directories. It scans session transcripts, prompt history, paste caches, file history, and shell snapshots, replacing discovered secrets with labels. The tool uses custom secret lists, pattern matching for secret-looking variable names, URL passwords, and gitleaks rules to detect sensitive information. It rewrites JSON lines safely without breaking escape sequences and preserves file permissions and modification times. Designed for developers using Claude Code, it supports automated cleanup via hooks and helps prevent accidental credential leaks.
Claude Scrub at a glance
- Best for: Software engineer
- Runs on: macOS, Windows, Linux, CLI, open source
- Pricing: Free
- Released: October 2026
- Category: AI coding tool
- Website: github.com/overflowy/claude-scrub
Key features
- Redacts secrets in session transcripts and history
- Supports custom secret definitions and allowlists
- Detects passwords in URLs and authorization headers
- Integrates gitleaks rules for token detection
- Runs dry runs with detailed reporting
- Automates cleanup with session end hooks
Use it for
- Removing accidental API keys from prompt history
- Scrubbing database passwords from session transcripts
- Automating history cleanup after Claude Code sessions
Companions
Tools that articles about Claude Scrub recommend using with it, each with its job.
- Claude Code — Built to work with Claude Code.
- Context7 — Provides up-to-date documentation for AI agents and code editors.
- Playwright MCP — Enables LLMs to interact with web pages using structured accessibility snapshots.
- GitHub MCP Server — Reads pull requests, issues and code search on GitHub.
- Superpowers — Brainstorm, plan and execute skills for bigger tasks.
- gstack — Skill bundle for planning, review and shipping.
Alternatives to Claude Scrub
- Claude DevTools — Restores visibility into Claude Code session logs and tool calls.
- Claude Tap — Inspect prompts, tool calls, and token usage locally without a hosted dashboard.
- Weir — It detects exact key values in agent logs and blocks them in coding sessions.
- My Claude Code Mods — Adds detailed session profiling, timeline snapshots, and loop detection to Claude Code.
- ModVet — Scans Claude Code mods offline in milliseconds with zero dependencies.
- Claude Code Session Tracker — Monitor Claude Code usage limits and token history in a single local interface.
- Stroq — Scans recorded sessions and guards future actions with local hooks.
- Skillkeel Starter — Blocks destructive shell commands and prevents hard-coded secrets from being written.
- claude-mem — It shares persistent, searchable agent memory across sessions and devices.
- Claude Code Usage Monitor — Tracks token usage, message counts, and session costs with local history and alerts.
- claudecode.nvim — Adds native AI coding assistant functionality to Neovim.
- jevgrep — Reduces coding agent costs by providing targeted, relevant repository context.
All Claude Scrub alternatives