{"slug": "i-was-paying-to-send-27-unused-tools-to-claude-so-i-filtered-them", "title": "I was paying to send 27 unused tools to Claude. So I filtered them.", "summary": "A developer built a proxy that filters unused tool definitions from requests sent to Claude Code, cutting their monthly API bill from $200 to $50. The proxy classifies user messages into categories and forwards only the relevant tools, reducing tokens per request by 75%. The project is available on GitHub as dynamic-tool-proxy.", "body_md": "*I stared at my Anthropic bill. $200. For one month. Of Claude Code.*\n\nNot because I was doing anything special. Just... regular coding. But here's the thing nobody tells you:\n\n**Claude Code sends 27 tool definitions with every single request.**\n\n27 JSON schemas. Every turn. Even if you're just fixing a typo in a CSS file.\n\nI was paying to send GitHub tools, Context tools, IDE tools, agent tools... when all I needed was `Read`\n\n, `Edit`\n\n, and `Grep`\n\n.\n\nSo I built a proxy. A dumb, simple proxy that sits between my editor and the API. It reads my message, figures out what tools I actually need, and strips the rest before it reaches the model.\n\nCost went from $200 to $50. Same code. Same quality.\n\nHere's how.\n\nEvery AI coding tool works the same way. They have a bunch of built-in tools. File reading, bash execution, web search, git operations, context providers, IDE integration.\n\nAnd they send **all of them** to the LLM on every request.\n\nClaude Code has 27 tools. Cursor has similar. Windsurf too.\n\nWhen you say \"fix the nav labels in pricing.html\", here's what happens:\n\n`Edit`\n\n)That's like printing a 100-page menu when you're ordering a coffee.\n\nOne thing. It filters tool definitions.\n\n```\nClient sends 27 tools\n    ↓\nProxy reads your message\n    ↓\nProxy figures out what tools you need (6)\n    ↓\nProxy forwards only those 6\n    ↓\nProvider responds normally\n```\n\nThat's it. No magic. No LLM calls. Just regex matching and list filtering.\n\nThe proxy looks at your message and matches keywords:\n\n```\n\"fix the nav labels in pricing.html\"\n\nregex \"fix\"     → file_edit: +2\nregex \"change\"  → file_edit: +1  \nregex \"html\"    → file_edit: +1\n\ncategory = file_edit (score: 4)\n```\n\nThen it sends only the tools for that category:\n\n```\nKEEP: Read, Edit, Grep, Glob, Bash, Write\nDROP: 21 others (GitHub, IDE, Context7, etc.)\nWITHOUT proxy:\n  27 tools  ████████████████████████████████  ~1,200 tokens\n\nWITH proxy:\n   6 tools  ██████████░░░░░░░░░░░░░░░░░░░░░░  ~300 tokens\n\nSaved: ~900 tokens per request (75%)\n```\n\nSame model. Same quality. Just fewer schemas.\n\n```\n# Clone\ngit clone https://github.com/dvcoolarun/dynamic-tool-proxy\ncd dynamic-tool-proxy\n\n# Install\npip install fastapi httpx uvicorn\n\n# Run\npython3 standalone_proxy.py\n```\n\nThen point your editor at it:\n\n```\n# Claude Code\nANTHROPIC_BASE_URL=http://localhost:8090 claude\n\n# Or set it permanently\nexport ANTHROPIC_BASE_URL=http://localhost:8090\n```\n\nThat's it. No API keys. No cloud accounts. No config files.\n\nThe proxy listens on port 8090. Your editor thinks it's talking to Anthropic. The proxy strips the tools and forwards the request.\n\nThe proxy classifies your message into one of 7 categories:\n\n| Category | Tools Sent | When It Triggers |\n|---|---|---|\n| file_edit | Read, Edit, Grep, Glob, Bash, Write | \"fix\", \"change\", \"edit\", file extensions |\n| search | Read, Grep, Glob, ListDirectory | \"find\", \"search\", \"where is\" |\n| git | Bash, Read, Grep, Glob | \"commit\", \"push\", \"branch\", \"git\" |\n| debug | Read, Grep, Bash, Glob | \"error\", \"bug\", \"why\", \"broken\" |\n| web | WebFetch, WebSearch, Read | \"url\", \"http\", \"website\" |\n| arch | Read, Grep, Glob, Bash, Agent | \"refactor\", \"structure\", \"design\" |\n| full | All tools | Ambiguous messages (fallback) |\n\nAmbiguous messages get all tools. No quality loss. Just in case.\n\nI tracked it for a week. Here's what I saw:\n\n| Metric | Before | After | Savings |\n|---|---|---|---|\n| Tokens per request | 1,200 | 300 | 75% |\n| Requests per day | 100 | 100 | — |\n| Tokens saved per day | — | 90,000 | — |\n| Monthly cost saved | — | — | $150 |\n\nAt 100 requests per day, that's 2.7 million tokens per month you're not paying for.\n\n**Clients:** Claude Code, Cursor, Windsurf, Cline, OpenCode, anything that uses Anthropic format.\n\n**Providers:** Anthropic API, AWS Bedrock, Google Vertex, OpenAI-compatible, anything that accepts Anthropic format.\n\nYou don't need a specific provider. Point it at whatever you're already using.\n\nRTK (if you're using it) solves a different problem:\n\n| Dynamic Tool Proxy | RTK | |\n|---|---|---|\n| What it filters | Tool definitions (schemas) | Tool outputs (results) |\n| When it filters | Before request sends | After tool runs |\n| Savings | ~12k tokens per request | Varies by output size |\n\nThey're complementary. Use both for maximum savings.\n\n**1. Most developers don't check their token usage**\n\nThey see the bill and accept it. They don't realize they're paying to send unused schemas to the model.\n\n**2. The biggest win is boring**\n\nIt's just filtering a list. No LLM calls. No complex logic. Just \"do you need this tool? no? remove it.\"\n\n**3. Local-first wins for developer tools**\n\nDevelopers want control. They want to see what's happening. They don't want another SaaS account with another API key.\n\n**4. Regex is enough**\n\nI thought I'd need LLM classification. I don't. Regex catches 90% of cases. Ambiguous messages fall back to full tool set. No quality loss.\n\nGitHub: [https://github.com/dvcoolarun/dynamic-tool-proxy](https://github.com/dvcoolarun/dynamic-tool-proxy)\n\nMIT license. Free forever. Your data stays local.\n\nStar it if this saves you money.\n\nDrop a comment. I'll answer every one.\n\n*Edit: Added streaming support. The proxy now passes through SSE streams unchanged.*", "url": "https://wpnews.pro/news/i-was-paying-to-send-27-unused-tools-to-claude-so-i-filtered-them", "canonical_source": "https://dev.to/dev_dc9eca0093606c9a4162e/i-was-paying-to-send-27-unused-tools-to-claude-so-i-filtered-them-48k1", "published_at": "2026-08-25 11:08:55+00:00", "updated_at": "2026-08-25 11:43:45.225310+00:00", "lang": "en", "topics": ["developer-tools", "ai-products", "ai-infrastructure"], "entities": ["Anthropic", "Claude Code", "Cursor", "Windsurf", "AWS Bedrock", "Google Vertex", "OpenAI", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/i-was-paying-to-send-27-unused-tools-to-claude-so-i-filtered-them", "markdown": "https://wpnews.pro/news/i-was-paying-to-send-27-unused-tools-to-claude-so-i-filtered-them.md", "text": "https://wpnews.pro/news/i-was-paying-to-send-27-unused-tools-to-claude-so-i-filtered-them.txt", "jsonld": "https://wpnews.pro/news/i-was-paying-to-send-27-unused-tools-to-claude-so-i-filtered-them.jsonld"}}