Skip to content
Agentmart
Submit a tool

git-history-secret-remediation

Use when a user asks to detect secrets in git commit history, clean tracked sensitive data, rewrite history with git-filter-repo, or verify cleanup with…

Skill by haitaopanhq

IndexedApache-2.0★ 1
Write a review

Chalk Labs

Need help deploying git-history-secret-remediation?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/haitaopanhq-git-history-secret-remediation

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when a user asks to detect secrets in git commit history, clean tracked sensitive data, rewrite history with git-filter-repo, or verify cleanup with gitleaks. Covers gitleaks detect -v, replacement mapping, path removal, ref inventory, history rewrites, force-push planning, and post-cleanup coordination.

Use cases: data, security

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/git-history-secret-remediation

What's inside

Skill name
git-history-secret-remediation
Description
Use when a user asks to detect secrets in git commit history, clean tracked sensitive data, rewrite history with git-filter-repo, or verify cleanup with gitleaks. Covers gitleaks detect -v, replacement mapping, path removal, ref inventory, history rewrites, force-push planning, and post-cleanup coordination.
License
Apache-2.0
Metadata
owner: cloud-neutral-toolkit · distribution: clawhub-compatible · package-format: .skill
Instructions
182 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (7)

  • SKILL.md
  • backup_git_remotes.py · scripts/
  • list_git_refs.sh · scripts/
  • restore_git_remotes.py · scripts/
  • run_filter_repo_redaction.sh · scripts/
  • run_gitleaks_history_scan.sh · scripts/
  • run_history_remediation.sh · scripts/

SKILL.md (first lines)

# Git History Secret Remediation

Use this skill when secrets have already been committed and the task is to inspect, scrub, verify, and coordinate git history cleanup.

Core tools:

- `gitleaks detect -v`
- `git filter-repo`

Bundled scripts:

- `scripts/list_git_refs.sh`
- `scripts/run_gitleaks_history_scan.sh`
- `scripts/backup_git_remotes.py`
- `scripts/restore_git_remotes.py`
- `scripts/run_filter_repo_redaction.sh`
- `scripts/run_history_remediation.sh`

## When To Use

Trigger this skill when the user asks to:

- scan commit history for secrets
- run `gitleaks detect -v`
- remove passwords, API keys, tokens, or private keys from git history
- run `git filter-repo`
- clean up old commits after a leak
- rewrite history and force-push the cleaned repository

## Safety Rules

1. Clean current `HEAD` first, then rewrite history.
2. Rotate real leaked credentials out-of-band. History cleanup is not secret rotation.
3. Prefer empty values or angle-bracket placeholders in tracked samples.
4. Do not use fake secret-looking placeholders such as `` when scanners still match them.
5. Treat history rewrite as destructive:
   - inventory refs first
   - expect force-push
   - warn that teammates must reclone or fully scrub old clones
6. Back up `git remote -v` before rewrite and restore it after rewrite or force-push preparation.

## Workflow

### 1. Inventory refs

At repo root:

```bash
bash skills/git-history-secret-remediation/scripts/list_git_refs.sh /path/to/repo
```

This tells you which branches and tags may need to be force-pushed after rewriting.

### 2. Run the history scan

Use the bundled wrapper:

```bash
bash skills/git-history-secret-remediation/scripts/run_gitleaks_history_scan.sh /path/to/repo
```

Behavior:

- auto-detects `config/gitleaks.toml` when present
- otherwise runs `gitleaks detect -v` with tool defaults

Classify findings into:

- current-file leaks still present in `HEAD`
- history-only leaks from deleted or renamed files

### 3. Sanitize current HEAD

Before rewriting history:

- replace real secrets in tracked sample/config files
- prefer:
  - `""`
  - empty env values
  - `<OPENSSH_PRIVATE_KEY_CONTENT>`
- keep real values only in local `.env` or a secret manager

### 4. Build a replace-text file

Create a temporary mapping file, for example:

```text
real-secret-1==>
real-secret-2==>
OPENSSH_PRIVATE_KEY_BEGIN_LINE==><OPENSSH_PRIVATE_KEY_BEGIN_LINE>
OPENSSH_PRIVATE_KEY_END_LINE==><OPENSSH_PRIVATE_KEY_END_LINE>
```

Notes:

- default replacement can be empty
- use explicit placeholders only when file syntax requires visible text
- if an old placeholder also triggers scanners, run a second rewrite replacing it with an empty string

### 5. Remove history-only artifact files when appropriate

If a file exists only as a leak artifact, prefer removing it from history entirely.

Examples:

- `leaks_github.json`
- obsolete docs that embed private-key examples
- scratch backup files that contain real credentials

### 6. Rewrite history

Use the bundled wrapper:

```bash
bash skills/git-history-secret-remediation/scripts/run_filter_repo_redaction.sh \
  /path/to/repo \
  /tmp/replace-text.txt \
  [path-to-remove...]
```

From haitaopanhq/.github, Apache-2.0.

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Mar 17, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get git-history-secret-remediation running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying git-history-secret-remediation?

CallGet help
Cite this page

git-history-secret-remediation skill. Agent Mart. https://agentmart.dev/skills/haitaopanhq-git-history-secret-remediation (last updated 2026-10-24)