rtk-ai/rtk · error · anyhow::Error
Uninstall only works with --global flag. For local projects,
Error message
Uninstall only works with --global flag. For local projects, manually remove RTK from CLAUDE.md
What it means
Global uninstall removes RTK hooks from ~/.claude and the global CLAUDE.md; RTK intentionally ships no uninstaller for per-project CLAUDE.md edits because that file is user-owned. Run without --global (and after the codex/cursor/pi special cases return early), it bails and points at the manual path.
Source
Thrown at src/hooks/init.rs:692
if !dry_run {
println!("\nRestart Cursor to apply changes.");
}
} else {
println!("RTK Cursor support was not installed (nothing to remove)");
}
if dry_run {
print_dry_run_footer();
}
return Ok(());
}
if pi {
uninstall_pi(global, ctx)?;
return Ok(());
}
if !global {
anyhow::bail!("Uninstall only works with --global flag. For local projects, manually remove RTK from CLAUDE.md");
}
let claude_dir = resolve_claude_dir()?;
let mut removed = Vec::new();
// Also uninstall Gemini artifacts if --gemini or always (clean everything)
if gemini {
let gemini_removed = uninstall_gemini(ctx)?;
removed.extend(gemini_removed);
if !removed.is_empty() {
let header = if dry_run {
"[dry-run] would uninstall RTK (Gemini):"
} else {
"RTK uninstalled (Gemini):"
};
println!("{}", header);
for item in &removed {
println!(" - {}", item);View on GitHub (pinned to d977e1c316)
Solutions
- Remove the RTK block (between the rtk-instructions markers) and the '@RTK.md' reference from ./CLAUDE.md by hand, plus any local .claude/settings.json hooks rtk added
- Run `rtk uninstall --global` if the goal was cleaning the machine-wide install
- Commit the CLAUDE.md removal so teammates' copies are cleaned too
Example fix
# error path rtk uninstall # bails: global-only # what a project cleanup actually needs edit ./CLAUDE.md # delete the rtk-instructions block and '@RTK.md' line rtk uninstall --global # only if you also meant the global install
Defensive patterns
Strategy: validation
Validate before calling
# bash: decide intent before running uninstall
# project cleanup → manual edit; machine cleanup → --global
[ "$SCOPE" = project ] && { echo 'edit ./CLAUDE.md manually'; exit 0; }
rtk uninstall --global Prevention
- Keep RTK blocks in CLAUDE.md inside reviewable commits so manual removal is a git revert
- Document in the team README that project uninstall is manual by design
- Note which local artifacts a local init creates (CLAUDE.md block, @RTK.md ref, .claude/settings.json hooks) so the manual cleanup is complete
When it happens
Trigger: `rtk uninstall` with no `--global` flag — src/hooks/init.rs:694.
Common situations: Trying to undo a local `rtk init` in a repo after abandoning RTK; expecting uninstall to be symmetric with every install mode.
Related errors
- --codex cannot be combined with --claude-md
- Cursor uninstall only works with --global flag
- Uninstall only works with --global flag. For local projects,
- dotnet: no subcommand specified
- gt: no subcommand specified
AI-assisted analysis of rtk-ai/rtk@d977e1c316 (2026-08-16).
Data as JSON: /api/errors/1964c14bdd5a8ddf.
Report an issue: GitHub.