Free SKILL.md scraped from GitHub. Clone the repo or copy the file directly into your Claude Code skills directory.
npx versuz@latest install vivekkarmarkar-claude-code-os-skills-githistorygit clone https://github.com/VivekKarmarkar/claude-code-os.gitcp claude-code-os/SKILL.MD ~/.claude/skills/vivekkarmarkar-claude-code-os-skills-githistory/SKILL.md--- name: githistory description: Search git commit history for a feature or change by loose description or precise name. Finds when something was added, modified, or removed. triggers: - "when did we add" - "find the commit for" - "git history" - "when was this committed" - "find in history" - "/githistory" --- # Git History — Find Features in Commit History Search git commit history to find when a specific feature, change, or fix was committed. ## Arguments `<feature description>` — A loose description or precise name of what to search for. - `/githistory blackboard` — finds commits related to the blackboard feature - `/githistory LaTeX font size` — finds when LaTeX font was changed - `/githistory` — no argument, ASK the user: "What feature or change are you looking for in the commit history?" ## Workflow ### Step 1: Parse the query If no argument is provided, ask: "What feature or change are you looking for in the commit history?" Wait for the user's answer. ### Step 2: Search commit messages Search the git log for commits matching the query: ```bash # Search commit messages (case-insensitive) git log --all --oneline --grep="<keyword>" -i # If the query has multiple words, try each word separately git log --all --oneline --grep="<word1>" --grep="<word2>" --all-match -i # Also try a loose search with just the most distinctive word git log --all --oneline --grep="<most distinctive word>" -i ``` ### Step 3: Search diffs (if commit messages don't match) If no commits found by message, search the actual code changes: ```bash # Search for the term in the actual diffs git log --all --oneline -S "<search term>" # For regex patterns git log --all --oneline -G "<regex pattern>" ``` ### Step 4: Show details of matching commits For each matching commit (up to 10), show: ```bash # Show commit details with changed files git show --stat <commit-hash> # Show the actual diff for the relevant file(s) git show <commit-hash> -- <relevant-file> ``` ### Step 5: Report Present results clearly: ``` Found N commits related to "<query>": 1. <hash> <date> — <commit message> Files: <list of changed files> 2. <hash> <date> — <commit message> Files: <list of changed files> Most relevant: <hash> — <why this one matches best> ``` If no results found: ``` No commits found matching "<query>". Tried: commit message search, diff search. Suggestions: try different keywords, check branch names, or use `git log --all --oneline` to browse. ``` ## Rules 1. **Always search commit messages first** — it's faster and usually sufficient. 2. **Fall back to diff search** if messages don't match — the feature might have been committed with a generic message. 3. **Search all branches** — use `--all` to include feature branches that may not be merged. 4. **Show context** — don't just list hashes, show dates and changed files so the user can identify the right commit. 5. **If multiple matches**, highlight the most relevant one based on how closely the commit message matches the query.