GitHub Sensitive Data Cleanup
A guided, safety-first workflow to scan for and purge secrets, private domains/IPs and PII from Git history, then force-push safely.
Security & ReviewAdvanced★ 1,323⑂ 212AI score 9/10Last updated: Aug 8, 2026
What it does
- Scans the entire repo history with
gitleaks, custom regex layers, an optional private gitleaks config, and an AI semantic review pass for context regex can't catch. - Creates and verifies a
git bundlebackup before runninggit filter-repo --replace-text. - Re-verifies afterwards that none of the original sensitive strings remain in any commit.
- Confirms repo visibility and fork count with
gh repo view, then pushes using--force-with-lease; never adds--no-verify. - Documents special cases: open PRs, forks retaining old history,
filter-repo"fresh clone" errors, gitleaks false positives.
Who it's for
- Developers who accidentally committed an API key or internal infrastructure detail to a public repo.
- Teams sanitizing a repository before open-sourcing it.
- Maintainers who must force-push to a public repository and want guardrails.
Example uses
- "Scan this repo for leaked secrets" → runs the scanner, produces a JSON report, and classifies each finding as rotate / remove / allowlist.
- "I pushed a Slack token — remove it from history" → prompts you to rotate first, then walks through replacements file, backup, rewrite, verify, safe push.
- "Our internal domain appears in old commit messages before we go public" → uses
literal:replacements to swap it for an example domain and checks fork/PR impact.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/daymade/claude-code-skills/HEAD/github-sensitive-data-cleanup/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the github-sensitive-data-cleanup folder from the GitHub repo daymade/claude-code-skills into my ~/.claude/skills/github-sensitive-data-cleanup/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/daymade/claude-code-skills.git /tmp/claude-code-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-skills/github-sensitive-data-cleanup ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/daymade/claude-code-skills.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r claude-code-skills/github-sensitive-data-cleanup ~/.claude/skills/ - Install the required tools (macOS):
brew install git-filter-repo gitleaks gh - Authenticate GitHub CLI:
gh auth login - Install
uvso the bundled scripts can run:curl -LsSf https://astral.sh/uv/install.sh | sh - Restart Claude Code and ask something like "scan this repo for sensitive data".
- ⚠️ Before any history rewrite, confirm the backup bundle was created and verified — the rewrite is destructive.
View source on GitHub ↗License: MIT