Skip to content

Cost Tracking

ClaudeControl tracks token usage and cost for every agent interaction.

Real-Time Cost Display

The total cost of the active workspace appears in the header bar as $X.XX.

Chat Header

Each agent's individual cost appears below its name as $X.XXXX.

Cost Dashboard

Navigate to Settings → Custo e Agentes to see:

  • Total USD — accumulated cost across all agents in the workspace
  • Total Turns — conversation rounds
  • Input Tokens — tokens sent to the model
  • Output Tokens — tokens received from the model
  • Per-Agent Breakdown — table sorted by cost, showing each agent's contribution

Budget Controls

Max Budget (auto-stop)

Set maxBudgetUsd in runtime settings. When an agent's total cost exceeds this limit, ClaudeControl automatically:

  1. Interrupts the conversation
  2. Logs a system message: "Auto-stop: custo total $X.XX excedeu limite de $Y"
  3. Sets the agent to idle

Max Turns

Set maxTurns to limit conversation rounds per agent session. The SDK enforces this natively.

Cost Alerts

When an agent's accumulated cost crosses a threshold, a system message appears in the chat:

ThresholdAlert
$1.00"Alerta: custo total deste agente atingiu $X.XX (>$1)"
$5.00"Alerta: custo total deste agente atingiu $X.XX (>$5)"
$10.00"Alerta: custo total deste agente atingiu $X.XX (>$10)"

Each threshold triggers only once per agent.

Subagent Dedup Detection

When an agent spawns a subagent with a name similar to one already running, a warning appears:

Subagente duplicado detectado: "Task 1" similar a "task1"

This helps prevent the model from re-dispatching the same task multiple times.

SDK Auto-Compact

When the SDK detects the context is getting large, it automatically compresses it. ClaudeControl shows:

  • "Compactando contexto..." — compression started
  • "Contexto compactado (auto, 167235 tokens)" — compression complete

No manual rotation needed — the SDK handles context management natively.

Token Optimization

ClaudeControl optimizes token usage:

OptimizationSaving
Pool context refresh every 10 turns (not every message)~450 tokens/turn
Cached context files (5-min TTL)Disk I/O per message
Tool results truncated in WebSocket (2KB vs 5KB)Payload size
Log pagination (last 50 entries in API)Response size
Attachments saved to disk (not base64 in logs)~170KB per image

Released under the MIT License.