snap
Infinity Gauntlet for your codebase. Permanently, randomly deletes ~50% of the current project's files via bin/snap, no confirmation, animat
Open source Open in the app JSON README (API)
About
Infinity Gauntlet for your codebase. Permanently, randomly deletes ~50% of the current project's files via bin/snap, no confirmation, animated if the terminal supports it. bin/snapped shows the receipt.
Details
- Kind
- Plugins
- Topic
- Developer tools
- Publisher
- justinbalaguer
- Origin
- gemini
- Category
- ferramentas
- Version
- 0.1.0
- Last push
- 2026-08-24T05:09:25Z
- Repository state
- ativo
- Language
- Shell
- License
- MIT
- Added
- 2026-09-13 00:04:44
- Updated
- 2026-09-13 00:04:44
- Origin id
justinbalaguer/snap
README
# snap ๐งค๐
**The Infinity Gauntlet for your codebase.**
`snap` permanently, randomly deletes half the files in a directory โ instantly,
with no confirmation prompt โ and drops an animated "post-snap" report behind
it. It's a portable shell tool, not a Claude-only trick: any AI coding agent
that can run a shell command can drive it, and so can you.
[](LICENSE)
[](bin/snap)
[](#requirements)
> "Perfectly balanced, as all things should be."
---
## Why
Every dev tool holds your hand. `snap` doesn't. It exists for one reason:
someone typed `/snap` in a chat with an AI coding agent and wanted it to
*actually happen* โ instantly, dramatically, no "are you sure?" standing
between the joke and the payoff. Use it on scratch repos, toy projects, demo
environments, or anywhere you want a very memorable "oops."
## What it does
1. Scans the target directory for candidate files (git-aware: respects
`.gitignore`, always skips `.git` and `node_modules`).
2. Randomly selects ~50% of them (configurable).
3. Deletes them. Permanently. No prompt, no undo.
4. If you're at a real terminal, plays a short dust-dissolve animation as
each file goes.
5. Always writes a receipt (`.snap/log-*.json`) and a self-contained,
animated HTML report (`.snap/report-*.html`) โ the "snap" replayed as a
little purple-and-gold dissolve effect you can open in any browser.
A second command, `snapped`, shows you the aftermath on demand โ because
`snap` itself stays completely silent.
## Install
### The one-line way: just ask your AI
This is the whole point. Open Claude Code, Codex CLI, Gemini CLI, or Google
Antigravity, and paste:
```
Install the snap skill from https://github.com/justinbalaguer/snap so I can use /snap
```
Your agent clones the repo, runs `install.sh`, and tells you when it's
ready. `/snap` and `/snapped` show up as real slash commands next time it
loads its command list โ but the agent already has `bin/snap` available the
moment it finishes installing, so you can just say "snap this" right away
without waiting on that.
### Manual install
```sh
git clone https://github.com/justinbalaguer/snap.git
cd snap
./install.sh
```
This symlinks `snap` and `snapped` onto your `PATH`
(`~/.local/bin/{snap,snapped}`) and, for Claude Code, copies `commands/` and
`skills/snap/` into `~/.claude/` so `/snap`/`/snapped` work there directly.
### Per-agent notes
**Claude Code** โ `install.sh` wires up `/snap` and `/snapped` automatically.
**Gemini CLI** โ this repo is also a Gemini extension
(`gemini-extension.json`):
```sh
gemini extensions install /path/to/snap
```
*(or just run Gemini CLI from a project with this repo cloned in โ
`GEMINI.md` loads as context either way. Extension command syntax may vary
by Gemini CLI version โ see `gemini extensions --help`.)*
**Codex / Google Antigravity / any `AGENTS.md`-reading agent** โ these read
`AGENTS.md` from the project root automatically, no install step. Clone
this repo as a subfolder of your project, or copy `AGENTS.md`'s contents
into your own project's `AGENTS.md`.
**Any other AI agent** โ if it can run shell commands, it can use `snap`.
No integration required: just ask it to run `snap` (or `snapped`) โ that's
the entire tool, everything else in this repo is just glue.
## Usage
```sh
snap # vaporize ~50% of files in the current directory
snap ./some/project # target a specific directory
snap --percent 30 # vaporize a different fraction
snap --dry-run # preview victims โ the only non-destructive mode
snapped # show the receipt of the most recent snap
snapped --list # show every past snap in this project
```
In any AI coding agent with this plugin/skill installed (Claude Code, Codex
CLI, Gemini CLI, Google Antigravity, or anything reading `AGENTS.md`), just
type `/snap` or ask it to "snap this project."
### Example
```
$ snap --dry-run
f9.txt
.gitignore
f3.txt
f2.txt
f7.txt
--- dry run: 5/10 files would be vaporized in /path/to/project (nothing deleted) ---
$ snap
โต f9.txt dissolves...
โต .gitignore dissolves...
โต f3.txt dissolves...
โต f2.txt dissolves...
โต f7.txt dissolves...
Perfectly balanced, as all things should be.
5/10 files vaporized.
$ snapped
Last snap: 20260101T000000Z
Target: /path/to/project
5/10 files vaporized.
"Perfectly balanced, as all things should be."
Victims:
- f9.txt
- .gitignore
- f3.txt
- f2.txt
- f7.txt
```
## Works with any AI coding agent
`snap` and `snapped` are plain bash โ the deletion logic lives entirely in
those two scripts, not in any agent-specific integration. This repo ships
thin glue for each platform's conventions on top of that shared engine:
| Platform | Integration |
|---|---|
| Claude Code | `.claude-plugin/plugin.json`, `commands/`, `skills/snap/SKILL.md` |
| Gemini CLI | `GEMINI.md`, `gemini-extension.json` |
| Codex / Google Antigravity / generic agents | `AGENTS.md` |
| Any shell, any human | `bin/snap`, `bin/snapped` directly |
## โ ๏ธ Safety
**This tool permanently deletes files. There is no `unsnap`, no vault, no
undo.** That's deliberate, not an oversight โ it's supposed to feel like the
real thing.
Built-in guardrails cover the obviously catastrophic and nothing more:
- Refuses to run against `$HOME`, `/`, or any path shallower than 2 segments.
- Inside a git repo, only ever touches tracked or non-ignored files โ
`.gitignore` is respected automatically.
- Always skips `.git`, `node_modules`, and its own `.snap/` receipts.
Everything else is fair game the moment you run it. Use `snap` on
repos you've already committed and are fine `git reset --hard`-ing back
from, on throwaway scratch directories, or on projects you're deliberately
willing to lose half of. Don't run it somewhere you can't afford that.
## Requirements
- `bash`
- `git` *(optional, recommended โ enables `.gitignore`-aware selection)*
- `shuf` *(GNU coreutils; on macOS, `brew install coreutils`)*
## Uninstall
**The engine** โ `install.sh` only touches your `PATH` and, if present,
`~/.claude/`:
```sh
rm ~/.local/bin/snap ~/.local/bin/snapped
rm ~/.claude/commands/snap.toml ~/.claude/commands/snapped.toml
rm ~/.claude/skills/snap
```
**Gemini CLI** โ if installed as an extension:
```sh
gemini extensions uninstall snap
```
**Codex / `AGENTS.md`-reading agents** โ nothing was installed globally;
just remove `AGENTS.md` (or the `snap` section of it) from your project.
**Everywhere else** โ delete the cloned repo directory. Nothing this tool
ships lives outside `~/.local/bin`, `~/.claude/`, your Gemini extensions,
and the repo itself.
## Contributing
Issues and PRs welcome โ especially for wider platform coverage
(`.cursor/`, `.windsurf/`, `.clinerules/` integrations), portability fixes,
or new Thanos quotes for the animation.
## License
[MIT](LICENSE) โ do whatever you want with it.
---
<sub>An AI wrote this repo. "Fine, I'll do it myself." โ Thanos, probably.</sub>