Token Beggar, route coding agent subtasks to cheaper models
A new plugin for Claude Code called Token Beggar routes coding tasks to cheaper AI models while maintaining quality, reducing costs by up to 42% on complex jobs.
Token Beggar is a plugin for Claude Code that intelligently routes coding tasks to cheaper AI models when possible, reducing costs by up to 42% on complex jobs while maintaining similar quality. The plugin works by checking whether a cheaper model can handle a task just as well as the more expensive one before assigning the work. Small tasks stay within the chat interface, while larger tasks are delegated to a cheaper worker model.
According to benchmarks conducted by the developer, on 18 real bug fixes, the plugin cost 1.42x less quota and money than working alone, with nearly identical success rates (69% against 70% of hidden tests passing). The plugin runs locally on a user's machine within their Claude Code session, using the existing login credentials without sending any user data elsewhere.
How It Works
The plugin operates through three main modes: 'full' for tasks where small tasks showed savings of 1.15x or more, 'sized' for other scenarios, and 'off' for the cheapest models where no savings are possible. In 'sized' mode, the system determines whether a task is small (handled in chat) or large (delegated to a worker). Large tasks are defined as issues in repositories the model hasn't read, requiring more than 5 tool calls, involving multiple files, or forming an edit-test loop.
Small tasks were measured only with an earlier card, not with 0.3.0. They saved little there (1.11x, under the 1.15x line at which a saving is claimed), and they stay in the chat, so expect close to no change on small one-file edits.
Performance and Limitations
The plugin showed significant cost reductions on hard tasks, with 17 out of 18 bug fixes costing less when using Token Beggar. The one task that cost more (structlog-exception-outside) was about 10% more expensive. While costs decreased by 29%, the success rate remained nearly identical (69% against 70%), and processing times remained similar (168 seconds versus 187 seconds).
The plugin has specific limitations: it provides little benefit for small one-file edits, doesn't work on the cheapest model (Haiku 5.5), and hasn't been fully tested on Sonnet or Fable models for large tasks. The developer notes that while the code quality was comparable in blind reviews, the plugin doesn't guarantee equal quality across all scenarios.
Implementation and Privacy
Token Beggar installs directly into Claude Code and requires Python 3.10 or newer. It operates entirely locally, reading only the current session transcript, process flags, and environment settings. The plugin writes only to its own folder (~/.claude/token-beggar) and can be easily disabled through environment variables or plugin uninstallation.
The plugin includes a diagnostic command ('token-beggar doctor') to check functionality and identify issues that might prevent proper routing. Users can also manually trigger the plugin with '/token-beggar' for prompts that didn't automatically activate it. The system respects model ceilings, ensuring workers don't exceed the capabilities of the selected chat model.