Steps to reproduce
- Install RTK globally:
rtk init -g
- Use RTK for a while (triggers hook warning rate-limiting, builds up tracking data)
- Uninstall:
rtk init -g --uninstall
- Check for leftover files:
# macOS
ls ~/Library/Application\ Support/rtk/
# Linux
ls ~/.local/share/rtk/
# Windows
dir %LOCALAPPDATA%\rtk
.hook_warn_last, history.db, tee/, telemetry state, and trusted_filters.json all remain on disk
Root cause
uninstall() in src/hooks/init.rs removes Claude/Gemini/Codex/Cursor/OpenCode integration artifacts (hooks, RTK.md, settings.json entries), but never touches the RTK data directory (dirs::data_local_dir()/rtk/).
That directory accumulates runtime state from several modules:
src/hooks/hook_check.rs - .hook_warn_last (warn rate-limit marker)
src/core/tracking.rs - history.db (token savings database)
src/core/tee.rs - tee/ subdirectory (raw output recovery)
src/core/telemetry.rs - telemetry state
src/hooks/trust.rs - trusted_filters.json
None of these paths are referenced in the uninstall flow.
Expected behavior
rtk init -g --uninstall should return the machine to a clean pre-RTK state. Uninstalling should comprehensively remove all RTK-owned artifacts - both integration hooks and runtime data. Leaving behind files that require manual discovery and removal undermines trust in the uninstall contract.
The data directory contains only RTK-internal state (rate-limit markers, tee cache, telemetry, trust lists) with one exception: history.db holds token savings data a user may want to export via rtk gain --history before removal. A prompt or a printed note before deleting would address that gracefully.
Steps to reproduce
rtk init -grtk init -g --uninstall.hook_warn_last,history.db,tee/, telemetry state, andtrusted_filters.jsonall remain on diskRoot cause
uninstall()insrc/hooks/init.rsremoves Claude/Gemini/Codex/Cursor/OpenCode integration artifacts (hooks, RTK.md, settings.json entries), but never touches the RTK data directory (dirs::data_local_dir()/rtk/).That directory accumulates runtime state from several modules:
src/hooks/hook_check.rs-.hook_warn_last(warn rate-limit marker)src/core/tracking.rs-history.db(token savings database)src/core/tee.rs-tee/subdirectory (raw output recovery)src/core/telemetry.rs- telemetry statesrc/hooks/trust.rs-trusted_filters.jsonNone of these paths are referenced in the uninstall flow.
Expected behavior
rtk init -g --uninstallshould return the machine to a clean pre-RTK state. Uninstalling should comprehensively remove all RTK-owned artifacts - both integration hooks and runtime data. Leaving behind files that require manual discovery and removal undermines trust in the uninstall contract.The data directory contains only RTK-internal state (rate-limit markers, tee cache, telemetry, trust lists) with one exception:
history.dbholds token savings data a user may want to export viartk gain --historybefore removal. A prompt or a printed note before deleting would address that gracefully.