Files
rtk-ai__rtk/docs/guide/analytics/discover.md
Florian BRUNIAUX 4c9b528206 docs: Adrien review — hierarchy, counts, consistency, gaps
Hierarchy:
- Move troubleshooting.md and what-rtk-covers.md to guide/resources/
- Add guide/resources/telemetry.md (adapted from docs/TELEMETRY.md,
  user-facing: consent, opt-out, GDPR rights — without internal sections)

Content fixes:
- Remove all hardcoded counts (9 ecosystems, 12 agents, 60+, 7 more)
  replaced with qualitative language throughout
- Unify DB filename: tracking.db → history.db everywhere
  (canonical: src/core/constants.rs HISTORY_DB)
- installation.md: replace bare `cargo install rtk` with warning +
  explicit git URL to avoid Rust Type Kit name collision
- supported-agents.md: remove hardcoded agent count
- quick-start.md: remove hardcoded ecosystem list, link to what-rtk-covers

New content:
- gain.md: add --quota section explaining pro/5x/20x tier meanings
- gain.md: add callout linking to discover.md (find missed savings)
- index.md: add "Analyze your usage" section (rtk discover, rtk session)
- configuration.md: clarify ignore_dirs/ignore_files scope, add prose
  link to telemetry.md
- what-rtk-covers.md: clarify --ultra-compact vs git -u short flag conflict

Cross-references:
- All internal links updated for new resources/ paths
- index.md: link to troubleshooting, telemetry, what-rtk-covers, analytics
- discover.md: updated relative link to troubleshooting

README:
- Add Core team section (Patrick Szymkowiak, Florian Bruniaux, Adrien Eppling)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 14:17:58 +02:00

59 lines
2.2 KiB
Markdown

---
title: Discover and Session
description: Find missed savings opportunities with rtk discover, and track RTK adoption with rtk session
sidebar:
order: 2
---
# Discover and Session
## rtk discover — find missed savings
`rtk discover` analyzes your Claude Code command history to identify commands that ran without RTK filtering and calculates how many tokens you lost.
```bash
rtk discover # analyze current project history
rtk discover --all # all projects
rtk discover --all --since 7 # last 7 days, all projects
```
**Example output:**
```
Missed savings analysis (last 7 days)
────────────────────────────────────
Command Count Est. lost
cargo test 12 ~48,000 tokens
git log 8 ~12,000 tokens
pnpm list 3 ~6,000 tokens
────────────────────────────────────
Total missed: 23 ~66,000 tokens
Run `rtk init --global` to capture these automatically.
```
If commands appear in the missed list after installing RTK, it usually means the hook isn't active for that agent. See [Troubleshooting](../resources/troubleshooting.md) — "Agent not using RTK".
## rtk session — adoption tracking
`rtk session` shows RTK adoption across recent Claude Code sessions: how many shell commands ran through RTK vs. raw.
```bash
rtk session
```
**Example output:**
```
Recent sessions (last 10)
─────────────────────────────────────────────────────
Session Total RTK Coverage
2026-04-06 14:32 (45 cmds) 45 43 95.6%
2026-04-05 09:14 (38 cmds) 38 38 100.0%
2026-04-04 16:50 (52 cmds) 52 49 94.2%
─────────────────────────────────────────────────────
Average coverage: 96.6%
```
Low coverage on a session usually means RTK was disabled (`RTK_DISABLED=1`) or the hook wasn't active for a specific subagent.