code-history

code-history is a skill for Claude Code from 2ykwang/agent-skills. It costs 82 tokens per session (1,244 once invoked), scanned A, a copy of code-history, MIT.

A read-only method for tracing how particular code, files, or patterns changed across Git history.

In plain words
What is it for?
Use it to investigate a function, pattern, or file and find the commits or pull requests connected to its changes.
Why use it?
It explains when code was added, changed, or removed and can reveal the reason behind that evolution.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Good fit Use it to investigate a function, pattern, or file and find the commits or pull requests connected to its changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/2ykwang/agent-skills/code-history
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.

Any agent
npx skills add 2ykwang/agent-skills --skill code-history
Clone the repo
git clone --depth 1 https://github.com/2ykwang/agent-skills

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/2ykwang/agent-skills/code-history/github.svg)](https://agentmods.dev/skills/2ykwang/agent-skills/code-history)
Your own site
<a href="https://agentmods.dev/skills/2ykwang/agent-skills/code-history"><img src="https://agentmods.dev/badge/skills/2ykwang/agent-skills/code-history/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 code-history

Your own site · 80×15
<a href="https://agentmods.dev/skills/2ykwang/agent-skills/code-history"><img src="https://agentmods.dev/badge/skills/2ykwang/agent-skills/code-history.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,244 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 100% copy Near-identical to another mod 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.00082 $0.01244
Opus 5.5 $0.00033 $0.00498
Sonnet 5.5 $0.00016 $0.00249
Haiku 4.5 $0.00008 $0.00124

Measured 1mo ago against content hash b5c8b3e68c7c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-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 1mo 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.

Origin

This is a copy

100% identical to code-history — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/code-history/SKILL.md · 119 lines

How it starts

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

Code History

Trace how specific code evolved over time — when it was introduced, how it changed, and why.

Use this skill when

  • Understanding how a function or method evolved over time
  • Tracking when a specific code pattern was introduced or changed
  • Finding which commit/PR introduced, modified, or removed a piece of code
  • Investigating why code changed and what motivated each revision

Do not use this skill when

  • The user wants to modify code (this skill is read-only)
  • The user wants general git log without a specific target
  • The user only needs git blame for a single line's last author
  • The user only wants to see a specific commit's diff (git show is sufficient)

This skill is read-only. Never modify any files or run write commands.

Instructions

Tool Usage

Purpose Tool Command / Pattern
Search code pattern history Bash git log -p --all -S '<pattern>'
Trace function line history Bash git log -L :'<func>':<file> --no-patch
Trace file history Bash git log --follow --oneline -- <path>
Find pattern location Grep Search for pattern across codebase
Read file context Read Read surrounding code for understanding
Link commit to PR Bash gh pr list --search '<sha>' --state all

Step 1: Identify the Target

Parse $ARGUMENTS to determine what to trace:

Input type Example Detection
Code pattern user["type"] == "ADMIN" Contains operators, quotes, brackets
Function/method name ensure_valid_state Single identifier, no operators
File path src/auth/services.py Contains / or file extension
Ambiguous Something else Ask the user to clarify

If the input is a function name, locate the file it belongs to using Grep to search for the definition pattern.

Step 2: Collect History

First, measure the history size:

git log --oneline --all -S '<pattern>' | wc -l

Read the full file on GitHub · 119 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 119 lines · 82 tokens per session scan A b5c8b3e68c7c

Subscribe to this mod's changes

code-history is a skill published in the GitHub repository 2ykwang/agent-skills (19 stars, last pushed 2mo ago), licensed MIT. It adds 82 tokens to every session and 1,244 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to code-history, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

oss-contribution-research

Research and prepare an outside contribution to an open-source repo, then stop at a queue item for a human to approve: policy check, intake, duplicate check, reproduction, patch, the repo's own checks, an independent critic rerun, and a disclosed, hashed draft of the exact text to post. Use this skill whenever the…

rampstackco/claude-skills · 200 tokens

loop-it

An automated workflow that repeatedly fetches open GitHub issues, orders them by dependencies, implements them, reviews the changes, and ships them.

smallnest/goal-workflow · 93 tokens

ship-it

A GitHub workflow for finishing an implemented issue: commit the relevant changes, push a branch, create a pull request, merge it, and close the issue. GitHub is a service for hosting code and reviewing changes, and a pull request is a proposed change for review.

smallnest/goal-workflow · 96 tokens

antigravity-maintainer-batch-release

Run protected AAS maintainer sweeps, PR merge batches, canonical sync, Core preview checks, and scripted releases. Use for repository maintenance, main alignment, CLI/MCP/Workbench changes, or release work; not ordinary contribution tasks.

lingxling/awesome-skills-cn · 57 tokens

agentic-jujutsu

Quantum-resistant, self-learning version control for AI agents, with ReasoningBank intelligence and multi-agent coordination. Use when designing agent memory/versioning, coordinating multiple agents over shared state, or building experience-replay and learning loops into an agentic system.

frankxai/claude-skills-library · 57 tokens

github-multi-repo

Multi-repository coordination, synchronization, and architecture management across many GitHub repos. Use when changes span several repositories, keeping repos in sync, or planning cross-repo architecture and dependency work.

frankxai/claude-skills-library · 44 tokens