Concepts Copy

Token Usage

Monitor, attribute, and optimize token-denominated credit consumption across autonomous agents, background workers, and team workspaces.

BetterContext measures compute and memory graph operations directly in token units. Rather than abstract compute points, 1 Credit corresponds directly to 1 processed token. This 1:1 token denomination provides transparent visibility into input prompts, retrieved subgraphs, incremental AST diffs, and causal delta verifications.

Token Pricing per 1K Tokens

Transparent pricing metered on actual compute intensity. Pay only for net tokens processed, with pinned cache hits billed at zero cost:

Experience Compilation & Training

Procedural memory compilation, SOP distillation, and agent rule extraction from PRs and runbooks.

$0.0080 / 1k
Focus Mode Causal Evaluation

Counterfactual intervention checks, causal DAG de-confounding, and agent hallucination pruning.

$0.0020 / 1k
Memory Graph Retrieval

Sub-250ms localized graph traversal, context vector recall, and AST node extraction for agent prompts.

$0.0015 / 1k

Token Metering & Consumption Mechanics

BetterContext meters operations according to the computational effort required to traverse, evaluate, and index your workspace knowledge graph:

Operation Metered Unit Token Cost Billing Rate
Graph Query Recall Prompt input tokens + retrieved subgraph nodes 1 token per input & context token Standard sub-250ms graph query
Graph Cache Hit Previously compiled subgraphs & pinned contexts 0 tokens Free (0 Tokens)
Live AST & File Watchers Tree-sitter AST symbol delta on file save 1 token per modified AST symbol Incremental sync (50ms debounce)
Focus Mode Causal Check Counterfactual intervention & delta evaluation 1 token per verified intervention step Noise pruning & drift prevention
Source Ingestion Document chunking, vectorization, & graph linking 1 token per ingested source token One-time upon repository import

Console Attribution by Source, Member & Namespace

The BetterContext Console breaks down credit usage across three independent dimensions, ensuring engineering leads can track exactly where tokens are allocated:

CLI Telemetry & API Inspection

Developers and fleet operators can query real-time credit balances and consumption metrics directly from the command line or via the Python SDK:

# Check current workspace token balance and breakdown
bettercontext credits status --breakdown namespace

# Stream live agent token consumption logs in real time
bettercontext credits stream --source claude-code

To inspect usage programmatically inside custom agent loops or automated CI harnesses:

from bettercontext import Client

client = Client()

# Query credit balance and 7-day consumption breakdown
usage = client.credits.get_usage(breakdown="source", timeframe="7d")
print(f"Remaining Tokens: {usage.remaining_tokens:,}")

for source, token_count in usage.by_source.items():
    print(f"  • {source}: {token_count:,} tokens")

Budget Controls & Auto Top-Up

Prevent surprise overages when deploying long-running autonomous agent fleets with built-in spending guardrails:

Fleet Guardrail Controls:
• Soft Alert Thresholds: Send automated notifications (Slack webhook, PagerDuty, email) when 80% of monthly quota is reached.
• Hard Spending Caps: Automatically suspend unprivileged background agent queries once the monthly ceiling is hit to prevent infinite agent loops.
• Auto Top-Up: Automatically provision emergency credit reserves in customizable token increments when the active pool drops below 10%.

Fleet Token Optimization Strategies

Maximize your token efficiency using BetterContext's architectural cost controls:

  • Focus Mode Causal Pruning: Filter out irrelevant files, historical commits, and off-topic runbooks before sending context to frontier models, cutting token volume by 65% to 85%.
  • Graph Caching: Pin foundational architecture docs, API schemas, and design systems into persistent memory to take advantage of free zero-token cache hits.
  • AST-Aware Incremental Diffs: Use live file watchers so that only modified symbols and functions are processed, bypassing repetitive whole-repo re-indexing.
  • Branch-Level Overlays: Limit pull request evaluation to branch diffs overlaid onto canonical main, ensuring agents never re-embed unchanged base code.

Next Steps

Was this page helpful?

Powered By BetterContext