onlybeatshredder

Agentfuse — Development skill for Claude Code

Development community

AgentFuse — a local-only cost circuit breaker for Claude Code.

How to install Agentfuse

This entry records only its repository, not the path inside it, so there is no exact command to give. Open onlybeatshredder/agentfuse and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Agentfuse does

AgentFuse — a local-only cost circuit breaker for Claude Code. Hooks veto runaway tool calls when daily/session caps, loop, or subagent limits trip. No network, no accounts, no credentials. Open source (MIT).

Alternatives in Development

  • Ccusage — CLI for analyzing Claude Code/Codex usage from local JSONL files 11.8k ★
  • Memory Gc — Inspect or rotate the autopilot ledger JSONL files (findings.jsonl, negatives.jsonl) 3.8k ★
  • Obsidian MCP Connector — Your Obsidian vault, exposed to Claude, Codex, Cursor and any MCP client 115 ★

README

AgentFuse

A local-only cost circuit breaker for Claude Code. It watches what your sessions actually cost, and vetoes the next tool call when a cap trips — before a runaway agent burns another dollar.

Thesis in five lines:

  1. Claude Code agents can loop, spawn subagents, and burn tokens with no built-in spend limit; the bill (or the subscription's fair-use patience) is the only brake.
  2. The transcript already records every token — AgentFuse prices it from Anthropic's public price list and keeps the running total on disk.
  3. A PreToolUse hook reads that ledger and denies the next call the moment a daily cap, session cap, loop, or subagent cap trips.
  4. Everything runs locally: no network, no accounts, no credentials, no subscription login routed anywhere. Hooks can only deny, never allow.
  5. It is a circuit breaker, not a cage — caps are yours to raise, and the tool tells you exactly how.

Install

npm install
npm run build
node dist/cli.js init        # or `npm link` / link the bin, then `fuse init`

`fuse init` creates `~/.agentfuse/config.json` with defaults (never overwrites an existing config) and merges four hooks into `~/.claude/settings.json` without clobbering your existing hooks or settings. It warns if `claude` is missing or older than 2.1.295 (`onFailure: "block"` needs >= 2.1.295) but does not fail.

Requires Node >= 20. Zero runtime dependencies; TypeScript + `@types/node` are dev-only.

Usage

fuse status                  # today's spend, caps, trips
fuse report                  # today's per-session breakdown
fuse report --date 2026-11-25
fuse report --all

Config reference (`~/.agentfuse/config.json`)

Key Default Meaning
dailyCapUsd 5 Max API-equivalent spend per local day across all sessions.
sessionCapUsd 2 Max API-equivalent spend per session.
loopThreshold 5 Identical tool call (same tool_name + stable-stringified tool_input)