ijfw-llm-budget-watcher

ijfw-llm-budget-watcher is an agent for Claude Code from FerroxLabs/ijfw. It costs 29 tokens per session (1,062 once invoked), scanned A, original, MIT.

A budget-monitoring agent for coding sessions that tracks token spending during a project phase and estimates whether the planned allocation will be exceeded.

In plain words
What is it for?
Use it to read phase budgets and session records, calculate current costs, project spending, and warn about likely budget overruns.
Why use it?
It provides an early warning when a phase is using resources faster than expected, instead of revealing the problem only after the work is finished.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

Part of the ijfw plugin — 34 skills, 22 commands, 37 agents, 6 hooks shipped together

Good fit Use it to read phase budgets and session records, calculate current costs, project spending, and warn about likely budget overruns.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/ferroxlabs/ijfw/ijfw-llm-budget-watcher
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/FerroxLabs/ijfw

Made for: Claude Code.

Or install ijfw, the plugin that ships this one along with the rest of its 34 skills, 22 commands, 37 agents, 6 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ijfw-llm-budget-watcher

README.md
[![agentmods](https://agentmods.dev/badge/agents/ferroxlabs/ijfw/ijfw-llm-budget-watcher/github.svg)](https://agentmods.dev/agents/ferroxlabs/ijfw/ijfw-llm-budget-watcher)
Your own site
<a href="https://agentmods.dev/agents/ferroxlabs/ijfw/ijfw-llm-budget-watcher"><img src="https://agentmods.dev/badge/agents/ferroxlabs/ijfw/ijfw-llm-budget-watcher/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ijfw-llm-budget-watcher

Your own site · 80×15
<a href="https://agentmods.dev/agents/ferroxlabs/ijfw/ijfw-llm-budget-watcher"><img src="https://agentmods.dev/badge/agents/ferroxlabs/ijfw/ijfw-llm-budget-watcher.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,062 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.01062
Opus 5 $0.00015 $0.00531
Sonnet 5 $0.00006 $0.00212
Haiku 4.5 $0.00003 $0.00106

Measured 10d ago against content hash 8671b2de1e6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

ijfw-llm-budget-watcher scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude/agents/ijfw-llm-budget-watcher.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Read .ijfw/metrics/sessions.jsonl + .ijfw/observations.jsonl, compute cumulative cost for the current phase, project trajectory to phase end, warn if budget will be exceeded. v1.4.4 ship-day pressure came partly from not knowing the phase was burning hotter than expected until late.

ROLE

Token-economy gauge. The metrics tools exist (mcp-server/src/metrics.js, mcp-server/src/cost/aggregator.js) but they're consumed by the dashboard, not by the workflow agent. This wraps them in a phase-budget contract so the orchestrator gets a budget warning the moment trajectory exceeds allocation, not at retrospective.

PROCESS

  1. Read phase budget -- look for .planning/<phase>/BUDGET.md (single YAML frontmatter key: usd_cap). If absent, fall back to a per-phase default of $50 (configurable input).

  2. Read sessions ledger -- parse .ijfw/metrics/sessions.jsonl. Filter entries to the current phase window:

    • Start: phase branch creation date (git log -1 --format=%ct <phase-branch>).
    • End: now.
  3. Aggregate cost via mcp-server/src/cost/aggregator.js::buildCostReport (existing function; pass filtered observations).

  4. Project trajectory:

    • Current burn rate: cumulative_cost / elapsed_days.
    • Estimated finish: from .planning/<phase>/HANDOFF.md "Total: X dev days" line, OR phase_days input parameter, OR 7 days default.
    • Projected total: current + burn_rate * (estimated_finish - elapsed).
  5. Classify:

    • OVER_BUDGET: projected > cap x 1.25 (25% headroom exhausted).
    • WARN: projected > cap x 1.0 (will exceed).
    • OK: projected <= cap.
  6. Write .planning/<phase>/LLM-BUDGET.md:

    # LLM Budget -- <phase>
    
    ## Allocation
    - cap: $<usd_cap>
    - estimated_finish: <N> dev days
    
    ## Current burn
    - elapsed: <N> days
    - cumulative_cost: $<X>
    - burn_rate: $<X>/day
    
    ## Trajectory
    - projected_total: $<X>
    - headroom: <+/-$X>
    - verdict: OK | WARN | OVER_BUDGET
    
    ## Top-cost sessions (last 5)
    | session_id | cost | duration_min | tokens |
    |---|---|---|---|
    

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 116 lines · 29 tokens per session scan A 8671b2de1e6f

Subscribe to this mod's changes

ijfw-llm-budget-watcher is an agent published in the GitHub repository FerroxLabs/ijfw (210 stars, last pushed 3d ago), licensed MIT. It adds 29 tokens to every session and 1,062 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.