feat: Add BudgetMonitor skill for AI cost tracking and budget management#565
Open
christauff wants to merge 1 commit intodanielmiessler:mainfrom
Open
feat: Add BudgetMonitor skill for AI cost tracking and budget management#565christauff wants to merge 1 commit intodanielmiessler:mainfrom
christauff wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
Introduces a resource consciousness system that tracks AI service usage and costs to enable financial awareness and intelligent resource management. Features: - Budget configuration with monthly limits and alert thresholds - Session-by-session usage tracking in JSONL format - Human-readable budget tracker (TRACKER.md) - Alert levels: Normal → Caution → Warning → Critical - Dashboard generation workflow - Multi-service support (Claude, ChatGPT, etc.) Benefits: - Visibility into AI spending - Budget alerts before overspending - Cost trend analysis - Foundation for resource-aware decision making - Simple YAML/JSONL/Markdown architecture (no database) Implementation: - config.yaml: Budget limits, alert thresholds, service pricing - usage.jsonl: Session-by-session append-only log - TRACKER.md: Human-readable current state - Tools/: Dashboard, TrackSession, CalculateBudget - Workflows/: Status, Dashboard, TrackSession, DailyReport Philosophy: "A cat that doesn't know how much it eats can never hunt for itself." Phase 1: Visibility (now) → Phase 2: Intelligence → Phase 3: Consciousness → Phase 4: Optimization Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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).