
Claude Code に Bash(rm・フォーマッタ・コード生成)まで対応する undo を作った
Reddit ユーザーが公開したオープンソースの Claude Code プラグイン claude-time-machine。ツール呼び出しの前後でプロジェクトのスナップショットを取り、/rewind では戻せない Bash 経由のファイル変更も /tm undo で復元できます。

この mod について
投稿が取り上げているのは次の悩みです。エージェントが幻覚を起こして Bash で何かを実行し、まだ push していないローカルの変更を壊すことがあります。しかも /rewind が戻せるのは、ファイルツールで行った編集だけです。
筆者は、ツール呼び出しのたびにプロジェクトのスナップショットを取る小さなプラグインを作りました。/tm undo で、Bash 経由の変更を含めてファイルを復元できます。
- ローカルで動作し、中身は素の git
- トークンを消費しない
- Claude Code 2.1.287 以上、macOS または Linux が必要
- 無料のオープンソースで、ライセンスは MIT
- インストールは README にある 2 つのコマンドだけ
リポジトリ: https://github.com/xzwache/claude-time-machine
インストール
インストール方法は元のソースをご確認ください。
原文 / README
Hey folks, The thing I kept running into: the agent would hallucinate, run something through Bash and break local changes I hadn't pushed yet. /rewind doesn't help there, it only covers edits made with the file tools. I made a small plugin that snapshots the project around every tool call. /tm undo puts the files back, including what was changed through Bash. https://preview.redd.it/vnutp4a6ipth1.png?width=2108&format=png&auto=webp&s=a79747a1fc780553b51e10d516668e6ca798429b It's local, plain git underneath, no tokens. Needs Claude Code 2.1.287+, macOS or Linux. Free and open source (MIT). Install is two commands, they're in the README. Repo: https://github.com/xzwache/claude-time-machine How Claude helped: - Generated most of the code, I set the design and reviewed it. - Claude Code in cloud did a lot of the testing: it wrote the tests and ran them for me Built it with the new Claude Code mods. If you try it, tell me where it breaks. submitted by /u/xzwache [link] [comments]