rtk-ai/rtk
Voir sur GitHubFeature: Track invoking agent (Claude, Copilot, Codex, etc) in command analytics
Open
#1 314 ouverte le 14 avr. 2026
area:clieffort-mediumenhancementhelp wantedpriority:medium
Métriques du dépôt
- Stars
- (48 085 stars)
- Métriques de merge PR
- (Merge moyen 11j 1h) (45 PRs mergées en 30 j)
Description
Problem
Currently, RTK tracks command runs and token savings, but does not record which assistant agent (e.g., Claude Code, GitHub Copilot, Codex CLI, Cursor, etc.) triggered each command. This makes it impossible to analyze token savings per console or model, or to understand usage patterns by agent.
Suggested Solution
- Add an
agentoragent_typefield to thecommandstable in the tracking database. - Detect at runtime which agent or tool is executing the command:
- Option 1: Use environment variables (e.g.,
ANTHROPIC_CLAUDE_CODE, VSCode/Cursor session IDs, etc.) - Option 2: Pass agent identifier from CLI or hook (preferred for reliability)
- Option 1: Use environment variables (e.g.,
- Update the tracking code to store this value per command record.
- Extend
rtk gainand JSON/CSV exports to provide breakdowns by agent. - Optionally, add a migration for existing installations.
Motivation
- Helps users understand their RTK savings and usage per console/model/agent.
- Enables fine-grained product analytics, troubleshooting, and filter tuning.
- Useful for users in multi-assistant environments and organizations sharing the same tracking DB.
Prior art
Many analytics platforms distinguish the source of actions. RTK could surface similar insights for tokens and efficiency by agent.
Example output (rtk gain)
By Agent
---------------------------------
Agent Commands Savings
claude-code 88 34,992
codex-cli 41 15,123
opencode 22 5,554
...
Related
src/core/tracking.rs(schema + record fn)- All CLI and hook integrations
This feature would be especially useful for teams and contributors using RTK with multiple LLM coding assistants.