layer
Manage .git/info/exclude so your personal AI files stay out of git — without touching .gitignore.
Developers drop personal context files into repos. API_SPEC.md, BACKEND_GUIDE.md, onboarding-notes.md, custom prompts, architecture docs. Everyone's got different ones. You can't keep adding each person's files to .gitignore. layer hides them locally using git's built-in exclude mechanism. No more bloating your team's .gitignore.
Install
# macOS / Linux
|
# Windows
# From crates.io
Usage
That's it. The files disappear from git status and stay on disk.
Toggle visibility
Editors (Cursor, Claude Code, Codex) respect git exclude rules — so layered files vanish from autocomplete and file pickers too. If you need to reference them while prompting:
History tracking
Layered files are intentionally hidden from Git. That keeps them out of commits, but it also means Git cannot show you when one of those files gets rewritten, deleted, or trimmed.
layer keeps a private shadow history for those files, so you can inspect what changed and restore an earlier version when needed.
layer diff opens an interactive terminal viewer for snapshot history and unsaved changes.

The shadow repo (.layer/) is local to your clone and initializes automatically on first snapshot.
Commands
Layering
| Command | Description |
|---|---|
layer add [files...] |
Exclude files (interactive tree picker if no args) |
layer rm [files...] |
Remove entries (interactive if no args) |
layer ls |
List all managed entries with status |
layer scan |
Auto-detect known AI files and exclude them |
layer status |
Summary of layered, exposed, and discovered files |
layer scan recognizes files from Claude Code, Cursor, Windsurf, Codex, Aider, Copilot, and many others. You can always add any file with layer add <file>.
Visibility
| Command | Description |
|---|---|
layer off [files...] |
Temporarily un-hide entries |
layer on [files...] |
Re-hide disabled entries |
layer why <file> |
Explain why a file is or isn't ignored |
layer doctor |
Find exposed, stale, and redundant entries |
History
| Command | Description |
|---|---|
layer snapshot |
Save current state of layered files |
layer log [file] |
Show change history |
layer diff [file] |
Show changes since last snapshot (TUI in terminal) |
layer blame <file> |
Show per-line history |
layer revert <file> |
Restore file from a previous snapshot |
Maintenance
| Command | Description |
|---|---|
layer clean |
Remove entries for files that no longer exist |
layer clear |
Remove all managed entries |
layer edit |
Open .git/info/exclude in $EDITOR |
Backup
| Command | Description |
|---|---|
layer backup |
Save entries to ~/.layer-backups/ |
layer restore |
Restore from a backup |
Global
| Command | Description |
|---|---|
layer global add |
Add to ~/.config/git/ignore (all repos) |
layer global ls |
List global gitignore entries |
layer global rm |
Remove global entries |
How it works
Git checks ignore rules in this order:
.git/info/exclude— local to this clone, never shared (this is whatlayermanages).gitignore— tracked and shared with the team~/.config/git/ignore— global, applies to all repos
A file must be untracked for ignore rules to apply. If it's already tracked, layer will flag it as "exposed" and tell you how to fix it (git rm --cached).
Terminology
- Layered — in
.git/info/exclude, hidden from git - Exposed — excluded but still tracked (needs
git rm --cached) - Discovered — known AI file on disk, not yet layered
- Stale — entry that no longer matches any file
Development
License
MIT