Tool Prune
After three warm-up requests, removes unused tool schemas while retaining tools already called or named in the current request.
Built locally. Your API key stays with your agent.
A local Python package with two simple steps to use, track, and reduce your OpenAI token usage.
01$ pip install agentwarden-ai
02$ agentwarden dashboard
In your existing OpenAI client
base_url = "http://127.0.0.1:8080/v1"Same SDK. Same API key. Local proof for every session.
Measured savings
A real local lead-agent run reduced context after warm-up while preserving the completed workflow. The request-level receipt shows exactly what changed.

Turn them on
Every optimizer starts off. Open the dashboard settings button, enable the passes you want, then apply them to the running local proxy. The settings reset when the proxy stops, so use environment variables when you want durable defaults.
Longer agent loops create more opportunity. Tool Prune learns from the session after three unchanged warm-up requests. In tool-heavy workflows, 10-15+ requests can reduce input cost by roughly 16-50%, depending on repeated tools and history.

After three warm-up requests, removes unused tool schemas while retaining tools already called or named in the current request.
Keeps recent turns intact and clips older tool-result messages that no longer need full detail.
Replaces repeated history blocks with a deterministic reference to the original content.
Stabilizes the system-and-tools prefix so provider prompt caching has a better chance to apply.
The 16-50% range is a workload-dependent potential, not a guarantee. Your local receipt shows the actual result for each session.

Know the waste
AgentWarden separates system instructions, tool schemas, conversation history, and the current turn. You can see whether tools or history are creating the cost before enabling an optimizer.
Local dashboard
Start one local command, select a session, then inspect cost, tokens avoided, tools offered, latency, and the exact optimization passes used.

How it works
AgentWarden runs between your existing agent and the OpenAI Chat Completions API. Streaming stays intact, and your authorization header passes through from your own process.
Same SDK and tools.
Measures, trims, and relays locally.
Receives the compatible request.
What ships today
See system, tools, history, and current-turn tokens separately.
After warm-up, remove unused schemas while retaining explicitly needed tools.
Trim older tool outputs, deduplicate old history, and stabilize cacheable prefixes.
Warn on projected session spend and validate important workflows.

Independent and open source
Built during OpenAI Build Week with Codex and GPT-5.6, for developers who want their agents to stay capable while becoming meaningfully easier to understand and afford.