repository-history

repository-history is a skill for Claude Code, Codex from fmind/dot. It costs 48 tokens per session (1,494 once invoked), scanned A, original, MIT.

A read-only way to use Git history to explain why tracked code exists. It traces files, lines, and symbols to earlier commits, changes, renames, reverts, authors, and related work.

In plain words
What is it for?
Use it to investigate when code was introduced, why it changed, who changed it, and whether related files or issues changed at the same time.
Why use it?
It helps answer questions about the reason behind unfamiliar or risky code before editing it. It preserves current work because it only examines repository history.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fmind/dot/repository-history
Any agent
npx skills add fmind/dot --skill repository-history
Clone the repo
git clone --depth 1 https://github.com/fmind/dot

Made for: Claude Code, Codex.

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 repository-history

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmind/dot/repository-history.svg)](https://agentmods.dev/skills/fmind/dot/repository-history)
Your own site
<a href="https://agentmods.dev/skills/fmind/dot/repository-history"><img src="https://agentmods.dev/badge/skills/fmind/dot/repository-history.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,494 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00048 $0.01494
Opus 5 $0.00024 $0.00747
Sonnet 5 $0.00010 $0.00299
Haiku 4.5 $0.00005 $0.00149

Measured yesterday against content hash 790211b19bb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

repository-history 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 yesterday.

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.

skills/repository-history/SKILL.md · 74 lines

How it starts

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

Repository History

Recover why tracked code exists from read-only Git history, cited and labeled by confidence, before a risky edit; systematic-debugging owns reproducing a current failure and diff-review owns defects in one change.

Workflow

  1. Frame the question: Name the repository, tracked path, line range or symbol, proposed change, and the specific uncertainty; keep the scope small enough that every cited commit can be inspected.

  2. Establish coverage: Use git to record branch, HEAD, dirty state, available refs, and whether the clone is shallow; say which evidence Git cannot supply when the path is untracked, generated, vendored, or absent at HEAD. Preserve staged, unstaged, and untracked work.

    git status --short
    git rev-parse HEAD
    git rev-parse --is-shallow-repository
    
  3. Seed line provenance: Treat movement and copy detection as clues, not guarantees; review a repository-owned .git-blame-ignore-revs before honoring it and disclose ignored revisions.

    git blame --line-porcelain -w -M -C -C -C -L <start>,<end> -- <path>
    
  4. Trace the timeline: Use the smallest relevant view and name the exact revision range instead of treating every ref as one lineage.

    git log --follow --format=fuller -- <path>   # one file across renames
    git log -L <start>,<end>:<path>              # commits that shaped a line range
    git log -S '<literal>' -p -- <path>          # occurrence count of a string changed
    git log -G '<regex>' -p -- <path>            # a diff added or removed matching lines
    
  5. Inspect candidate commits: Read subject, body, changed tests, schemas, migrations, configuration, and docs together; preserve reverts and behavior changes, and group mechanical edits only after verifying they are mechanical.

    git show --format=fuller --find-renames --find-copies --stat <sha>
    
  6. Resolve ancestry anomalies: Check renames, splits, copies, bulk formatting, generated files, squashes, rebases, cherry-picks, backports, merge parents, and revert pairs; when line history stops at a rewrite, compare file history, pickaxe searches, and neighboring tests, and report the break rather than forcing one origin.

  7. Find coupling clues: Count files that repeatedly changed with the target across behavior commits. Repeated co-change can suggest a test, schema, migration, or deployment constraint; one shared commit or a formatting sweep proves nothing.

  8. Add remote rationale only when needed: Map an exact commit to its pull requests with gh, then read the PR body, linked issue, reviews, inline comments, and changed files; paginate, disclose truncation, and treat a title match or semantic search alone as low confidence.

  9. Extract decision atoms: Separate facts, author-stated rationale, inference, contradiction, and unknowns; cite the commit, patch, test, issue, or review for every proposed constraint and check whether later changes superseded it.

  10. Return the history note: Do not implement the change unless requested separately. Report:

    • Bottom line: the most likely explanation, its confidence, and whether it changes the proposed plan.
    • Scope and identity: HEAD, working-copy boundary, path, lines or symbol, revision range, shallow state, and remote evidence checked.
    • Origin and timeline: introducing evidence, later changes, fixes, reverts, and moves with short hashes and dates.
    • Decision atoms and companion evidence: each labeled fact, inference, contradiction, or unknown; co-changes stay correlation until code confirms the seam.
    • Change risk: what could break, which evidence may be stale, and the smallest current test or human answer that resolves the rest.
    • Evidence sources: local objects, remote discussion, runtime behavior, and human intent kept separate.

Read the full file on GitHub · 74 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. yesterday First seen · 74 lines · 48 tokens per session scan A 790211b19bb5

Subscribe to this mod's changes

repository-history is a skill published in the GitHub repository fmind/dot (4 stars, last pushed today), licensed MIT. It adds 48 tokens to every session and 1,494 once invoked, about $0.0002 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-09-03.