跳到正文
DEV Community· Arthur031221·· 3 小時前AI 評分65

Token Beggar 0.3.0 在 18 項 Python 修復任務中將成本降低約 29%,問題解決率持平

Token Beggar 0.3.0: on 18 real bug fixes it cost 1.42x less, with a tie on tests

AI 導讀

Token Beggar 作者發布 Claude Code 插件 0.3.0;在 18 項 Python 修復任務中,每項成本由 $0.69 降至 $0.49,問題解決率為 69%,與未使用插件的 70% 持平。

正文

I made a Claude Code plugin called Token Beggar, and today I released version 0.3.0 of it.

I kept running the biggest model at high effort for every step, even when the step was just reading a repo I had never seen. The bill made me curious, so I built something that checks whether a cheaper model can do the job first.

It uses the Claude Code you already have. No extra API, no extra account. It is still in development, and I would love feedback.

What 0.3.0 does

Before the big model starts, the plugin sizes the task.

  • Small tasks stay in the chat.
  • A large task, like fixing a bug in a repository you have not read yet, goes to one cheaper worker. The worker reproduces, explores, fixes and runs the tests.
  • Then the chat reads the whole diff, runs the tests again, and sends the worker back if something is missing.

Design, root causes and the final answer stay with the model you picked. Your chat model and effort are a ceiling, so nothing goes above them.

The result, in plain terms

There are two setups, and only two. Without Token Beggar is the chat model working alone. With Token Beggar is the card shipped in 0.3.0. The chat model is Opus 5.5 at high effort, and cost is list price for the chat and every worker, cache included.

The 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 only the issue text, and it is scored by the tests the maintainers added, which it never sees. 3 runs per task, 54 runs 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%

Cost per task went down about 29 percent. The share of issues resolved is level, and 69% against 70% is a tie within the spread. Time is level too (168 seconds against 187), so it is not faster. 17 of the 18 tasks cost less, and the one that cost more cost about 10% more.

Why this is not the 1.24x from my first article

My earlier article reported 1.24x cheaper overall. That came from a mix of 21 mostly small tasks, and the routing was different then. Small tasks save very little. Under about 1.15x I cannot tell a saving from run to run noise, so 0.3.0 keeps small tasks in the chat and only hands large ones to a worker.

That change is why the hard task number is bigger. It is also why I do not claim 1.42x for everything. Small tasks were measured only with the earlier card, and they saved little there (1.11x).

Install

You need Claude Code and Python 3.10 or newer. It uses the standard library only.

/plugin marketplace add Arthur031221/Token-Beggar
/plugin install token-beggar@token-beggar

Restart the agent or run /reload-plugins. To check that the hooks run, use token-beggar doctor. To turn it off, set TOKEN_BEGGAR=off for a shell, or uninstall the plugin.

It runs on your machine, writes only to its own folder, and sends nothing about you anywhere. The only network call is one weekly download of the vendor's public models page, to keep prices current.

The limits

I would rather you read these before you try it.

  • The hard benchmark covers one chat model and effort (Opus 5.5, high) and Python projects. Sonnet, Haiku and Fable on large tasks are not measured.
  • 69% against 70% resolved is a tie within the spread. A blind review by a small model rated the 0.3.0 diffs lower than working alone (0.94 against 1.33 on a 0 to 2 scale). It agrees only weakly with the tests, so I cannot say the code is as good.
  • 0.3.0 was not re-run on the small tasks, so expect close to no change on small one-file edits.
  • The footer estimate comes from a measured ratio, not from your own task.
  • On Haiku, the cheapest model, it does nothing.

The raw runs and the task list are in the repo, so you can check every number.

Repo: https://github.com/Arthur031221/Token-Beggar
Release: https://github.com/Arthur031221/Token-Beggar/releases/tag/v0.3.0

Assisted by Claude/Codex.

來源:DEV Community · dev.to