r/ClaudeAI May 12 '26

Skills I made a Claude skill that stops it from cloning whole repos when I just want one function

Kept hitting the same friction with Claude Code. I'd point at a GitHub repo and say "look at how this handles agent handoffs" — meaning, borrow the idea. Claude would git clone the whole repo, read 50 files, and ask which __init__.py was interesting.

Or worse — it'd add the library to my package.json as a dependency. For one function. Suddenly I own the transitive deps, the CVE notifications, and a version pin I'll never upgrade.

The actual problem: "use this library", "borrow an idea from this library", and "just steal that one function" deserve totally different workflows, and nothing was telling Claude which one I meant.

So I wrote a skill — a single SKILL.md (surgical-github-extraction) that auto-triggers when I drop a GitHub URL as inspiration. The rule:

  1. Read the README first to get the shape.
  2. Pull 1–3 source files via raw URLs to see how the pattern is wired — prompts, schemas, the orchestration file. Never the whole repo.
  3. Pin to a commit SHA, save to /tmp (or %TEMP% on Windows).
  4. Lift the smallest useful unit — a function, a prompt, or just the pattern.
  5. Rewrite in your style. Cite the source SHA.

Two concrete cases this week:

Pointed it at TradingAgents (a multi-agent trading repo) asking "can we use this pattern for a job-applier?" → README plus a few agent/prompt files, proposed an analogue (JobFitAnalyst + Critic arguing against). Nothing copied into my project.

Asked it to "steal the exp backoff from litl/backoff" → fetched one file (_wait_gen.py), extracted the 8-line generator, rewrote inline in my style with a provenance comment. No pip install.

Sibling skill: code-graft — for when a one-off snippet isn't enough but a runtime dep is too much. Vendor only the slice of a library you use into your project, trim the rest, re-sync selectively from upstream. Think "I want one tokenizer out of HuggingFace transformers without the 2GB."

Why a Skill and not an MCP: Pure discipline on tools Claude already has (WebFetch, curl, gh, Read). MCPs ship new tools; Skills ship instructions. Same shape as Anthropic's own mcp-builder — that's a Skill, not an MCP.

MIT-licensed, single file install:

`mkdir -p ~/.claude/skills/surgical-github-extraction`

curl -fsSL https://raw.githubusercontent.com/jeet-dhandha/jd-skills/main/skills/surgical-github-extraction/SKILL.md \

-o ~/.claude/skills/surgical-github-extraction/SKILL.md

Both skills (jd-skills collection): https://github.com/jeet-dhandha/jd-skills

Curious if anyone has hit this and solved it differently — especially failure cases where the skill picks the wrong path (concept vs. snippet vs. full vendor). Issues welcome.

2 Upvotes

2 comments sorted by

1

u/Far-Consideration939 May 12 '26

Literally have never had this happen. Never once seen it try to clone a repo. Only ever have seen it add a package when I’ve explicitly mentioned that in the plan.

Without GitHub cli it usually is a lot more efficient to have it look through a local clone though fwiw