claude-code
claude-code copied to clipboard
[FEATURE] Add filtering options to /release-notes command to reduce token usage
Summary
The /release-notes command currently displays the complete version history from v0.2.21 to the latest version, which results in significant token waste and poor user experience in most use cases.
Current Behavior
When running /release-notes, the command outputs:
- All versions from 0.2.21 to present (~100+ versions)
- Estimated token consumption: 5,000-15,000 tokens per invocation
- Users must scroll through extensive output to find recent updates
Problem
Token Waste Analysis:
| User Scenario | Useful Information | Wasted Tokens | Waste Ratio |
|---|---|---|---|
| Want to see last 3 versions | ~300 tokens | ~14,700 tokens | 98% |
| Want to see last 10 versions | ~1,000 tokens | ~14,000 tokens | 93% |
| Need complete history | ~15,000 tokens | 0 tokens | 0% |
Impact:
- 💰 Cost: Each invocation wastes $0.003-0.045 (based on Sonnet pricing)
- 📊 Context window: Consumes 7-15% of available context (assuming 200k window)
- 😫 UX: Difficult to quickly find recent updates
- ⏱️ Performance: Longer loading times
Proposed Solution
Add filtering options similar to other CLI tools:
/release-notes # Default: show last 5 versions
/release-notes --last 10 # Show last 10 versions
/release-notes --all # Show complete history
/release-notes --since 2.1.0 # Show versions after 2.1.0
Alternative Approach
Make the command interactive:
- First show version list summary
- Allow user to select specific versions to expand
Benefits
- ✅ 90%+ reduction in token usage for typical use cases
- ✅ Better UX: Users can quickly see what's new
- ✅ Cost savings: Especially important for API users
- ✅ Backwards compatible:
--allflag preserves current behavior - ✅ Flexibility: Users choose the level of detail they need
Related Context
This issue was identified while analyzing token consumption patterns in Claude Code. Similar commands in other tools (e.g., git log, npm changelog) default to showing recent entries with options to expand.
Environment
- Claude Code version: 2.1.12
- Platform: Linux (WSL2)
Note: No existing issues found addressing this specific UX/token optimization for the /release-notes command.