tapeback
v1.0.2
Published
Like rewinding a tape ποΈ β tapeback automatically records every Claude Code agent action that changes your codebase, so you can rewind to any moment in your session.
Maintainers
Readme
tapeback ποΈ
Like rewinding a tape β tapeback automatically records every Claude Code agent action that changes your codebase, so you can rewind to any moment in your session.
The problem
Claude Code agents are powerful but imperfect. A single bad message can silently overwrite hours of work across multiple files β with no native undo beyond manual git gymnastics.
tapeback is the rewind button.
Every time Claude edits a file, tapeback automatically commits the codebase state with a [REC] tag. When something goes wrong, one command puts you back where you were.
Install
# Add to your current project
npx tapeback init
# Or install globally for all projects
npx tapeback init --globalThat's it. No global install required. tapeback wires itself into Claude Code's hook system and starts recording immediately.
Uninstall
From the current project:
# Remove hook, commands, and scripts
rm -f .claude/hooks/post-tool-use.sh
rm -f .claude/commands/tapeback.md .claude/commands/squash.md .claude/commands/reel.md
rm -f .claude/src/generate-headline.js .claude/src/commit-message.js \
.claude/src/git-graph.js .claude/src/generate-reel.jsThen open .claude/settings.json and remove the PostToolUse hook entry for tapeback.
Global uninstall (~/.claude/):
rm -f ~/.claude/hooks/post-tool-use.sh
rm -f ~/.claude/commands/tapeback.md ~/.claude/commands/squash.md ~/.claude/commands/reel.md
rm -f ~/.claude/src/generate-headline.js ~/.claude/src/commit-message.js \
~/.claude/src/git-graph.js ~/.claude/src/generate-reel.jsThen remove the hook entry from ~/.claude/settings.json.
Commands
/tapeback β rewind to any recording
/tapeback # undo the last recording
/tapeback 3 # undo the last 3 recordings
/tapeback --to <hash> # rewind to a specific commit
/tapeback --to "14:30" # rewind to nearest recording before a timetapeback will show you exactly what will change and ask for confirmation before touching anything. If you have uncommitted work, it'll ask whether to stash or abandon it first.
/squash β clean history before a PR
/squashSquashes every commit from the first [REC] to the last [REC] β the squash zone β into a single conventional commit. Manual commits inside that range are squashed in too; commits before the first [REC] or after the last [REC] are left untouched.
Shows a summary of everything in the zone, prompts for your final commit message, and creates a backup tag before touching anything.
/reel β interactive git graph
/reelRenders a self-contained HTML git graph and opens it in your browser. Commits appear as coloured dots (blue = feature, green = base, red = [REC], yellow = diverge point). Hover any dot for full commit details.
How it works
tapeback uses Claude Code's PostToolUse hook to fire after every Write, Edit, or MultiEdit tool call.
Claude edits file(s)
β
PostToolUse fires
β
Any tracked files changed? ββNoβββ exit (silent)
β Yes
git add -A
β
Generate headline (claude -p with 5s timeout β deterministic fallback)
β
git commit "chore(tapeback): <headline> [REC]"
β
exit 0 β always, never blocks ClaudeEach recording looks like this in git log:
chore(tapeback): add JWT middleware [REC]
Agent message: "add JWT authentication to the API"
Changed files:
src/auth/jwt.py (+42 -3)
tests/test_auth.py (+18 -0)
Timestamp: 2026-02-18T14:32:07Z
Session: abc123Configuration
tapeback reads .tapeback.json from your project root:
{
"messageStyle": "ai",
"aiTimeoutMs": 5000,
"squashBaseRef": "main",
"recTag": "[REC]",
"ignore": ["*.env", "*.log", ".tapeback.json"],
"sessionTag": true
}| Option | Default | Description |
|---|---|---|
| messageStyle | "ai" | "ai" uses claude -p to generate a headline; "deterministic" uses filenames |
| aiTimeoutMs | 5000 | Hard timeout (ms) before falling back to deterministic headline |
| squashBaseRef | "main" | Branch that /squash measures divergence from |
| recTag | "[REC]" | Identifier tag in every recording's commit subject |
| ignore | ["*.env","*.log"] | Glob patterns to never stage or commit |
| sessionTag | true | Include Claude session ID in commit body |
Requirements
- macOS / Linux (POSIX shell required β Windows not supported in v1)
- git β₯ 2.23
- Node.js β₯ 18
- Claude Code with hooks support
Privacy & security
tapeback is a pure git workflow layer β it stores no credentials, sends no data to external servers, and reads nothing from your codebase beyond what git already tracks.
- No API keys or tokens β tapeback never requests, stores, or transmits any credentials
- No network calls β the hook is offline; it runs entirely in your local git repo
- No data collection β nothing leaves your machine except the optional
claude -pheadline call, which goes through your existing Claude Code session (the same one already running) - Open source β the full hook and command logic is readable in
plugin/hooks/post-tool-use.shandplugin/commands/
tapeback is a thin wrapper that adds git discipline on top of what Claude Code already does. It maximises Claude's usefulness without adding any new trust surface.
Safety guarantees
- The hook always exits 0 β it can never block or crash your Claude session
- The hook has a 5-second hard timeout on AI message generation
/squashalways creates a backup tag before any git mutation β your session is always recoverable/tapebackalways previews what will change and asks for confirmation/reelis read-only β it never modifies git history or files
Repository structure
tapeback/
βββ .claude-plugin # Plugin manifest for Claude Code registry
βββ package.json
βββ bin/
β βββ tapeback.js # CLI entrypoint (npx tapeback init)
βββ plugin/
β βββ hooks/
β β βββ post-tool-use.sh # Core auto-record hook
β βββ commands/
β β βββ tapeback.md # /tapeback slash command
β β βββ squash.md # /squash slash command
β β βββ reel.md # /reel slash command
β βββ settings.json # Hook wiring for Claude Code
βββ src/
β βββ commit-message.js # Headline generation module
β βββ generate-headline.js # CLI wrapper for the hook
β βββ git-graph.js # Git graph data builder
β βββ generate-reel.js # HTML graph renderer for /reel
βββ test/
β βββ hook.test.sh
β βββ tapeback.test.sh
β βββ squash.test.sh
β βββ reel.test.sh
β βββ commands.test.js
βββ .tapeback.json # Default config (copied on init)Contributing
See CONTRIBUTING.md.
License
MIT
