🐕🦺 restory
restory records everything your AI coding agent touches, blocks the dangerous stuff, and restores your tree with one command. Local-only.
pip install restory && restory init
Why this exists
AI coding agents (Claude Code, Cursor, Copilot) run as you — with your files, your keys, your shell. A single hallucination or a poisoned file in a repo can rm -rf your home dir or POST your .env to a pastebin. Allowlists don't catch it (CVE-2026-22708), and a container is too heavy for the inner loop.
restory sits between the agent and your machine: it inspects the effect of every command before it runs, records the whole session, and restores it with one keystroke.
What it does
- 🛑 Blocks dangerous effects — secret reads, network exfiltration, mass deletes, git-history nukes, writes outside the repo — before they execute.
- 📼 Records everything — a live, local timeline of every file your agent touched and every command it ran.
- ↩️ One-command restore —
restory undo --sessionsnaps your whole working tree back to where the session started. - 🔒 Local-only — no accounts, no cloud, nothing leaves your machine.
Commands
| Command | What it does |
|---|---|
restory init |
Install hooks into your agent — Claude Code by default (.claude/settings.json), or --agent gemini for Gemini CLI (.gemini/settings.json) |
restory open |
Open the live blast-radius timeline in your browser |
restory monitor |
Live full-screen terminal dashboard — the TUI counterpart to open (q quit, u undo, c clear) |
restory report |
Print a terminal summary of the session (add --json for machine output) |
restory status |
Quick health check: is the session armed, shadow ready, UI built? |
restory diff |
Show what the agent changed since the session started (--stat, --name-only) |
restory export |
Export the session as a shareable report (--format md/json/html) |
restory undo --session |
Snap your whole working tree back to where the session started |
Install
pip install restory
restory init # installs hooks for Claude Code (.claude/settings.json)
restory init --agent gemini # or for Gemini CLI (.gemini/settings.json)
restory open # opens the live timeline at http://127.0.0.1:8765
Works on Windows, macOS, and Linux. Hook-based — no kernel driver, no container.
What restory does NOT do
Being honest, because security tools that overpromise get torn apart:
- It's not a sandbox. A determined attacker with code execution can bypass any command inspection — "argument inspection is theater." restory is defense-in-depth + visibility + instant restore, not a kernel jail.
- It won't catch every obfuscation. It nails the common, high-value danger classes (exfil, mass-delete, secret reads, pipe-to-shell). Novel encodings can slip the classifier — that's what the restore net is for.
- It doesn't replace your judgment. It surfaces what the agent tried and lets you reverse it. You're still the human in the loop.
How it works
restory init installs pre/post tool-use and session-start hooks for your agent (PreToolUse / PostToolUse on Claude Code, the equivalent BeforeTool / AfterTool on Gemini CLI). A thin adapter layer normalizes each agent's hook payload into one canonical shape and formats the decision each agent expects, so the classifier, store, and snapshot logic are shared unchanged across agents. Every tool call the agent makes is classified for blast radius; dangerous effects are blocked with a reason, everything is logged to a local SQLite store, and the working tree is snapshotted to a shadow git repo so undo is exact.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file restory-1.0.1.tar.gz.
File metadata
- Download URL: restory-1.0.1.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cacdacf1f3cd8441606fd04b6f09556298ba71db53634c7f124bd8876a2ffbc5
|
|
| MD5 |
1151ae586f36c0e1b36d724de9f7884a
|
|
| BLAKE2b-256 |
794c044f9b6ddc35494c932798a7a5172ef32f3d3133df3a94eab34da4749d05
|
File details
Details for the file restory-1.0.1-py3-none-any.whl.
File metadata
- Download URL: restory-1.0.1-py3-none-any.whl
- Upload date:
- Size: 60.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d26a29f87c73d764c7f7811bc6f242a61e4478d6a3da9324349a01610b2ea55
|
|
| MD5 |
f7209b3e4a56a48ba9aa1ded6f039a8f
|
|
| BLAKE2b-256 |
b7dc459e52f53845ca1103abd8c484abc0e37b2f7dc945591ab0566f765d4553
|