Prime Agent Cost Tracking: See What a Long Run Costs
Just want the answer? Prime Agent has no cost tracking. Install ACP, then start it with prime-acp instead of prime:
curl -sf https://agenticcontrolplane.com/install.sh | bash
prime-acp
Full Prime Agent install guide → · Prime Agent's control model, explained → · free up to 5 agents
Prime Agent (PrimeIntellect-ai/prime-agent) is a hard fork of pi. It has one model-facing tool, a persistent ipython kernel, and it runs in daemon-backed sessions built for long, unattended work. It also has no permission framework and no cost tracking. The control-model reference covers the first gap. This post covers the second.
Why the extension can’t see cost
Prime Agent’s two typed extension events, tool_call and tool_result, work as they do in pi. You can block or rewrite a call before it runs, and rewrite what comes back. Neither event carries a token count. The kernel runs code. It doesn’t report what the model call that wrote the code cost. The pi cost post describes the same gap, because the fork didn’t change this part.
This matters more here than usual. Prime Agent is built to run for hours with less supervision: daemon sessions that survive restarts, a bounded /autonomous mode, recursive subagents. A cost spike in that setup can run a long time before anyone looks.
How the proxy gets the numbers
To price a model call, something has to sit between Prime Agent and the model. That is the ACP proxy. The installer adds a second extension next to the tool-call one, at ~/.prime/agent/extensions/acp-proxy.ts. It registers an acp provider that points at the proxy. It does this only when ACP_PROXY=1 is set.
prime-acp is the launcher that sets it. It reads your workspace key from ~/.acp/credentials, sets ACP_PROXY=1 and --model acp/gemini-3.5-flash, and starts Prime Agent. Set ACP_PRIME_MODEL=<id> to pick another model. If the gateway is unreachable, it starts plain Prime with a one-line note. Plain prime never loads the provider, so nothing changes for sessions you start that way.
One thing to know before you switch. prime-acp does not use your own model login. Only claude-acp and codex-acp forward that. prime-acp sends model calls through ACP’s broker model. If you need a specific model or your own key for a run, start plain prime and accept that the run has no cost view.
The Turn on Cost X-Ray page has the full walkthrough.
What you get
Once a session runs through prime-acp, each model call shows up priced in the console, next to whatever the tool-call extension records for the ipython kernel:
- Per-call cost. Tokens in and out, priced to dollars, rolled up per session.
- Prompt-cache hit rate. In a long daemon session, a cold cache can keep costing you without any sign on screen.
- Loop versus leaf. How much of a long run goes to re-reading context, and how much to the next step of work.
- A policy check on the tool calls the model asks for. This is a second, coarser check. It doesn’t replace the extension’s own
tool_callcheck on the kernel.
Because a daemon session can outlive any one terminal, the console’s per-day rollup is the better view for a run that lasts days.
Budget limits
A workspace has a spending budget, and the gateway can stop a caller’s tool calls once their spend passes it. That halt is off until you turn it on. It reads spend from what ACP has priced, so a run that never goes through prime-acp has no spend on record and nothing to stop. I haven’t tested the halt on a Prime Agent daemon session, so check it on a small budget before you rely on it overnight.
Cost and tool-call checks are separate
The prime-acp launcher doesn’t add tool-call checks, and the tool_call extension doesn’t add cost. They are two installs that write to the same console. Prime Agent has no permission framework underneath either one, so the extension is the only thing checking tool calls. Run both if the agent runs unattended: one tells you what it was allowed to do, the other what it spent.
Frequently asked questions
Does Prime Agent track cost natively?
No. Prime Agent is a hard fork of pi. It kept pi’s typed extension events (tool_call, tool_result) but ships no permission framework and no usage-metering hook. Nothing in the harness reports a dollar figure, and the events it does have carry no token counts.
How do you add cost tracking to Prime Agent?
Install ACP, then start Prime Agent with prime-acp. The installer adds a second extension, acp-proxy.ts, that registers an acp provider pointing at the ACP proxy, but only when ACP_PROXY=1. prime-acp sets that for one launch, along with the model acp/gemini-3.5-flash. Plain prime never loads the provider. The proxy reads token usage off each response and prices it.
Do my model calls still use my own Prime Agent login?
No. Only claude-acp and codex-acp forward your own login. prime-acp sends model calls through ACP’s broker model, so a prime-acp session runs on the model ACP offers, not the one you would pick in plain prime. You can choose another with ACP_PRIME_MODEL.
Does Prime Agent's hasUI bug affect cost tracking?
No. hasUI only matters for approval prompts on tool_call. The model-call path has no approval step.
If Prime Agent has no permission framework, does the ACP extension replace one?
For tool calls, yes. Workspace policy decides allow, ask or deny on every tool_call the ipython kernel would otherwise run unchecked, and tool_result carries output scanning and the audit record. Cost comes from the separate proxy path, so you can use either piece without the other.
Where to read more
- Prime Agent’s control model, explained: the tool_call/tool_result half, and the hasUI print-mode bug
- pi cost tracking: the same pattern on the harness Prime Agent forked from
- Hermes Agent cost tracking: the in-process hook alternative
- Claude Code cost tracking reference and Codex CLI cost tracking: the same for the other coding agents
Running coding agents? ACP records each tool call its hook sees and makes the dangerous shell commands (a force-push, destructive SQL, curl | sh) wait for you. One command, free up to 5 agents:
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
irm https://agenticcontrolplane.com/install.ps1 | iex