More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    agentcap

    1

    Enforce hard dollar spend limits on Claude Code sessions to prevent runaway API costs and loops.

    Free

    5.0 (1 review)
    agentcap

    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

    ParameterValue
    Commandagentcap run --cap 5.00 -- claude
    Warning Threshold$4.00 (80%)
    Hard Stop$5.00 (100%)
    Tracking ModeLocal transcript analysis
    EnvironmentNode.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

    1. Define the cap by specifying a dollar amount before starting a new coding session.
    2. Execute the wrapper using agentcap run --cap [amount] which launches Claude Code with injected safety hooks.
    3. Monitor status via the agentcap status command to view historical and real-time usage metrics.
    4. 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.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    5.0
    1 review
    5
    1
    4
    0
    3
    0
    2
    0
    1
    0

    Trust & safety

    Security scan

    Security scan passed 10 days ago

    • Free with an Agensi account

    Software
    Node.js

    Permissions

    Terminal / Shell
    Listed10 days ago
    Updated7 days ago

    What's inside

    Frequently Asked Questions

    AgentCap acts as a "circuit breaker" for Claude Code, physically terminating the process the moment a pre-set dollar limit is hit to prevent expensive infinite loops or runaway API bills.

    No, this skill is specifically architected for the Claude Code CLI. It hooks into the local transcript and tool-use events to calculate costs for models like Claude 3.5 Sonnet and Opus.

    Absolutely. AgentCap uses a local SQLite database to track every session, allowing you to view daily spend totals, individual task costs, and live usage metrics via simple CLI commands.

    Installation is simple via npm/Node.js; once installed, you just wrap your usual start command with `agentcap run --cap [amount]` to immediately protect your session.

    AgentCap uses local SQLite tracking with zero telemetry, meaning your proprietary code and session transcripts never leave your machine or get sent to a third-party server.

    Since it calculates spend based on Anthropic's list prices, we provide regular updates to the skill to reflect any changes in token pricing or new model releases.

    New in LLM Ops

    Free