Git Cleanup

🌐Community
by trailofbits · vlatest · Repository

Removes unused files, branches, and tags from Git repositories to streamline projects and reduce clutter.

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 git-cleanup npx -- -y @trustedskills/git-cleanup
2

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

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

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

About This Skill

What it does

The git-cleanup skill automates the process of cleaning up a Git repository by removing unnecessary files, optimizing history, and ensuring best practices are followed. It helps maintain a clean and efficient version control system by identifying and eliminating redundant or obsolete data.

When to use it

  • Before pushing changes to a shared repository to ensure a clean commit history.
  • After merging multiple branches to remove leftover merge conflicts or temporary files.
  • When preparing for a code audit or review to streamline the repository structure.
  • To optimize storage usage by pruning large or unused Git objects.

Key capabilities

  • Removes untracked and ignored files from the working directory.
  • Prunes unreachable commits, tags, and branches to reduce repository size.
  • Identifies and removes redundant merge commits or unnecessary rebase history.
  • Ensures proper .gitignore configuration is followed for future commits.

Example prompts

  • "Clean up my Git repository by removing unused files and optimizing the commit history."
  • "Prune unreachable objects from the Git repository to reduce its size."
  • "Ensure that all untracked files are removed and the .gitignore file is properly configured."

Tips & gotchas

  • Always make sure to back up your repository before running cleanup operations, as some actions may be irreversible.
  • This skill works best when used in conjunction with a well-maintained .gitignore file to avoid accidental removal of important files.

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
trailofbits
Installs
224

🌐 Community

Passed automated security scans.