rewindex
v0.1.1
Published
git-free /undo for OpenAI Codex CLI — automatic shadow-git snapshots before every file-mutating tool call, restore with one command. Never touches your project's git history.
Maintainers
Readme
rewindex
File-level rewind for OpenAI Codex CLI, including projects that do not use Git.
Codex can rewind a conversation, but that does not restore files already written to disk. rewindex takes automatic snapshots in an isolated shadow Git repository and lets you return the working tree to the state before an earlier prompt.
It never reads or modifies your project's own Git repository.
Install
npm install --global rewindex
rewindex installOpen Codex in an unimportant folder, run /hooks, and trust the two rewindex hooks. Codex requires this explicit review before third-party hooks can run.
Use inside Codex
$rewindex list
$rewindex diff 3
$rewindex restore 3
$rewindex undolist shows the newest 50 prompt checkpoints:
1. dcdf6bb9f1 3 dk önce
1 değişen · 0 eklenen · 0 silinen
Prompt: README dosyasını yeni kurulum adımlarıyla güncelle.
Özet: README.md önceki haline döner.The visible number is a convenient selector for the current list. The hash is a stable selector that remains valid if newer prompts change the numbering.
Restore always shows a diff first and asks for confirmation. Before changing files, it takes a safety snapshot; $rewindex undo restores that pre-restore state.
Direct CLI
The same operations are available outside Codex:
rewindex list
rewindex diff 3
rewindex restore 3
rewindex restore --undo
rewindex gcAdd -C <directory> to target another project and -y to skip restore confirmation in scripts.
How it works
UserPromptSubmitrecords the state before each prompt.PreToolUseprovides extra safety checkpoints before shell and file tools.- Snapshots are stored in
~/.rewindex/<project-hash>/, withGIT_DIRisolated from the project. - Prompt history is presented as cumulative rewind points: restoring item 4 undoes that prompt and every newer file change.
Tracked, untracked, and Git-ignored files are captured by default. Common build directories and files larger than 16 MiB are excluded.
Configuration
Optional ~/.rewindex/config.json:
{
"exclude": [".git", "node_modules", "dist", "build"],
"maxFileBytes": 16777216,
"retentionDays": 7,
"retentionBytes": 524288000,
"captureIgnored": true
}Security
Because Git-ignored files are captured by default, local snapshots may contain .env files, credentials, or other secrets. They remain unencrypted on the same machine under ~/.rewindex/ and are never added to the project repository.
Set "captureIgnored": false or add sensitive paths to exclude when local secret snapshots are not acceptable.
Limits
- Rewinds files, not the Codex conversation. Use Codex's conversation controls separately.
- Cannot undo external effects such as database writes, network calls, or files changed outside the project.
- Does not currently support Windows.
- Cannot observe tools that bypass Codex hooks.
Uninstall
rewindex uninstall
npm uninstall --global rewindexrewindex uninstall removes only hook entries owned by rewindex.
License
MIT © 2026 Zenonix Studio
