git-semantic-search

Trace when code was introduced, removed, or modified using git pickaxe, blame, and bisect.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/rockcookies/skills --skill git-semantic-search-rockcookies
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-semantic-search
Source: https://github.com/rockcookies/skills/tree/main/skills/custom/git-semantic-search
Command: npx skills add https://github.com/rockcookies/skills --skill git-semantic-search-rockcookies

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Answering questions like "who wrote this line", "when did this bug start", or "where did this symbol come from" requires digging through git history with the right tool. This Skill maps each archaeology question to the correct git command (pickaxe, regex search, blame, or bisect) and enforces safe bisect practices so the repository is never left in a broken state. ## Core Features & Use Cases - Query-to-Tool Mapping: Routes exact-string searches to pickaxe (git log -S), pattern changes to regex search (git log -G), line ownership to blame, and bug-origin questions to bisect. - Two-Pass Search Strategy: Runs a scoped first pass with --no-merges, then widens to merge commits and --all branches when the first pass finds nothing. - Safe Bisect Workflow: Requires a clean working tree before git bisect start, mandates git bisect reset on completion, and restores the original HEAD state. - Structured Archaeology Report: Classifies each relevant commit as introduced, removed, migrated, or refactored with hash, date, and author evidence. - Use Case: A developer suspects a constant like MAX_RETRY was deleted months ago. The Skill runs pickaxe searches, inspects candidate diffs, and reports exactly which commit introduced, refactored, and removed it. ## Quick Start Ask the assistant to find when a specific function or string was introduced or removed from this repository using git history.

Frequently Asked Questions about git-semantic-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find when a line of code was introduced in git?▼

Use git log -S "<string>" (pickaxe) to find commits where the string's occurrence count changed, then run git show on candidate commits to confirm whether the diff added or removed it. For line-level ownership, use git blame -w -M -C -L N,M on the file.

What is the difference between git log -S and git log -G?▼

git log -S (pickaxe) finds commits where the count of an exact string changed, ideal for tracking when code appeared or disappeared. git log -G matches a regex against the diff content, catching changes where a pattern was modified even if the string count stayed the same.

How do I find which commit introduced a bug with git bisect?▼

Ensure the working tree is clean, then run git bisect start, mark the current commit bad and a known-good commit good. Test each checked-out commit (or automate with git bisect run <script>) until the first bad commit is found, then always run git bisect reset.

Why does git pickaxe return no results for my search string?▼

The default pass uses --no-merges and only the current branch, so the string may have entered through a merge commit or another branch. Retry without --no-merges and add --all to search every branch, or switch to git log -G if the text changed form.

Can git blame ignore formatting-only commits?▼

Yes. If the repository contains a .git-blame-ignore-revs file listing mass-reformat commits, run git blame --ignore-revs-file .git-blame-ignore-revs to attribute lines to their substantive authors. The flags -w -M -C also ignore whitespace and detect moved or copied lines.

When should I not use git bisect for history search?▼

Avoid bisect when the working tree has uncommitted changes, since it checks out other commits and can conflict with your work. It is also unsuitable for simple authorship questions, where blame or pickaxe answers faster without changing the checked-out state.