time-machine

Reviewed at commit 2274d09

Caution: Saves tool inputs, the first 2 KB of every tool result and copies of your project files, which can include secrets, to ~/.claude/time-machine outside your project for 14 days.

Agent Time Machine: a branching timeline of tool calls with shadow-git snapshots — inspect, diff, explain test failures, restore, branch, compare, re-run

Made by
YeonwooSung
What we checked

Records every tool call in a numbered timeline and, after each edit or shell command, snapshots your project files into a private git repository under ~/.claude/time-machine. The /tm command shows, diffs, explains test failures, compares runs and, only when you type it with --yes, restores files or re-runs a step. It makes no network calls; prompts are stored only as length and hash unless you turn that on.

Review details

Static review of the source at the pinned commit; not run. Registers session.start (registers the /tm and /tm-pane commands), session.end, turn.start (prompt length and hash; first 200 characters only with recordModelOutput), tool.call (records the call, forwards it unchanged, snapshots after Edit, Write, NotebookEdit, every Bash and any unknown or MCP tool), turn.step (model name, usage, response length and hash; body only with recordModelOutput), command.run for tm and tm-pane, and ui.render for a timeline pane, plus $.ui.status and $.ui.toast. Tool inputs (strings cut at 4 KiB) and result heads (2 KiB) are passed through a best-effort regex secret masker and written as JSONL with $.fs.write under <storeDir>/<projectKey>/sessions/<id>/ (default ~/.claude/time-machine); snapshot file contents are not masked, though gitignored files such as a gitignored .env are excluded. Snapshots use $.process.run to call git with a bare shadow repository (--git-dir, its own index and pinned GIT_* environment, so the project's .git is only read for info/exclude, copied with a fixed sh -c script); it also runs mkdir, find -delete for stale locks inside its store, rm -rf for sessions older than retentionDays (default 14, paths checked with isInside) and git gc --auto, from a detached $.clock.after job once a day ($.store keeps the last prune time). Snapshots turn off when the root is HOME or /, the store is relative or inside the project or plugin, git is missing or the baseline takes over 5 s; every mutating call otherwise pays a git add -A. /tm restore and /tm branch with --yes run git read-tree -u --reset, which overwrites and deletes tracked project files to match the snapshot after taking a safety snapshot, refuse to overwrite ignored files, and append a note to the conversation with $.session.append. /tm rerun re-invokes the recorded tool through $.tool.call (mutating tools need --write); --isolated --yes runs the recorded Bash command with sh -lc in a temporary snapshot copy without a permission prompt. All file-changing or command-running subcommands refuse unless the origin is composer, bridge or sdk (typed by the user). Recording failures are caught and never block a tool call. No fetch, sockets or other network code; no npm dependencies. Tests, README_KR and tsconfig were not reviewed.

What it uses
  • Reads your prompts: yes
  • Sees tool calls: yes
  • Blocks or changes tool calls: no
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: yes
  • Shows something on screen: yes
Hooked events
Made this mod? Add a badge to your README

modsforClaude badge for time-machine

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/time-machine.svg)](https://modsforclaude.com/mods/time-machine/)

← All mods