Show HN: Token Beggar, route coding agent subtasks to cheaper models A developer released Token Beggar, a plugin for Claude Code that routes large coding subtasks to cheaper models while the chat model keeps design, root-cause analysis and the final answer, cutting cost 1.42x on 18 real bug fixes with the same share of hidden tests passing (69% versus 70%). The plugin, version 0.3.0, runs locally in the user's Claude Code session, requires Python 3.10 or newer and uses only the standard library; it was tested on 18 merged pull requests from 12 open source Python projects including Django, Sphinx, pylint, sympy and click, with 3 runs per task and 54 per setup. Without Token Beggar the setup cost $0.69 per task at 1.00x, and the tool reports savings only above 1.15x because lower ratios fall inside run-to-run spread. English https://github.com/Arthur031221/Token-Beggar/blob/main/README.md | 繁體中文 https://github.com/Arthur031221/Token-Beggar/blob/main/README.zh-TW.md | 简体中文 https://github.com/Arthur031221/Token-Beggar/blob/main/README.zh-CN.md | 日本語 https://github.com/Arthur031221/Token-Beggar/blob/main/README.ja.md | 한국어 https://github.com/Arthur031221/Token-Beggar/blob/main/README.ko.md | Español https://github.com/Arthur031221/Token-Beggar/blob/main/README.es.md | Français https://github.com/Arthur031221/Token-Beggar/blob/main/README.fr.md | Deutsch https://github.com/Arthur031221/Token-Beggar/blob/main/README.de.md | Português https://github.com/Arthur031221/Token-Beggar/blob/main/README.pt-BR.md Token Beggar is a plugin for Claude Code. Before the big model does a job, it checks whether a cheaper model can do it just as well. Small tasks stay in the chat. A large task, such as fixing a bug in a repository you have not read yet, goes to one cheaper worker, and the chat then checks the whole diff and runs the tests. Design, root causes and the final answer stay with the model you picked. On 18 real bug fixes it cost 1.42x less quota and money than working alone, with the same share of hidden tests passing 69% against 70% . It runs on your machine, in your Claude Code session. It uses the Claude Code you are already signed in to, sends nothing about you anywhere, and writes only to its own folder. Exactly what it does https://github.com/Arthur031221/Token-Beggar/blob/main/docs/on-your-machine.md . Install install · Quick start quick-start · Results results · How it works how-it-works · FAQ faq · Docs documentation · Changelog https://github.com/Arthur031221/Token-Beggar/blob/main/CHANGELOG.md Tip Not sure it is working? Run token-beggar doctor . It lists what can quietly stop routing and exits 1 when something is broken. Needs Claude Code and Python 3.10 or newer. It uses the standard library only. From the marketplace in this repository inside Claude Code /plugin marketplace add Arthur031221/Token-Beggar /plugin install token-beggar@token-beggar Try it for one session without installing git clone https://github.com/Arthur031221/Token-Beggar claude --plugin-dir ./Token-Beggar From a shell, the same two steps as the first block claude plugin marketplace add Arthur031221/Token-Beggar claude plugin install token-beggar@token-beggar Restart the agent or run /reload-plugins . More in docs/install.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/install.md , including how to use the skill in another agent that reads skills. Work as you always do. On the first real prompt of a session a hook adds a short routing card, and the chat model sizes the task. At the end of a reply where something was routed and a saving was measured, you get one line: Token Beggar: about 1.4x less quota than Opus 5.5 high alone, saved about $0.21 est. | large task | routed 1: haiku medium x1 The multiple is the measured ratio of list price cost without Token Beggar over with it, for your model and effort. The dollars are the reply's own cost times that ratio minus one. Both are estimates and say so. The line never counts tokens, and under 1.15x it states no multiple, because that is inside the run to run spread. To switch it on for a prompt that did not trigger it, say /token-beggar . Then confirm the hooks run: token-beggar doctor Two setups, and only two. Without Token Beggar is the chat model working alone, the way you use it normally. With Token Beggar is the card shipped in this release, version 0.3.0. Opus 5.5 at high effort is the chat model. Cost is list price for the chat and every worker, cache included. Intervals are 95 percent. Hard tasks are 18 merged pull requests from 12 open source Python projects Django, Sphinx, pylint, sympy, click and others . The chat starts from the commit before the fix with the issue text, and is scored by the tests the maintainers added, which it never sees. 3 runs per task, 54 per setup. | Setup | Cost per task | Multiple | Issues resolved | |---|---|---|---| | Without Token Beggar | $0.69 | 1.00x | 70% | | With Token Beggar | $0.49 | 1.42x less 1.33 to 1.51 | 69% | 17 of the 18 tasks cost less with Token Beggar. The one that cost more structlog-exception-outside cost about 10% more. Without Token Beggar 70% of issues resolved, with it 69%: a tie within the spread, 54 runs per setup. Cost is down by 29 percent and the share of issues resolved is level 69% against 70% is a tie within the spread . Time is level too 168 seconds against 187 , not faster. 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. Full benchmark details, the task list and how to reproduce everything: docs/benchmark.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/benchmark.md . Every raw run is in benchmark/results https://github.com/Arthur031221/Token-Beggar/blob/main/benchmark/results . Important Where it helps and where it does not. It helps on large tasks with Opus 5.5 at high effort 1.42x, measured , and on every effort of Fable 5.1 and Opus at max, where small tasks measure a saving too. On Opus at other efforts and on Sonnet 5.5 it keeps small tasks in the chat and sends large ones to a worker. The large task saving is measured for Opus high only, so on Sonnet it is unmeasured and the footer then states the cost without a multiple. On Haiku 5.5, the cheapest model, it does nothing. If you mostly run small one-file edits, expect close to no change. 1. Look up the mode. The model and effort of your chat select one of three modes from data/measured.json . full the whole menu of models, efforts and outside tools where small tasks measured a saving of 1.15x or more, or the model was never measured. sized everywhere else. off for the cheapest model. token-beggar mode --all prints the grid, and TOKEN BEGGAR MODE=full|sized|off forces one. 2. Size the task. In sized mode the card says small means do it in the chat, and large means send one worker the whole reproduce, explore, fix and run the tests list. Large means an issue in a repository the model has not read, more than about 5 tool calls, more than one file, or an edit and test loop. A small task that grows past about 5 steps becomes large. 3. Check the worker's work. The worker reports in under 150 words and lists every site that shares the symptom. The chat reads the whole git diff , runs the tests, checks that list, and sends the same worker back if something is missing. 4. Respect the ceiling. The model and effort of your chat cap what the same vendor's models get. On Sonnet medium, nothing goes to Opus or to high effort. 5. Report. The Stop hook adds the footer. The model does not write it, so the number cannot be made up in prose. Where the thresholds came from: 1.15x is about the run to run spread seen in repeated runs, so a smaller ratio is not called a saving. The large task ratio of 1.42x is the hard benchmark above. Details in docs/benchmark.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/benchmark.md models-and-efforts . - Skill : the routing rules the chat reads. skills/token-beggar/SKILL.md https://github.com/Arthur031221/Token-Beggar/blob/main/skills/token-beggar/SKILL.md , explained in docs/usage.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/usage.md . - Hooks : seven small hooks that add the card, hold workers to the ceiling, guard compaction and add the footer. docs/on-your-machine.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/on-your-machine.md . - Worker : one agent with six tools that does the delegated job. agents/beggar-worker.md https://github.com/Arthur031221/Token-Beggar/blob/main/agents/beggar-worker.md , see docs/architecture.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/architecture.md . - CLI : token-beggar for doctor , mode , stats , inventory , ask and more. docs/usage.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/usage.md commands . It also guards long sessions. It finds the point where the host compacts the context, asks the chat to save a short note before it, can postpone an automatic compaction in the middle of a step, and puts the note back afterwards. See docs/architecture.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/architecture.md . Note Everything below is also in docs/on-your-machine.md https://github.com/Arthur031221/Token-Beggar/blob/main/docs/on-your-machine.md , with the hook table. - Reads : the transcript of the current session to count cost and find the context size and the model , the launch flags of the chat process through ps , and the environment and settings files for the model and effort. None of it leaves your machine. - Runs : seven hooks that call python3 -m token beggar hook