git-mining
Skill34 starsChanged 4 months agoISCView on GitHub
This skill should be used when the user asks to "check git history", "trace code changes", "find when something was added", "correlate commits with sessions", "find hotspot files", or needs to mine git repository history for insights. Only applicable when the current project is a git repository. Use with `/trend` for commit frequency analysis over time.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- xiaolai/echo-sleuth-for-claudeedited, first seen Mar 29, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- xiaolai/echo-sleuth-for-claude★ 999% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- session-diggerSkill
- deep-analysisSkill
- env-doctorSkill
- env-masterSkill
- env-radarSkill
- experience-synthesisSkill
- jsonl-coreSkill
- memory-managementSkill
- native-diagSkill
- skill-insightSkill
- skill-searchSkill
- wechat-diggerSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Before using git commands, verify the project is a git repo:
- Distinctive: line 16
If not a git repo, skip all git-related analysis and rely on JSONL data only.
- Very specific: line 95
Read the session .jsonl to understand the full conversation context behind those commits
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Mining — Code History Integration
Prerequisite Check
Before using git commands, verify the project is a git repo:
git rev-parse --git-dir 2>/dev/null && echo "IS_GIT_REPO" || echo "NOT_GIT_REPO"If not a git repo, skip all git-related analysis and rely on JSONL data only.
Scripts
Cluster commits into work sessions
bash ${CLAUDE_PLUGIN_ROOT}/scripts/git-sessions.sh [repo-path] [--since "14 days ago"] [--gap 3600]Full structured context dump
bash ${CLAUDE_PLUGIN_ROOT}/scripts/git-context.sh [repo-path] [--since "7 days ago"] [--limit 30]Key Git Commands for Agents
Recent commits with file changes
git log --pretty=format:"%h|%ai|%s" --numstat --since="14 days ago" -30File history (survives renames)
git log --oneline --follow -- path/to/file.tsSymbol archaeology (when was X introduced?)
git log --oneline -S "FunctionName" # exact string
git log --oneline -G "pattern.*regex" # regex in diffHotspot files (most frequently changed)
git log --name-only --pretty=format: --since="30 days ago" | grep -v '^$' | sort | uniq -c | sort -rn | head -15Commit message search
git log --oneline --grep="keyword" -iWhat changed in a file recently
git log -p --follow --since="7 days ago" -- path/to/file.tsCorrelating Git Commits with Claude Sessions
Git commits made during Claude Code sessions cluster together in time (typically 60-440 seconds apart). Cross-session gaps are 1+ hours.
Method 1: Timestamp matching
Compare sessions-index.json entries (created/modified fields) with git commit timestamps (git log --pretty=format:"%at") to find which commits were made during which sessions.
Method 2: Conventional commit patterns
Claude Code sessions typically produce commit sequences like:
feat:→fix:→fix:→docs:→release:(complete cycle)fix:→test:(debugging session)refactor:→style:(cleanup session)
Method 3: Branch correlation
The gitBranch field in session records and sessions-index.json entries tells you which branch each session was working on. Match with git log --all --oneline <branch>.
What to Extract from Git History
| Question | Command |
| What changed recently? | git log --oneline --since="7 days ago" |
| What files change together? | git log --name-only then co-occurrence analysis |
| Who/what introduced a bug? | git log -S "buggy_code" + git blame |
| What's the architectural evolution? | git log --diff-filter=A --name-status (new files over time) |
| What keeps breaking? | git log --grep="fix" --name-status |
| What was the rationale? | git log --pretty=format:"%s%n%b" -1 <hash> (commit body) |
Combining Git + JSONL
The most powerful analysis combines both sources:
- Find the relevant git commits for a time period
- Match their timestamps to Claude sessions
- Read the session
.jsonlto understand the full conversation context behind those commits - This gives you: what was done (git) + why it was done (conversation) + what was tried and failed (tool errors in JSONL)
下游协作
| 触发条件 | 推荐 |
| 需要解析关联的会话记录 | jsonl-core |
| 挖出提交模式需要提炼经验 | experience-synthesis |
DO NOT
- 从零创建新 skill →
skill-creator - 需要提炼经验教训 →
experience-synthesis(git-mining 只做挖掘,不做分析) - 需要解析 JSONL 会话数据 →
jsonl-core
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

