Huashu Design
alchaincyf · 技能
把你在 AI 智能体里写的一句话需求,变成一份完成的设计:发布动画、可点击的应用原型、可编辑的幻灯片、信息图,或一组小红书图片。可在多种智能体中使用。

ranxianglei 做的本地代理,用于编程智能体的长会话。它把旧的对话折叠成以后还能展开的摘要,让一个会话在小窗口里也能连续跑上好几天。支持 Claude Code、Codex、OpenCode、pi、DeepSeek 的 dsh,另外还支持大约二十个客户端。
Billion Context 上下文压缩代理 是一款 GitHub 上的开源项目,属于开发类,由 Mindket 上架。可免费获取。当前为第 2 版,最近更新于 。按它的 README 从 GitHub 安装。Mindket 的设置说明可在你的 Mindket 账户获取,以 zip 压缩包下载。
npm install -g billion-context --prefix=~/.local
用在哪里里还有 2 个
Billion Context is a proxy that runs on your computer between a coding agent and the model it calls. The model gets four tools to manage its own history: compress, decompress, search_context and acp_status. It folds a range of old messages into a summary, and it can unfold that range or search the summaries when exact detail matters. Its maker, ranxianglei, describes it as a context-compression plugin for month-long single sessions, small context windows (a 100K window is enough) and token savings (5x fewer tokens). Those figures are the maker’s claims.
Developers who leave a coding agent on one task for hours or days and watch old tool output fill the window. It also suits people on models with small windows. People who pay per token get a cache report that shows what each fold saved. Skip it if your sessions are short, or if you do not want a local proxy that updates itself. Exact recall of one sentence buried in a huge document is also weaker: the maker’s own benchmark loses ground there.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Software teams | Developers running long agent sessions | Route the agent through the proxy so old tool output is folded away as the session grows | A developer on a long refactor keeps one session going instead of restarting when the window fills. |
| Smaller or cheaper models | People whose model has a window of 100K or less | Let the model compress its own history so a small window stays usable | A user on a 100K model keeps working past the point where the full history would not fit. |
| Agent research | People testing very long agent tasks | Put the proxy in front of the agent to test long-horizon memory | The benchmark in its repository fed a 1.48M-token log through it, where the run without compression failed. |
The README names 21 clients in its table and lists launchers for three more. The topic dsh-plugin on the repository points at dsh, an open-source project from DeepSeek AI for running agents. A client connects by one of three routes.
| Client | Route | Note |
|---|---|---|
| Claude Code | Launcher, native install or plugin marketplace | With the native install, the Claude Desktop app’s Code tab bypasses the proxy |
| Codex CLI | Launcher | The plugin install alone adds tools but routes no traffic |
| OpenCode, pi, omp | Launcher or native install | Native install turns OpenCode’s own auto-compaction off |
| DeepSeek’s dsh | Launcher or dsh plugin add | dsh’s own auto-compaction is turned off |
| Kimi Code, Hermes | Launcher or native install | The Kimi Code native install needs 2.0.0 or later |
| ZCode | Native install, or a proxy and CA path set in its settings | It has no bili launcher |
| Gemini CLI, Qwen Code, aider, Copilot CLI, goose and others | Launcher, and for several the URL prefix | No native plugin. A personal Google login for Gemini CLI is not covered |
| Cline, Roo Code, Continue, OpenHands, Cursor, Warp | URL prefix | Works with an API key, not a sign-in |
Get it saves a zip of Minda’s setup notes in your downloads folder, with each client’s steps from ranxianglei’s README and docs. The main route is one npm install, then one command for your client.
| Need | Detail |
|---|---|
| Node.js | 20 or later, as the package’s engines field says. Below 22.5 the session index downloads a SQLite engine from the npm registry once, about 11 MB |
| A coding agent | One from the table above, signed in or holding your own API key |
| Ports | A manually started proxy uses 8787. Launchers and native plugins start their own from 18787 up |
npm install -g billion-context --prefix=~/.local
npm install -g billion-context
The launcher is the lightest route. It edits no config, and traffic goes direct again the moment you stop running the command.
bili claude
Claude Code can also add it from inside a session, as a plugin marketplace.
/plugin marketplace add ranxianglei/billion-context /plugin install billion-context@billion-context /billion-context:bili-setup
Work in your client as before. The model decides when to compress. By default the proxy nudges it as the conversation grows, in steps of about 50K tokens. It also folds on its own as a hard backstop when a request alone would overflow the window. The first fold comes 50K tokens past the starting content, so a large system prompt and tool list push it later.
In OpenCode, dsh and Hermes, typing /acp shows the status panel for the current conversation. The /acp-cache command prints a cache report with a health verdict and the net tokens saved per fold. The maker’s rule of thumb: compression itself costs 2 percent or less, and a healthy session sits at 95 to 97 percent cache hits. A local page at http://localhost:8787 adds logs and a config editor.
You use Claude Code with an API key and want proof that the proxy answers before a long session, so you start it in one terminal and ask for its health from another.
# terminal 1 bili # terminal 2 curl -s http://localhost:8787/__bili/health
The README shows this answer, naming the upstream the proxy forwards to:
{"ok":true,"upstream":"https://api.anthropic.com"}Then you point Claude Code at the proxy and send a message. In this manual mode CONFIGURATION.md also asks you to set CLAUDE_CODE_AUTO_COMPACT_WINDOW to bili’s window for your model, so Claude Code’s own auto-compact does not fire first.
export ANTHROPIC_BASE_URL="http://localhost:8787/bili/https://api.anthropic.com" claude
As the conversation grows, the log at ~/.local/state/billion-context/bili.log shows a line for each round and a compress event, in the README’s format:
[acp-usage] round N input=X cached=Y (cache hit Z%)
新手:A model can only read so much at once, and a long coding session eventually passes that limit, after which the README says the session degrades or dies. Billion Context lets the model fold old parts into summaries and unfold them again. Start small. Try the launcher with the one agent you use daily, on a throwaway project.
专家:With a native plugin or a launcher, the agent registers the tools and runs compress itself. On the plain URL route the proxy runs compress on its side. Session state is keyed on the conversation id the client gives, such as Claude Code’s x-claude-code-session-id header. A client that sends none gets prefix affinity, which reattaches a request only when its history matches a stored session byte for byte.
By default the model your agent already uses writes the summaries. An optional external summary chain in the config names up to 16 other models, each with its own key. It never falls back to the main model when a reference does not resolve.
That run sits in the repository’s benchmarks folder, which calls it an independent third-party evaluation of version 0.1.202 with DeepSeek V4.1 Flash as the base model. It names no evaluator and is published in the maker’s own repository, so read it as the maker’s claim. The same write-up reports 71.1 percent lower cost than full context for independent sessions, and a 1.48M-token test where full context failed on all 199 items. Its trade-off line says exact needle questions fall from 69.0 percent for full context to 27.0 percent.
The proxy sees every prompt and reply you route through it. It also changes itself over time.
这个工具包里只有安装说明,由 Mindket 编写。Billion Context 代理和它的插件要从 ranxianglei 的仓库安装,地址是 https://github.com/ranxianglei/billion-context
这些说明不是 ranxianglei 写的,也没有得到 ranxianglei 的认可。LICENSE 文件和包的条目都把 ranxianglei 列为作者。
许可证:MIT 加一条附加条款。LICENSE 文件开头是“Copyright (c) 2026 ranxianglei”和 MIT 文本,后面加了一条标题为“Attribution on Product Surfaces”的附加条款。来源见 https://github.com/ranxianglei/billion-context/blob/master/LICENSE
因为这条额外的条款,GitHub 没有把这个文件识别为某种标准许可证。npm 包的条目 https://registry.npmjs.org/billion-context/latest 写的是 MIT。README 的原话是“This project is MIT-licensed plus one additional term”。用大白话说,这条条款要求:
按我们的理解,用这个代理配合你自己的编程智能体,并不是在为别人做产品,所以这条条款关系到的是在它之上发布东西的人。Mindket 上架的只是链接到仓库的说明,不包含这个软件的任何部分。在它之上做东西之前,请先读 LICENSE 文件。这些说明不构成法律意见。
billion-context。它会把 bili 命令加进你的 PATH,bili-proxy 是它的别名。bili 是一个本地代理,夹在你的编程智能体和它的模型 API 之间。它往对话里加入四个上下文工具(compress、decompress、search_context、acp_status),并把旧消息折叠成摘要。bili plugin install <client>)bili <client>)http://localhost:8787/bili/engines 字段写的是 >=20,见 https://registry.npmjs.org/billion-context/lateststorage.sqliteAutoDownload 可以关掉这一步。来源见 https://github.com/ranxianglei/billion-context/blob/master/CONFIGURATION.mdnode:24-slim 基础镜像,并告诉你不要把镜像换成 Node 20。见 setup/docker.md。bili start 或直接运行 bili)占用 8787。原生钩子或启动器会在另一个从 18787 开始的区间里启动自己的代理。Linux 和 macOS,用用户级前缀(不用 sudo):
npm install -g billion-context --prefix=~/.local
Windows,以及用 nvm 或 Homebrew 装的 Node,默认前缀本来就是用户可写的:
npm install -g billion-context
README 说,在 Linux 和 macOS 上,bili 命令会装到 ~/.local/bin。如果它还不在你的 PATH 里,就把 export PATH="$HOME/.local/bin:$PATH" 加进 ~/.bashrc 或 ~/.zshrc。
README 列出了下面这些位置,都在你的用户主目录下。根 CA 的路径出自 CONFIGURATION.md。
~/.config/billion-context/billion-context.json~/.local/share/billion-context/~/.local/state/billion-context/bili.log,满 10 MB 时轮换~/.local/share/billion-context/ca/root-ca.pem根 CA 对你意味着什么:一个设置成信任它的客户端,会让代理能解密这个客户端发往你模型服务器的 HTTPS 流量,读到提示词和回复。CONFIGURATION.md 说,这个 CA 是在你的电脑上生成的,不是装进整个系统的,只有你指向它的那个客户端信任它。它还说只解密列出的模型服务器,其他所有 HTTPS 流量仍然加密,原样经隧道通过。根 CA 能签发证书,所以要像保管密码文件一样保管好 ca 文件夹。删掉 CA 文件再重启代理,就会生成新的。Claude Code 的启动器走 /bili/ URL 途径,不需要 CA。
会话文件里存着对话内容。CONFIGURATION.md 说,除非你设置 BILI_ENCRYPTION_KEY,这些文件都是普通 JSON。默认会在旁边写一个 SQLite 索引(index.db),清理旧会话则要你自己开启(BILI_SESSION_GC=1)。本地网页 http://localhost:8787 和 /__bili/* JSON 端点都只监听本机回环地址,没有登录。
除了你的模型流量,README 和 CONFIGURATION.md 还描述了代理自己去获取或执行的五件事。
ACP_AUTO_UPDATE=0 关掉它,或者用 --no-auto-update 只关这一次运行。auto-update-policy.json。CONFIGURATION.md 的原话是“Zero telemetry: plain GET, no query parameters, no device id.”,意思是不做遥测:普通 GET 请求,不带查询参数,也不带设备 ID。billion-context-advisories。一条匹配的公告即使在自动更新关闭时,也能强制安装某个指定版本。用 BILI_ADVISORY_CHECK=0 关掉它。CONFIGURATION.md 里“zero telemetry”这句话,说的只是策略文件的那个请求。2026 年 11 月 2 日读到的 README、CLIENTS.md 和 CONFIGURATION.md 都没有更宽泛的遥测说明,既没说有,也没说没有。
Docker 镜像默认关闭自动更新(ACP_AUTO_UPDATE=0)。
bili update 会检查并安装新版本,不受频率限制。bili plugin remove <client>。配置快照会存到 .bili-bak。/bili/ 前缀,流量就立刻恢复直连,这是 README 常见问题里的说法。bili sessions rm <id>。bili sessions ls 会列出所有会话。README.md 8 KB setup/claude-code.md 3 KB setup/codex.md 2 KB setup/docker.md 2 KB setup/dsh.md 3 KB setup/gemini-family.md 2 KB setup/hermes.md 2 KB setup/kimi-code.md 1 KB setup/omp.md 1 KB setup/opencode.md 2 KB setup/other-launchers.md 3 KB setup/pi.md 2 KB setup/url-prefix.md 3 KB setup/windows.md 2 KB setup/zcode.md 2 KB
Updated by Mindket to the current version of this kit.
同一分类里与本产品共有主题最多的已上架 GitHub 项目。
| 产品 | 星标 | 活跃度 | 语言 | 许可证 | 最近更新 |
|---|---|---|---|---|---|
| Billion Context 上下文压缩代理 本页 | 6,358 | 活跃 | TypeScript | — | |
| Archify共有 dsh-plugin | 94,756 | 活跃 | JavaScript | Apache-2.0 | |
| Ruflo 智能体协调层共有 dsh-plugin | 81,187 | — | — | MIT | — |
Hacker News、Bluesky、X、Reddit、Facebook 和 YouTube 上提到这个项目的帖子和评论,来自每周一次的搜索和 Trendshift。它们不是 Mindket 写的,也未经核实,点开即可在原帖处阅读。
alchaincyf · 技能
把你在 AI 智能体里写的一句话需求,变成一份完成的设计:发布动画、可点击的应用原型、可编辑的幻灯片、信息图,或一组小红书图片。可在多种智能体中使用。
op7418 · 技能
能生成单文件 HTML 幻灯片、幻灯片配图和多平台封面的技能,有两套视觉风格,还带演讲者模式用于排练。适合使用 Claude Code 或 Codex 的演讲者。
alirezarezvani · 技能
为 Claude Code 和其他编程智能体提供 411 个现成技能,按角色分组,从工程、产品到营销、财务和合规。以插件方式安装。适合开发者和业务团队。
block · 工具包
可自行托管的工作空间,人和 AI 智能体在同样的房间里协作,基于 Nostr 中继,把每个动作记录为签名事件。适合想自己运行中继的团队。
backnotprop · 工具包
把你的 AI 编程智能体的计划、规格和代码改动在浏览器里打开,让你加批注或评论,并把反馈直接发回给智能体。
alibaba · 工具包
用 AI 智能体审查 Git 改动:它会读取文件、搜索代码库,再写出对应到具体行的审查意见。适合想在命令行里自动做代码审查的开发者。