I run a small fleet of agents: Claude Code, Codex, Hermes, a couple of custom ones. I kept failing to answer a simple question: what did they actually do last night, and what did it cost me?
It grew into the thing I now use every day: a control plane that sits between my agents and everything they touch — their models and their tools — so I can see what they're doing, gate what they're allowed to do, and cut what they waste.
What it does, concretely:
- *See them.* Onboard agents with one command — the CLI discovers Claude Code, Codex, OpenClaw, OpenCode and friends on your machine, backs up their config, and routes them through Preloop. You get live and historical sessions: every prompt, tool call, and token, with cost per session.
- *Govern them.* An MCP firewall with allow / deny / require-approval rules (per tool, with tiers — e.g. auto-allow payments under $100, human approval to $2,000, deny above). Approvals reach your phone or watch, and they're async — the agent keeps working while a human decides.
- *Cut their cost.* This part recently went open source: session autopsies find concrete waste (unused tools loaded into every request, tool-output fields nothing ever reads, cache-breaking prompts), one click applies the fix at the gateway — no agent code changes — and you can replay the same session through the fix to verify the savings instead of trusting an estimate. Analysis runs on your own model keys (BYOK).
Everything is self-hosted (Apache-2.0, docker compose, helm) — your prompts and traffic stay on your infrastructure. There's a hosted version if you don't want to run it, which is how the project pays for itself: the paid tier is hosting, teams/RBAC/SSO, and hosted-compute analysis. The loop itself is in the open-source core.
Honest limits, since you'll find them anyway:
- Subscription-billed agents (e.g. Claude Code on a Pro/Max plan) pass through byte-faithfully — you get sessions, governance, and budgets for that traffic, but message-level context optimizations only apply to API-key traffic. (Anthropic tightened validation on subscription OAuth requests recently; we pass the exact original payload through rather than rewrite it.)
- Claude Desktop and Cursor are MCP-governed only — their model traffic can't be repointed, so cost analysis doesn't cover it.
- Savings figures are per-session and replay-verified where shown; we don't publish an average because it depends entirely on how wasteful your agents were to begin with. Mine were embarrassing.
I made a short video series showing the whole loop on my own agent fleet: https://www.youtube.com/watch?v=Y_geb2Or8zM&list=PLr2Jp0c-Qn...
Try it: `curl -fsSL https://preloop.ai/install/oss | sh` (self-hosted) — or the hosted version at https://preloop.ai. I'll be here all day; the sharpest criticism gets the most attention.