Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for Time Machine

Inspiration

I code with Claude Code every day. One night it "cleaned up" a working feature and I spent hours finding the last good version. Undo exists for text, not for an agent's twenty file edits and a shell command. I wanted an undo button that proves it worked.

What it does

Saves the project before the agent acts (Claude Code hooks before each prompt and before risky commands like rm -rf, git reset --hard, DROP TABLE). Runs your own tests on each save point in a separate Git worktree. Recovers the newest passing one to a new branch tm/recover/cp-XXXX — your folder and branch are never touched, nothing is pushed or deployed. Every result lists what was not restored (secrets, databases, deployed services).

How it's built

TypeScript pnpm monorepo on Node ≥22: the tm CLI (init, checkpoint, timeline, diff, verify, find-good, recover, hook install, mcp), an MCP server with 7 tools so agents can call it themselves, a store in ~/.timemachine with git bundles and signed verdicts, five verdict types with exit codes (PASS/FAIL/INCOMPLETE/BLOCKED/ERROR), and network-deny sandboxing (sandbox-exec / bwrap / unshare) for test runs. Vitest suite in CI on macOS and Linux (README).

Challenges I ran into

Isolating test runs without touching the user's working tree; deciding what "passing" means when tests are flaky or missing (INCOMPLETE vs FAIL); being honest about what can't be rolled back.

Accomplishments that I'm proud of

A recovery that verifies itself instead of guessing; a README-documented end-to-end run on a real open-source repo (sindresorhus/slugify) from init to verified recovery branch.

What I learned

Git internals (worktrees, bundles), process sandboxing across macOS/Linux, designing CLIs with machine-readable exit codes, building an MCP server, writing a large automated test suite solo, and threat-modeling an AI agent's destructive actions.

What's next

Signed Mac app (Rewind dial), npm release, connectors so agent actions in Gmail/Slack/Notion get the same "what wasn't restored" honesty.

Time Machine was built during Next Byte Hacks V5: the first commit to github.com/ShadowEsu/Time-Machine was on Oct 13, 2026, inside the Oct 6–31 window, and it has not been submitted to any other hackathon.

Built With

Share this project:

Updates

Submission history