Sanitize Git Repo

🌐Community
by letta-ai · vlatest · Repository

Removes sensitive data like passwords and API keys from a Git repository history using pattern matching.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add sanitize-git-repo npx -- -y @trustedskills/sanitize-git-repo
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "sanitize-git-repo": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/sanitize-git-repo"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

The sanitize-git-repo skill cleans and prepares Git repositories by removing sensitive information, fixing structural issues, and ensuring compliance with security standards before deployment or sharing. It automates the detection of secrets in commit history and refactors repository configurations to prevent accidental data leaks.

When to use it

  • Before pushing a repository containing potentially exposed API keys or credentials to public platforms.
  • When preparing open-source projects for release to ensure no private user data remains in the codebase.
  • During CI/CD pipeline setup to automatically scrub sensitive logs and configuration files from version control.
  • To remediate legacy repositories that have accumulated secrets over time without manual auditing.

Key capabilities

  • Scans commit history and current files for common secret patterns.
  • Removes or redacts identified sensitive data while preserving code integrity.
  • Validates repository structure to ensure no broken links or invalid references remain.
  • Generates a clean, sanitized clone ready for public distribution.

Example prompts

  • "Sanitize this Git repository by removing all hardcoded API keys and database passwords from the commit history."
  • "Prepare my open-source project for public release by scrubbing any user emails or private tokens found in the codebase."
  • "Run a full security audit on this repo and output a clean version with all sensitive configuration files redacted."

Tips & gotchas

Ensure you have a backup of your original repository before running sanitization, as the process permanently alters the history. This skill focuses on automated pattern matching; manually review critical changes to confirm no legitimate data was inadvertently removed.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
letta-ai
Installs
30

🌐 Community

Passed automated security scans.