Agent skill
undo-redo
Use the undo_redo tool to rewind or reapply buffered file changes or inspect diffs without UI navigation. Use when you need to adjust or verify changes in the current session history.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/undo-redo
SKILL.md
Undo/Redo (LLM Tool)
When to use
- You need to roll back or reapply buffered filesystem changes without asking the user to navigate the session tree.
- You need a diff for a specific file across conversation leaves.
- You need a list of all buffered diffs.
Tool actions
undo_redo supports the following actions:
undo: move to the previous leaf and restore files.redo: move to the next leaf and restore files.list_diffs: list all buffered diffs across leaves.diff: show a diff for a specific file.pathis required.leafIdis optional (defaults to the current leaf).
Examples
{"action":"undo"}
{"action":"redo"}
{"action":"list_diffs"}
{"action":"diff","path":"src/index.ts"}
{"action":"diff","leafId":"abcd1234","path":"README.md"}
Important behavior difference vs commands
The tool does not trigger UI navigation and does not rebuild the current turn context. This keeps the current KV cache intact and avoids editor/tree updates. The new leaf and restored files will be applied for the next user prompt when pi rebuilds context. If the user wants immediate UI navigation and context replay, instruct them to use /undo or /redo instead.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?