git-mininglisted
Install: claude install-skill taxueseek/session-digger
# Git Mining — Code History Integration
## Prerequisite Check
Before using git commands, verify the project is a git repo:
```bash
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
bash ${CLAUDE_PLUGIN_ROOT}/scripts/git-sessions.sh [repo-path] [--since "14 days ago"] [--gap 3600]
```
### Full structured context dump
```bash
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
```bash
git log --pretty=format:"%h|%ai|%s" --numstat --since="14 days ago" -30
```
### File history (survives renames)
```bash
git log --oneline --follow -- path/to/file.ts
```
### Symbol archaeology (when was X introduced?)
```bash
git log --oneline -S "FunctionName" # exact string
git log --oneline -G "pattern.*regex" # regex in diff
```
### Hotspot files (most frequently changed)
```bash
git log --name-only --pretty=format: --since="30 days ago" | grep -v '^$' | sort | uniq -c | sort -rn | head -15
```
### Commit message search
```bash
git log --oneline --grep="keyword" -i
```
### What changed in a file recently
```bash
git log -p --follow --since="7 days ago" -- path/to/file.ts
```
## Correlating Git Commits with Claude Sessions
Git commits made during Claude Code sessions cluster together