
bundlebox
io.github.blackswanalpha由 GitHub 账号 blackswanalpha 发布v0.8.0更新于 Oct 24, 2026
Where the work is, packed before the agent reads: brief, symbol tables, findings, token bill.
概览
本地 MCP 服务器,为编码代理提供预先生成的任务简报、符号查询、扫描发现和令牌用量统计。
- 可以做什么
- 为任务或未解决的发现生成定位、引用并受预算限制的简报,并可将其中一份设为守卫应答所用的活动简报,另提供范围或工作区的上下文与监督摘要,以及会话开始前的令牌成本估算。在编译好的符号表中查询声明,并用检测器扫描代码树,再读取生成的发现与解释。报告某次会话实际使用和节省的令牌,基于会话记录测量。扫描、打包和路由默认以试运行方式执行,只有 run 和 bridge send 会实际花费。
- 适用场景
- 当你用 AI 编码代理处理较大的代码库,希望减少其在定位和熟悉代码上消耗的令牌时适用:查找符号位置、确认变更内容、把工作打包成适合上下文窗口的单元。也适合需要对代理会话做令牌计量和验收检查的场景。
- 运行要求
- 以 npm 包 bundlebox 通过 stdio 在本地运行(npx bundlebox mcp)。需要 Node 20 或更高版本以及 git;支持 Linux、macOS 和 Windows。可选的 Rust 内核与索引组件以及 Python 3.9+ 专家系统可提升速度,但并非必需。未声明任何 API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 bundlebox,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
bundlebox
The zero-token software factory for AI coding agents.
Scan, pack, route and run work across Claude Code, Codex, Gemini CLI, Cursor, Copilot, OpenCode, Aider and any custom agent, and measure every token a session used and was spared.
An AI coding agent is billed for what it reads, and most of what it reads is orientation, not judgement: where a symbol lives, whether two tables agree, which command proves a change, what changed since last week. bundlebox answers every question a parse, a count, a path check or a set difference can answer before the agent opens, packs the answers into a brief sized to the agent's window, opens the agent under a measured-minimal flag stack, and measures afterwards what the session used and what it was spared. It never calls a model itself.
Measured on the reference workspace (regenerate with bb session, bb tokens profile --probe, bb buckmaster episodes):
Install
Needs Node ≥ 20 and git. Linux, macOS and Windows are supported: CI runs the full suite on all three against Node 20, 22 and 24. Two known gaps remain on Windows — a piped acceptance gate reports the last command's exit code rather than the first failure, because cmd.exe has no set -o pipefail (unpiped gates are exact), and bb session may not find transcripts, because the name Claude Code gives its projects directory there has not been verified. Three optional Rust and Python components make it faster and smarter, and
everything degrades cleanly without them:
- Rust kernel (
bbk): tree walks, fingerprints, token estimates, duplicate windows, symbol indexes, acceptance gates with real timeouts, worktrees.bb kernel installfetches a release binary;bb kernel buildcompiles it with cargo. Without it the JS implementations run, and a selftest pins both to identical answers. - Rust index compiler (
arc): compiles the derived symbol tables into one binary index the read and search guards answer from, 13x faster than scanning the tables in a cold hook process.bb arc build, recompiled bybb snapgen buildwhen the tables move. Every reader falls back to scanning the tables when the index is absent, truncated or not an index, because "there is no index" and "nothing is declared" are different answers. - Python expert system (
bundlebox_expert, stdlib only): the rule engine with explainable derivations, confidence shrinkage, transcript signals, the process model and memory.bb buckmasterneeds python3 ≥ 3.9; nothing in the zero-token path does.
There are no npm dependencies. A cron worker at 03:00 runs what is on disk or it does not run.
Start here
From a document instead of from the code:
Every verb is a dry run until --apply. Only run and bridge send can spend.
Wiring into agents
bb wire --apply installs four things per agent detected on the box: an
instruction block between markers, hooks where the agent supports them, skills
where it loads them, and an MCP server entry. bb unwire removes only its own
blocks, entries, hook rows and skills.
Two skills ship and cost nothing until they trigger, which is the property an
instruction block does not have: it arrives in every system prompt and is billed
whether the session was about it or not. bb-finish is completion discipline
backed by runnable gates; antislop is the prose ruleset with what each rule
costs and what to write instead.
bb mcp serves bb_pinpoint, bb_context, bb_snapgen, bb_findings,
bb_scan, bb_oversight_brief, bb_explain, bb_tokens_estimate and
bb_session over stdio as JSON-RPC 2.0, with no dependency.
bb wire --apply writes the entry for every agent in the table above. For an
agent it does not manage:
Claude Code takes it as one line, or as a plugin, which carries the two skills and the hooks with it:
Full guide, including the agents not in this table, how to wire one bundlebox
does not know about, and how to drive agents as lanes:
docs/agents.md. bb uptake then reports which of the
installed surfaces the sessions reached for.
Advisory lost; enforcement is the fix
bb uptake measured the gap. Over 15 sessions on this workspace the MCP tools
fired in 0, pinpoint in 3 of the 13 sessions that opened five or more distinct
files, and the reference tables in 5 of the 15 that ran a search. Those 13
sessions opened between 30 and 598 files each. Everything wired in front of the
agent was a recommendation, and a recommendation loses to the model's own habit
about three times in four.
So the wiring changed kind.
Run it, do not recommend it. UserPromptSubmit builds the brief itself on a
task-shaped prompt — 0.47s against a 15s budget, because every input pinpoint
reads is a stored artefact and it computes none of them. What enters the window
is the map, about 300 tokens.
Serve what it found. PreToolUse denies a read whose region the brief already quotes and hands the quote back in the denial reason; denies an exact duplicate read; denies a declaration search the symbol tables already answer and hands back the rows; and asks before opening a file that was cut for budget. A file in scope is never fully blocked — Claude Code needs one successful read before it will edit, so the denial names the range and that read is allowed. Grep is the declared tool and Bash is where the measured transcripts search, so both are guarded.
Rank on specificity and path. Enforcing a brief raises the cost of a bad
locate. Inverse document frequency over the candidate set stops an exact match on
a name the tree uses everywhere from outscoring a loose match on a rare one, and
a directory named wire now counts as evidence about what a file is for. An
explicitly named file is pinned first rather than scored.
The verbs
The budget model
Overhead is probed, not assumed. Payload is the located region plus a widening
allowance when a symbol is named, not the file. Churn is the term everyone
forgets and it measures near 2.4. Reserve is per kind of unit. The verdict is
FITS, TIGHT, SPLIT or HEAVY, and a split respects directory locality.
Five levers act on those terms, in measured order: the lean flag stack, region
not file, say it once, a cache-stable prefix, and optionally a local compression
proxy on the wire reported on its own row. See EXPLANATION.md.
Measured vs estimated
Two kinds of number appear in every report and are never added: used and
cache-saved are measured off the transcript; automation-saved is an estimate
printed as a range. A model with no price is reported with tokens and no cost.
A verb that could not look says unknown. A unit with no acceptance is
unproven, not passed.
There is a third number and it is measured on both sides. bb bench runs the
same task twice — once with the factory in front of it and once without — and
reports the difference:
BARE greps the tree for the task's terms, reads the search output and opens a
range around the first hit in each of the top files, which is what a session
does on a box where nothing is installed. PACKED is the
one bb pinpoint prompt for the same task. Both arms are counted by the same
estimator over text on disk, so neither calls a model and a second run on the
same tree returns the same number. A task that costs more packed than bare is
printed in the table, not dropped.
Every bb pinpoint brief carries one more section, and it is the one worth
reading first: what this brief does not settle. No gate detected, nothing in
the symbol tables matched, no region located, no evidence on file, a scope that
had to be cut to fit — each is stated with its reason rather than filled in by
guessing, and scored so two briefs can be compared. A question costs one turn;
a wrong assumption costs the review that catches it.
The console
bb console serves one read-only page for the workspace on
127.0.0.1:7788, and bb console build writes the same page as a single
file with the state embedded. It binds to loopback, has no write route, and
nothing on it calls a model.
It pushes rather than polls. The store is files, so the filesystem already
knows when something changed: /api/stream watches it, recomputes the state
once per change however many tabs are open, and sends it. A 10s timer was wrong
in both directions — a run that finished was invisible for nine seconds, and an
idle workspace recomputed everything six times a minute per open tab. The header
always says which state the connection is in (live, polling,
reconnecting, static), because a dashboard that cannot tell you it has lost
the server is worse than one that is plainly offline: the stale numbers still
look like numbers.
Architecture
The kernel runs a corpus on threads with one connection per worker and a shared
pacer; a 130-step corpus that takes two minutes paced against a real limiter
takes under a second against a local mirror. It speaks http only, because TLS
would be a dependency it must build without — the JavaScript engine runs when
the base is https, when the kernel is absent, or when a corpus uses a pattern
outside the kernel's documented subset, and the board names which engine ran and
why. test/scenario.test.js pins the two to identical answers.
The three runtimes agree by test: test/kernel.test.js and
test/expert.test.js pin the kernel and the expert system to the JS answers.
One implementation per fact where only one runtime has it; parity where two do.
Configuration
One file, .bundlebox/config.json, holding only the keys you changed. Every
default lives in src/core/config.js with its reason. Measured values live in
.bundlebox/var/calibration.json and are written by read-merge.
Documentation
- docs/agents.md: integrating bundlebox into every agent, and running work through them
- docs/index.html: the reference site
- EXPLANATION.md: the thesis, the flow, what changed from the original
- whitepaper/bundlebox-whitepaper.md
- docs/review-of-the-original.md: the defects found in the reference implementation
- docs/prices.md: price table provenance
- docs/prior-art.md: seven projects read, what came back and what did not
- CHANGELOG.md and changelogs/
- CONVENTIONS.md: how the code is organised, for contributors
Releases
Tags vX.Y.Z on main build the kernel for five targets, publish to npm with
provenance, and create a GitHub release with the binaries and the changelog.
bb update checks the registry at most once a day; bb update --apply installs.
License
MIT. src/finish/vendor/ is vendored from
Leonxlnx/unlazy 2.1.0 (MIT, commit
1667149), renamed and otherwise untouched;
src/finish/vendor/PROVENANCE.md records every
rename and why nothing else moved. bundlebox began as a stdlib-Python factory wired into one workspace; this
package is its portable core, rebuilt and corrected. The optional wire
integration talks to headroom
over the process boundary and never imports it.
来源:README.md,提交 80415c2
工具
0版本历史
2- v0.8.0最新Sep 23, 2026
- v0.7.1Sep 22, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分