Install
$ agentstack add skill-codeshux-tokenwise-undo ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
/tokenwise:undo — Restore from backup
Find TokenWise backups and restore one.
Steps
- Find backups with Bash:
``bash find ~/.claude -maxdepth 3 -name "*.tokenwise-backup-*" 2>/dev/null find . -maxdepth 3 -name "*.tokenwise-backup-*" 2>/dev/null ``
- If none found:
``` No TokenWise backups found.
Backups are created automatically by /tokenwise:install before any file modification. If you've never run /tokenwise:install, there's nothing to undo.
If you removed the backups manually, you'll need to restore from version control or recreate config by hand. ```
- If found, print a numbered list:
``` TokenWise backups found:
- ~/.claude/CLAUDE.md.tokenwise-backup-20260511-143218
(target: ~/.claude/CLAUDE.md, created )
- ~/.claude/settings.json.tokenwise-backup-20260511-143219
(target: ~/.claude/settings.json, created )
Restore which? (1-N, or 'all', or 'cancel'): ```
- Parse user response:
- Single number → restore that one
all→ restore all backupscancel(or empty) → exit withNo changes made.
- For each backup to restore:
- Derive target path: strip the
.tokenwise-backup-suffix - Confirm:
Restore from ? This will overwrite . [Y/n] - If Y:
- Read current target file (if exists), back it up to
.tokenwise-pre-undo-(so undo is reversible) - Copy backup over target:
cp - Verify by reading target — confirm content matches backup
- If n: skip
- Optionally delete the consumed backup:
Delete the backup file now that it has been restored? [Y/n]
- Print summary:
``` Undo complete.
Restored:
Pre-undo backups (in case you want to redo):
```
- Remind user: "Restart Claude Code so the original CLAUDE.md / settings.json take effect."
Edge cases
- Multiple backups for the same target file: the user should pick which one. Print them sorted by timestamp descending (newest first).
- Backup file is empty: warn before restoring (
Backup is empty. Restoring will leave empty. Continue?). - Target file no longer exists: that's fine — restore creates it.
Tools
Read, Write, Bash.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: CodeShuX
- Source: CodeShuX/tokenwise
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.