sanitize-git

sanitize-git is a command for Claude Code from Marcel-Bich/marcel-bich-claude-marketplace. It costs 16 tokens per session (4,200 once invoked), scanned A, original, MIT.

A command that checks Git history and tracked files for Claude or other AI-related traces, then removes or fixes matching entries. Git history is the record of a repository’s past commits.

In plain words
What is it for?
Use it to find AI references in commits, remove them from history, and correct files that should be excluded but remain tracked.
Why use it?
It helps clean commit messages, co-author tags, forbidden text, and files that are ignored but still tracked. Because rewriting history can affect other clones and requires force-pushing, it requires confirmation and a backup first.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; positional $N argument.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the dogma plugin — 9 commands, 1 agent shipped together

Good fit Use it to find AI references in commits, remove them from history, and correct files that should be excluded but remain tracked.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Marcel-Bich/marcel-bich-claude-marketplace
Claude Code
/plugin install dogma

Made for: Claude Code.

Or install dogma, the plugin that ships this one along with the rest of its 9 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sanitize-git

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcel-bich/marcel-bich-claude-marketplace/sanitize-git/github.svg)](https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/sanitize-git)
Your own site
<a href="https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/sanitize-git"><img src="https://agentmods.dev/badge/commands/marcel-bich/marcel-bich-claude-marketplace/sanitize-git/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sanitize-git

Your own site · 80×15
<a href="https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/sanitize-git"><img src="https://agentmods.dev/badge/commands/marcel-bich/marcel-bich-claude-marketplace/sanitize-git.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,200 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.04200
Opus 5 $0.00008 $0.02100
Sonnet 5 $0.00003 $0.00840
Haiku 4.5 $0.00002 $0.00420

Measured 10d ago against content hash 7312cd857485, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

sanitize-git scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/dogma/commands/sanitize-git.md · 663 lines

How it starts

The opening of the file, as written. The whole thing — 663 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude-Dogma: Sanitize Git History

You are executing the /dogma:sanitize-git command. Your task is to find and remove AI/Claude traces from git history and fix tracking issues where files that should be excluded are still being tracked.

CRITICAL: This command modifies git history. Always create a backup first and warn the user about force-push implications.

Overview

This command performs these checks:

  1. Commit Messages: Claude/Anthropic mentions, "Generated with Claude", etc.
  2. Co-Author Tags: Claude/Anthropic co-author entries in commits
  3. Tracked Exclusions: Files in .git/info/exclude that are still tracked
  4. Ignored but Tracked: Files matching .gitignore patterns but still tracked
  5. Forbidden Content: Files containing text patterns forbidden by CLAUDE.git.md

Phase 0: Mandatory Risk Acknowledgment

THIS STEP IS MANDATORY AND CANNOT BE SKIPPED.

Before doing ANYTHING else, display this warning and require explicit confirmation:

================================================================================
                         CRITICAL WARNING - READ CAREFULLY
================================================================================

This command can PERMANENTLY and IRREVERSIBLY damage your git repository.

RISKS INCLUDE:
- Complete loss of git history
- Corrupted repository state requiring re-clone
- Force-push overwrites remote history for ALL collaborators
- Detached commits that cannot be recovered
- Broken references and tags
- Loss of merge history and branch relationships

WHAT THIS COMMAND DOES:
- Rewrites git commits using filter-branch or similar tools
- Removes files from history across ALL commits
- Modifies commit messages and author information
- Requires force-push to synchronize with remote

PREREQUISITES:
- Ensure all collaborators are informed before force-pushing
- Verify you have push permissions to the remote
- Confirm no critical work depends on current commit hashes

A backup will be created in /tmp/, but this is NOT a guarantee against data loss.
Git history rewriting is inherently dangerous and error-prone.

USE AT YOUR OWN RISK. THE AUTHOR TAKES NO RESPONSIBILITY FOR DATA LOSS.

================================================================================

Read the full file on GitHub · 663 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 663 lines · 16 tokens per session scan A 7312cd857485

Subscribe to this mod's changes

sanitize-git is a command published in the GitHub repository Marcel-Bich/marcel-bich-claude-marketplace (13 stars, last pushed yesterday), licensed MIT. It adds 16 tokens to every session and 4,200 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.