budgetclaw AGENTS.md

Repository instructions for BudgetClaw, a local tool that watches Claude Code spending from session logs and can stop a process when a budget is exceeded.

In plain words
What is it for?
Use them when building, testing, or reviewing this Go program and its spending limits, alerts, or log-reading behavior.
Why use it?
They explain how to preserve the project's promises about privacy, API keys, prompts, and added delay while changing the code.

Instructions file for CodexOpenCode

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.

agentmods
npx agentmods add instructions/roninforge/budgetclaw/agents-md
Clone the repo
git clone --depth 1 https://github.com/RoninForge/budgetclaw

Made for: Codex, OpenCode.

Per session 1,627 This file is loaded in full into every session.
When invoked 1,627 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01627 $0.01627
Opus 5 $0.00813 $0.00813
Sonnet 5 $0.00325 $0.00325
Haiku 4.5 $0.00163 $0.00163

Measured 2d ago against content hash eb2d1069ba0d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

budgetclaw AGENTS.md 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 2d 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.

AGENTS.md · 103 lines

How it starts

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

AGENTS.md - BudgetClaw

Guidance for AI coding agents working on this repository. Human contributors should read CONTRIBUTING.md first; this file exists to give agents the same context without spelunking.

What this is

BudgetClaw is a local spend monitor for Claude Code. It reads the JSONL session logs Claude Code writes under ~/.claude/projects/, attributes each tool call's token cost to a {project, branch} pair, enforces budget caps by sending SIGTERM to the claude process on breach, and pushes phone alerts via ntfy.

Single static Go binary. MIT licensed. Part of the RoninForge toolkit.

Trust pledge (load-bearing - never break this)

The whole product hinges on three claims. Never write code, copy, or comments that contradict them.

  1. Zero keys. BudgetClaw never reads, stores, or uses an Anthropic API key.
  2. Zero prompts. BudgetClaw reads only the usage.* and cwd fields from JSONL log lines. Never the message bodies.
  3. Zero latency added. BudgetClaw is a local log reader. It never sits between an editor and the Anthropic API.

Never call BudgetClaw a "proxy." That word is legally dead under Anthropic ToS §D.4. Always say "usage guard," "spend monitor," or "telemetry reader." If you find existing copy or comments using "proxy," fix them.

Layout

cmd/budgetclaw/        Cobra entrypoint
internal/cli/          Subcommand handlers (init, limit, status, watch, alerts, unlock, pricing, backfill)
internal/db/           SQLite (modernc.org/sqlite, no cgo) - events + rollups
internal/pipeline/     JSONL parser + token-to-cost mapper
internal/pricing/      Embedded pricing table (Opus 4.x, Sonnet, Haiku, cache multipliers)
internal/watcher/      fsnotify-based file tailer
internal/budget/       Limit evaluation + SIGTERM
internal/notify/       ntfy push client
examples/config.toml   Documented config template (TOML, not YAML)
testdata/              Real-shape JSONL fixtures
.github/workflows/     CI + daily pricing audit

Read the full file on GitHub · 103 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. 2d ago First seen · 103 lines · 1,627 tokens per session scan A eb2d1069ba0d

Subscribe to this mod's changes

budgetclaw AGENTS.md is an instructions file published in the GitHub repository RoninForge/budgetclaw (8 stars, last pushed 2d ago), licensed MIT. It adds 1,627 tokens to every session, about $0.0081 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-31.