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
agent or agent_type field to the commands table 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)
- Update the tracking code to store this value per command record.
- Extend
rtk gain and 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.
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
agentoragent_typefield to thecommandstable in the tracking database.ANTHROPIC_CLAUDE_CODE, VSCode/Cursor session IDs, etc.)rtk gainand JSON/CSV exports to provide breakdowns by agent.Motivation
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)
Related
src/core/tracking.rs(schema + record fn)This feature would be especially useful for teams and contributors using RTK with multiple LLM coding assistants.