feat: Add BudgetMonitor skill for AI cost tracking and budget management #565
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
💰 feat: Add BudgetMonitor skill for AI cost tracking and budget management
Summary
Introduces BudgetMonitor, a resource consciousness system that tracks AI service costs across multiple providers (Claude, ChatGPT, Perplexity, etc.) with session-by-session logging, configurable alert thresholds, and budget management capabilities.
🎯 Motivation and Context
Problem:
Solution:
BudgetMonitor provides comprehensive cost tracking with:
📋 Changes
Added Files
💰 Configuration Example
config.yaml:
usage.jsonl:
{"timestamp":"2026-02-02T14:32:00Z","session_id":"session-xyz","duration_minutes":45,"messages":23,"tokens_estimated":{"input":46000,"output":92000},"cost_estimated":8.55,"rating":9}TRACKER.md:
✅ Benefits
Visibility:
Control:
Intelligence:
Foundation:
🎯 Alert Levels
💡 Example Usage
Quick Status Check:
Dashboard Generation:
Session Tracking:
🧪 How Has This Been Tested?
📊 Types of Changes
✅ Checklist
📖 Documentation
Setting Up:
Customizing Alert Thresholds:
Edit
~/.claude/BUDGET/config.yaml:Adding New AI Services:
🎓 Implementation Notes
Why JSONL format?
Why YAML for config?
Why Markdown for tracker?
Design Philosophy:
Resource consciousness is foundational for AI autonomy. Before AI can make strategic decisions about which models to use, it must understand the cost implications. BudgetMonitor provides that foundation.
🚀 Future Roadmap
Phase 1: Visibility (Current)
Phase 2: Intelligence (Next)
Phase 3: Consciousness (Future)
Phase 4: Optimization (Goal)
📈 Real-World Example
Monthly Report:
🔧 Integration Patterns
Manual Tracking:
Automatic Tracking (Recommended):
Add to session-end hook:
Morning Brief Integration:
Privacy Note: All data is stored locally in
~/.claude/BUDGET/. No external services. User controls all data.Dependencies: None. Pure PAI architecture (YAML + JSONL + Markdown + Workflows).