Skip to content

rtk init -g --uninstall leaves data directory artifacts on disk #1014

@andeart

Description

@andeart

Steps to reproduce

  1. Install RTK globally: rtk init -g
  2. Use RTK for a while (triggers hook warning rate-limiting, builds up tracking data)
  3. Uninstall: rtk init -g --uninstall
  4. Check for leftover files:
    # macOS
    ls ~/Library/Application\ Support/rtk/
    
    # Linux
    ls ~/.local/share/rtk/
    
    # Windows
    dir %LOCALAPPDATA%\rtk
  5. .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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeffort-medium1-2 jours, quelques fichiersenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions