/sosa-orchestrator:sosa-orchestratorfrom MSApps SOSA Orchestrator
Tracks token budgets across Claude Code and Cowork, ranks tasks by importance vs cost, and auto-prioritizes what to run, defer, or pause. Invoked by 'orchestrate' or 'token budget'.
Ships in MSApps SOSA Orchestrator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The resource-aware brain that decides what runs, what waits, and what stops.
Every Claude session — Cowork, Claude Code, scheduled tasks — burns through a finite token budget. Without active orchestration, a low-priority health check can eat the tokens you needed for a revenue-critical invoice run. The Orchestrator solves this by maintaining a live priority×cost matrix and making smart allocation decisions throughout the session.
It integrates tightly with the SOSA Governor (which gates individual tool calls) and the Token Efficiency Audit (which optimizes long-term patterns). The Orchestrator operates at the task level — deciding which tasks deserve tokens right now.
Budgets cascade from broad to narrow. The orchestrator reads these from config/budgets.json (shared with SOSA Governor):
Monthly budget (25M tokens)
→ Weekly allocation (rolling average)
→ Daily budget (minus 15% reserve)
→ Agent category budgets (revenue, communication, operations, development, monitoring)
→ Individual task estimates
Every task gets a Priority Score computed as:
Priority = (Business Impact × Urgency × Dependency Weight) / Estimated Token Cost
Where:
Higher score = should run first. The orchestrator maintains a sorted queue.
| Category | Daily Budget | Priority | Overage Policy |
|---|---|---|---|
| Revenue | 150K tokens | Critical | Borrow from reserve |
| Communication | 120K tokens | High | Borrow from reserve |
| Development | 100K tokens | Medium | Notify and continue |
| Operations | 80K tokens | Medium | Queue until tomorrow |
| Monitoring | 30K tokens | Low | Throttle |
Step 1 — Gather token state. Collect budget data from all available sources:
audit/YYYY-MM-DD.jsonl from the SOSA Governor plugin. Count tool calls, estimate tokens consumed per call (use the heuristics table below).mcp__scheduled-tasks__list_scheduled_tasks for today's completed and pending runs.Token estimation heuristics (when exact counts aren't available):
| Operation Type | Estimated Tokens |
|---|---|
| Simple read/search tool call | 1,000-2,000 |
| Chrome page read | 3,000-8,000 |
| Chrome page interaction (navigate + read + act) | 5,000-15,000 |
| File creation (docx, xlsx, pdf) | 8,000-25,000 |
| Multi-step workflow (invoicing, lead review) | 20,000-80,000 |
| Skill with subagents | 30,000-100,000 |
| Simple conversation turn | 500-1,500 |
Step 2 — Inventory pending tasks. Gather everything that needs to run:
Step 3 — Score and rank. For each task, compute the Priority Score and build the ranked queue. Present it as a clear table:
| Rank | Task | Category | Impact | Est. Tokens | Priority Score | Status |
|------|------|----------|--------|-------------|----------------|--------|
| 1 | Aman invoicing | Revenue | 9 | ~45K | 18.0 | ⏳ Pending |
| 2 | LinkedIn lead review | Revenue | 8 | ~35K | 16.0 | ⏳ Pending |
| 3 | WhatsApp replies (Gali) | Communication | 7 | ~15K | 14.0 | ⏳ Pending |
| ...
Step 4 — Budget feasibility check. Sum estimated tokens for all tasks. Compare against remaining daily budget. Flag any issues:
During task execution, the orchestrator maintains a running token ledger:
Before each task starts: Show the user the current state:
📊 Budget: ~180K remaining of 480K daily | Task: "LinkedIn lead review" (~35K est.)
After this task: ~145K remaining | Enough for: 3-4 more medium tasks
Token efficiency mode: When budget drops below 40%, automatically:
Pause trigger: If a running task exceeds 150% of its estimate, pause and report:
⚠️ PAUSE — "LinkedIn lead review" has consumed ~52K tokens (estimate was 35K).
Remaining budget: ~128K tokens
Still pending: Aman invoicing (~45K), Toggl check (~5K), Gali replies (~15K)
Options:
A) Continue this task (may consume ~20K more)
B) Stop here — I'll save a partial report with what I have so far
C) Switch to higher-priority task first, come back to this later
What would you like to do?
Task completion: After each task, update the ledger and re-rank remaining tasks. The priority order may shift based on actual consumption.
After the session's work is done (or budget is exhausted):
Generate session summary:
📋 Session Summary — 2026-03-31
Completed: 4 tasks | Deferred: 2 tasks | Stopped: 1 task
Tokens used: ~310K of 480K daily budget (65%)
Budget health: 🟢 Within limits
Completed:
✅ Aman invoicing (42K tokens) — Revenue
✅ LinkedIn lead review (38K tokens) — Revenue
✅ Gali WhatsApp replies (12K tokens) — Communication
✅ Toggl health check (4K tokens) — Monitoring
Deferred (budget-aware):
⏸️ Plugin development — Low urgency, moved to tomorrow
⏸️ Receipt collection — Queued per operations overage policy
Stopped:
🛑 GitHub migration — Exceeded estimate by 180%, partial progress saved
Update budget state — Write consumed totals to config/session-ledger.json so future sessions know what's been spent this week/month.
Recommendations for next session:
The orchestrator never silently kills a task. When it decides a task should stop, it always:
The orchestrator thinks beyond the current session:
| Horizon | Warning Trigger | Message |
|---|---|---|
| Session | >80% of daily estimate consumed | "This session has used 80% of today's budget. X tasks remain." |
| Daily | >90% of daily budget | "Daily budget nearly exhausted. Remaining tasks will queue to tomorrow." |
| Weekly | >70% by Wednesday | "Weekly burn rate is high — consider deferring non-critical tasks." |
| Monthly | >80% by the 20th | "Monthly budget is ahead of pace. Review task scheduling." |
config/budgets.json for budget limitsaudit/YYYY-MM-DD.jsonl for actual tool-call countsconfig/task-profiles.jsonPre-configured profiles for known recurring tasks. The orchestrator uses these for estimation:
{
"linkedin-lead-review": {
"category": "revenue",
"business_impact": 8,
"avg_tokens": 35000,
"p95_tokens": 55000,
"urgency": 4,
"dependencies": [],
"frequency": "daily"
},
"aman-monthly-invoicing": {
"category": "revenue",
"business_impact": 9,
"avg_tokens": 45000,
"p95_tokens": 70000,
"urgency": 5,
"dependencies": ["chrome"],
"frequency": "monthly"
}
}
Add new task profiles as you discover recurring tasks. The orchestrator learns from actuals over time.
config/session-ledger.jsonRunning log of token consumption per session, per day. Used for weekly/monthly tracking:
{
"2026-03-31": {
"sessions": [
{
"session_id": "affectionate-practical-tesla",
"started": "2026-03-31T09:00:00Z",
"tasks_completed": 4,
"tasks_deferred": 2,
"estimated_tokens": 310000,
"category_breakdown": {
"revenue": 80000,
"communication": 12000,
"operations": 0,
"development": 0,
"monitoring": 4000
}
}
],
"daily_total": 310000,
"daily_budget": 480000,
"utilization": 0.65
}
}
Say any of these to invoke the orchestrator:
The orchestrator will scan your pending work, check your budget, and present a prioritized plan. It stays active throughout the session, tracking consumption and alerting you before any budget boundary is crossed.
Cowork: Full functionality. Uses TodoList widget for visual task tracking. Session hooks trigger automatic budget check on start.
Claude Code: Full functionality. Outputs to terminal. Can read .claude/audit/ logs and scheduled task configs. Use claude -p for non-interactive budget checks.
Scheduled Tasks: The orchestrator doesn't run as a scheduled task — it runs at the start of interactive sessions and monitors scheduled tasks' budget impact.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub msapps-mobile/claude-plugins --plugin sosa-orchestratorOther plugins' skills for the same job