sparse-checkoutlisted
Install: claude install-skill mthli/skills
# sparse-checkout
Locally hide files and directories that teammates committed, without modifying any tracked file. The exclusion lives in `.git/info/sparse-checkout`, which is per-clone state — your teammates never see it, and `git push` cannot carry it.
## When to use
- Teammates committed personal config / generated output that you don't want in your tree (e.g. `.claude/`, `dist/`, `vendor/`)
- You want a private exclusion without proposing a `.gitignore` change to the team
- The user asks to restore a previously hidden path, or to see what's currently hidden
- The user wants to undo all local hiding
## Mental model
Behind the scenes this uses `git sparse-checkout` in **non-cone mode**, which accepts gitignore-style patterns. A typical patterns file looks like:
```
/*
!.claude/
!docs/private/
```
Read as: "include everything at the root, except `.claude/` and `docs/private/`." The patterns file is `.git/info/sparse-checkout`; it lives inside `.git/`, so it's never pushed and never affects anyone else.
`git sparse-checkout disable` blows the whole thing away and the clone behaves like a normal one again.
## Operations
Use the helper script `scripts/sparse_checkout.py` (relative to this SKILL.md). Resolve its absolute path and run it from anywhere inside the target repo — the script discovers the repo root itself, and path arguments are interpreted relative to that root (not your cwd).
| Goal | Command |
|---|---|
| Hide one or more paths | `python <skill-dir>/scri