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…

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.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.svg" alt="Measured on agentmods" 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 $0.00041 $0.00622
Sonnet 5 $0.00016 $0.00249
Haiku 4.5 $0.00008 $0.00124

Measured 6d ago against content hash b5c8b3e68c7c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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. 6d 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 1mo ago), licensed MIT. It adds 82 tokens to every session and 1,244 once invoked, about $0.0004 per session on Opus 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

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

changelog-summarizing

Use this skill when the user asks to summarize, recap, or post about repository changes in the Shopware AI Coding Tools marketplace since a given date — phrases like "write a changelog post for Discord", "recap this week's commits for Slack", "summarize what shipped since 2026-04-01", "draft a release announcement".…

shopwareLabs/ai-coding-tools · 106 tokens

commit-message-writing

Use this skill when the user explicitly asks to generate, write, draft, or create a commit message, squash commit, commit title, or merge commit message for the Shopware core repository (shopware/shopware). Supports two modes — full commit messages (title + body) for branch commits, and squash merge titles…

shopwareLabs/ai-coding-tools · 160 tokens

plugin-updating

Use this skill when the user asks to bump, update, or release a new version of a plugin in the Shopware AI Coding Tools marketplace — phrases like "bump test-writing to 3.8.0", "release a patch for dev-tooling", "update the plugin version". Handles synchronized version bumps across plugin.json and every SKILL.md…

shopwareLabs/ai-coding-tools · 102 tokens

feature-branch-pr-writing

Use this skill when the user asks to write, draft, create, or improve a PR description for a Shopware core repository PR — AND that PR targets a non-trunk feature branch (not trunk itself). Trigger phrases like "write a PR description", "draft the PR", "what should I put in the PR body". The skill detects the target…

shopwareLabs/ai-coding-tools · 152 tokens