# Secrets in git history

> Secrets in git history is an open-source agent skill for security. Guides an agent through mining git history for leaked secrets and developer identities. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/UseOSINT/Skills/tree/main/skills/secrets-in-git-history
- **Repository:** https://github.com/useosint/skills
- **GitHub stars:** 76
- **License:** MIT
- **Skill name:** secrets-in-git-history
- **Collection:** https://github.com/UseOSINT/Skills
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-03

## About

This skill walks an agent through investigating a GitHub, GitLab or git repository beyond its current state. It covers pulling commit author emails, resolving GitHub noreply addresses to account IDs, using code search to find internal domains and infrastructure strings, and mapping an organisation's members through their personal repositories, stars and follows. The core method is to mirror-clone a repository, scan all refs rather than only HEAD, and pickaxe for specific strings to see when they entered and left the history.

The workflow names concrete tools: trufflehog and gitleaks run over the mirror, git log with pickaxe and deletion filters, and the commit .patch endpoint. It also gives a grading scheme for findings (confirmed, probable, unconfirmed, rejected), requires a commit SHA, date and file path for each record, and tells the agent to treat placeholders and publishable browser keys as non-findings.

The skill expects a shell with git and the scanners installed, plus network access to the code host. It is written for authorized security, diligence or incident-response work. It instructs the agent never to test a discovered credential against a live service and to recommend rotation through a disclosure channel instead.

## When your agent uses it

> Mine GitHub, GitLab and git history for identities, infrastructure and leaked credentials using commit author emails, GitHub code search, the commit .patch endpoint, trufflehog, gitleaks, git log pickaxe and full-ref history scans. Use when investigating a developer or organisation on GitHub, finding leaked API keys, AWS keys or tokens in code, enumerating org members and their personal repos, or recovering secrets deleted from HEAD but still present in history or forks. Applies to software supply-chain risk, credential exposure response, M&A technical diligence, and insider-threat investigation. Reference at useosint.com/skills/secrets-in-git-history.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/UseOSINT/Skills/tree/HEAD/skills/secrets-in-git-history)
- [License: MIT](https://github.com/UseOSINT/Skills/tree/HEAD/skills/secrets-in-git-history)

## Features

- **Commit author extraction:** Lists distinct author names and emails across all refs of a mirror-cloned repository.
- **Noreply ID resolution:** Resolves GitHub numeric user IDs embedded in noreply addresses to current account names.
- **Full-history secret scanning:** Runs trufflehog and gitleaks over mirror clones so deleted secrets in history are covered.
- **Pickaxe string tracing:** Uses git log -S across all refs to find when a hostname or key entered and left the code.
- **Organisation member mapping:** Maps an organisation's contributors through public members, personal repos, stars and follows.
- **Finding confidence grading:** Grades findings as confirmed, probable, unconfirmed or rejected with citation requirements.

## Good for

- Find the email addresses of developers who committed to a company's repositories
- Scan a repository's full git history for API keys that were deleted later
- Trace when an internal hostname first appeared in a codebase
- Map the engineering team of an organisation from its public code
- Check whether a deleted config file exposed infrastructure details in past commits

## Install

### Claude Code

This skill ships in the `useosint` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add UseOSINT/Skills
/plugin install useosint@useosint
```

Or copy only this skill to `~/.claude/skills/secrets-in-git-history`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/UseOSINT/Skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/secrets-in-git-history &&
cp -R "$tmp/skills/secrets-in-git-history" ~/.claude/skills/secrets-in-git-history &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/secrets-in-git-history` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/secrets-in-git-history` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/UseOSINT/Skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/secrets-in-git-history &&
cp -R "$tmp/skills/secrets-in-git-history" ~/.agents/skills/secrets-in-git-history &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/secrets-in-git-history` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/secrets-in-git-history` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/UseOSINT/Skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/secrets-in-git-history &&
cp -R "$tmp/skills/secrets-in-git-history" ~/.cursor/skills/secrets-in-git-history &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/secrets-in-git-history` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/UseOSINT/Skills.git --path skills/secrets-in-git-history
```

Or copy the folder to `~/.gemini/skills/secrets-in-git-history` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/secrets-in-git-history`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/UseOSINT/Skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/secrets-in-git-history &&
cp -R "$tmp/skills/secrets-in-git-history" ~/.copilot/skills/secrets-in-git-history &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/secrets-in-git-history` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/UseOSINT/Skills.git
```

Then copy `Skills/skills/secrets-in-git-history` into your agent's skills folder as `secrets-in-git-history`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It relies on git, the trufflehog and gitleaks scanners, and network access to the code host. It also expects the user to be doing authorized security or investigative work.

### Does Secrets in git history verify whether a leaked credential is still live?

No. It explicitly forbids authenticating with any discovered credential and recommends reporting it for rotation instead.

### Why scan all refs instead of the working tree?

Secrets deleted from HEAD remain in history, clones and forks, so the skill scans mirror clones across every ref.

### Does Secrets in git history work with GitLab as well as GitHub?

The description names GitHub, GitLab and git history, but most of the detailed API steps shown in the content target GitHub.

### How do I install Secrets in git history in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/secrets-in-git-history to use it in all your projects, or to .claude/skills/secrets-in-git-history in one project. Or install the useosint plugin, which includes it: /plugin marketplace add UseOSINT/Skills, then /plugin install useosint@useosint.

### Does Secrets in git history run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Secrets in git history?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Secrets in git history?

The closest alternatives to Secrets in git history are Osint, Sh kb secrets, Vibe pre commit audit, Secret scanning and Source code scanning.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Osint](https://ai-powered.com/skills/osint-transilienceai): Osint is an open-source agent skill for security.
- [Sh kb secrets](https://ai-powered.com/skills/sh-kb-secrets): Sh kb secrets is an open-source agent skill for security.
- [Vibe pre commit audit](https://ai-powered.com/skills/vibe-pre-commit-audit): Vibe pre commit audit is an open-source agent skill for security.
- [Secret scanning](https://ai-powered.com/skills/secret-scanning): Secret scanning is an open-source agent skill for security.
- [Source code scanning](https://ai-powered.com/skills/source-code-scanning): Source code scanning is an open-source agent skill for security.
- [Differential review](https://ai-powered.com/skills/differential-review): Differential review is an open-source agent skill for security.
- [Secret serialization](https://ai-powered.com/skills/secret-serialization): Secret serialization is an open-source agent skill for security.
- [Sh kb ci cd](https://ai-powered.com/skills/sh-kb-ci-cd): Sh kb ci cd is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/secrets-in-git-history
