qwqbzmz

Term Rewind — AI skill for Claude Code

AI community

term-rewind 是一款面向终端命令与 AI 编程 Agent 的按次文件快照与选择性撤销工具,采用零第三方依赖的纯 Python 实现.

How to install Term Rewind

This entry records only its repository, not the path inside it, so there is no exact command to give. Open qwqbzmz/term-rewind- and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Term Rewind does

**term-rewind** 是一款面向终端命令与 AI 编程 Agent 的按次文件快照与选择性撤销工具,采用零第三方依赖的纯 Python 实现。在未提交 Git 的本地试错或 Agent 自动改码阶段,它会在命令或工具执行前后保存轻量快照,支持在终端时间线、CLI 或 Windows 桌面端与贴边浮窗中查看 Diff 并精确回滚单个文件。恢复前会自动检测后续改动冲突与路径安全,强制覆盖也会归档当前内容并支持再次撤销。项目内置零依赖 MCP 服务及 Claude Code / Shell 钩子,支持分步归因、并发调用配对以及桌面端实时输出与取消,是与 Git 互补的即时代码安全网。

Alternatives in AI

  • AGENTS.md - Skill Seekers — Concise reference for AI coding agents 11.1k ★
  • Image Use — Use your ChatGPT subscription to generate images from the command line — no OPENAI_API_KEY, no gateway, no dae 373 ★
  • Agentica — One person, a team of agents: CLI, Web, Desktop & Python SDK with multi-session collaboration, persistent memo 359 ★

README

term-rewind

**Ctrl+Z for your terminal and AI coding agents.** Command-scoped filesystem snapshots, colored diffs, and conflict-safe selective undo — with zero external dependencies.

[简体中文说明 (Windows 桌面版 / 浮窗指南)](README.zh-CN.md)


Why `term-rewind`?

Ever ran a script, formatter, or AI agent command without committing first—only to watch it overwrite configs, delete an uncommitted draft, or scatter broken files across your repo?

  • git checkout cannot save uncommitted files you forgot to stage.
  • trash-cli only catches rm, not scripts that overwrite or corrupt existing files in place.
  • LD_PRELOAD-based undo tools break on macOS (SIP) and don't exist on Windows.

`term-rewind` takes fast, content-addressed incremental snapshots of your project directory before and after any command or AI agent task, lets you **inspect the exact diff in a keyboard TUI**, and **selectively undo** individual files without clobbering later edits.


Key Features

  • Zero-dependency & Cross-platform: Pure Python 3.10+ standard library CLI and terminal TUI (termios on macOS/Linux, Virtual Terminal on Windows).
  • Fast Incremental Snapshots: Content-addressed SHA-256 object store with a stat cache (mtime_ns, ctime_ns, size, racy-write guard) so unchanged files aren't re-hashed.
  • Selective & Conflict-Safe Undo: Roll back one file or an entire command. Detects if a file was edited afterwards and stops before overwriting (override with --force).
  • AI Agent & Shell Hooks + Built-in MCP Server: Built-in rewind begin / rewind end task boundaries, ready-to-paste rewind hook snippets for Claude Code, zsh, bash, and PowerShell, plus a zero-dependency stdio MCP server (rewind mcp).
  • Optional Windows Desktop App & Floating Capsule: Includes a zero-dependency Tkinter GUI (app.pyw) and a dockable floating capsule (floating.py) for Windows users.

Quick Start

Install the CLI

# Using uv or pipx