Agent skill
managing-cache-and-optimization
Use when managing Shannon CLI performance and costs - check cache statistics, clear stale entries, set budgets, understand automatic model selection and cost optimization
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/managing-cache-and-optimization
SKILL.md
Managing Cache and Optimization
Overview
Shannon CLI provides automatic caching and cost optimization across all operations.
Cache Management
Check statistics:
shannon cache stats
Shows: Hit rate, size, savings (USD and time)
Clear cache:
shannon cache clear # All caches
shannon cache clear --type analysis # Just analysis cache
Cache layers (3 tiers):
- Analysis: 7-day TTL
- Command: 30-day TTL
- MCP: Indefinite
Performance targets:
- Hit rate: >60% (good), >80% (excellent)
- Cache speed: <500ms
- Size: <500MB total
Cost Optimization
Set budget:
shannon budget set 10.00 # $10 limit
shannon budget status # Check spending
Automatic model selection:
- Simple tasks → haiku (cheapest)
- Complex tasks → sonnet (balanced)
- Auto-selected per complexity
View optimization:
shannon optimize
Shows: Potential savings, model recommendations
Quick Reference
| Command | Purpose |
|---|---|
| cache stats | View hit rates and savings |
| cache clear | Clear stale entries |
| budget set N | Set spending limit |
| budget status | Check remaining budget |
| optimize | View cost-saving suggestions |
When to Clear Cache
- After Shannon Framework updates
- Cache size >400MB
- Hit rate <40% (stale entries)
- Debugging cache-related issues
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?