More screenshots
Works with the AI Agents you already use
agentcap
Enforce hard dollar spend limits on Claude Code sessions to prevent runaway API costs and loops.
Free
agentcap
Example session with this skill installed
I need to refactor this legacy React codebase but I am worried about the cost. Can you run a Claude session for me but stop it if it hits $5.00?
- Read your context and instructions
- Compiled the agentcap
I have configured a spend-capped session for your refactoring task. I will use AgentCap to monitor the session and terminate the process if it reaches the $5.00 limit. Please ensure you have committed your current work, as AgentCap will send a `SIGTERM` (and then `SIGKILL`) to the agent if the cap is reached to prevent further charges. ## Session Configuration | Parameter | Value | | :--- | :--- | | **Command** | `agentcap run --cap 5.00 -- claude` | | **Warning Threshold** | $4.00 (80%) | | **Hard Stop** | $5.00 (100%) | | **Tracking Mode** | Local transcript analysis | | **Environment** | Node.js 20+ / SQLite | I will now initiate the session. You will see a banner at the start of the terminal confirming that tracking is active. If the agent enters a loop, the `PreToolUse` hook will block further calls before the process is killed. **Next steps** 1. Review the current session spend at any time by running `agentcap status` in a separate terminal. 2. If the session exits with code `2`, the cap was hit; check your work and decide if you want to resume with a new cap. 3. Update the pricing table regularly with `npm i -g @oneclickera/agentcap@latest` to ensure accurate estimation for new models.
Connects securely to your tools. The creator never sees your data.
About this skill
AI coding agents can run in loops, firing off expensive tool calls that result in massive, unexpected API bills. This skill integrates AgentCap to wrap Claude Code sessions with a hard dollar spend ceiling, automatically killing the process if the limit is reached.
What it does
- Spend enforcement terminates the agent process immediately once the 100% cap is hit.
- Proactive warning sends a notification when the current session reaches 80% of the defined budget.
- Local tracking reads usage data directly from Claude Code transcripts using a local SQLite database with zero telemetry.
- Cost estimation calculates spend based on Anthropic list prices for specific models like Opus and Sonnet.
- Session reporting provides a summary of today's spend, individual session costs, and live figures for active runs.
How it works
- Define the cap by specifying a dollar amount before starting a new coding session.
- Execute the wrapper using
agentcap run --cap [amount]which launches Claude Code with injected safety hooks. - Monitor status via the
agentcap statuscommand to view historical and real-time usage metrics. - Handle exits by reviewing specific exit codes to determine if a session ended naturally or was forcibly stopped by the cap.
Frameworks & tools
This tool requires Node.js 20+ and Claude Code. It uses a local SQLite database stored in ~/.agentcap/ for persistent session logging and native hooks to intercept PreToolUse events.
Why this beats prompting it yourself
Standard prompts cannot monitor API token usage in real-time or physically kill a system process when a budget is exceeded. This skill provides a hardware-level circuit breaker that functions even if the agent ignores instructions to stop.
Use cases
- Prevent runaway loops during complex refactoring tasks that require multiple tool calls.
- Set strict daily budgets for junior developers or contractors using shared API keys.
- Audit session costs across multiple projects to estimate R&D expenses.
- Test experimental agent workflows without the risk of a thousand-dollar mistake.
Known limitations
Costs are estimates based on list prices and may not reflect Pro subscriptions or volume discounts. It currently only supports Claude Code and may overshoot the cap slightly if a large request is already in flight.
Estimates list prices only. No support for Cursor/OpenAI. Requires Node 20+. Small amount of background usage is invisible to the tracker.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
Trust & safety
Security scan
Security scan passed 10 days ago
- Free with an Agensi account
Requires