harness-offload

中文文档
0.2.1发布于 2026/11/04MITES Module

The harness offloader: keep bulk I/O out of your coding agent's context by delegating it to cheap models you already pay for.

原始使用文档
文档目录8 节
  1. Install
  2. What it saves
  3. How you use it
  4. How it works
  5. Docs
  6. Contributing
  7. Acknowledgements
  8. License

Harness Offload

Keep huge files, long logs and repo-wide searches out of your coding agent's context.
A small model on the plan you already pay for reads them and hands back the answer, with every line reference checked.

ci npm license: MIT

Claude Code · Codex · Gemini CLI · Copilot CLI · Cursor · OpenCode · Pi · Qwen Code · Crush · Kilo · Windsurf · any MCP client

A coding agent tries to read a 919-line file; Harness Offload blocks it with an outline, Haiku answers the question with seven checked citations, and a 2,323-line CI log becomes a short digest

Real outputs, replayed: worker claude:haiku on a Claude plan.

Install

npx harness-offload@latest install

It asks which of your agents to set it up in (Claude Code, Codex, Cursor, Gemini CLI, Copilot CLI, Qwen Code, Crush, Pi, OpenCode, Kilo — the ones it finds are ticked) and whether for all your projects or just this one, shows exactly what will change, and installs only after you say yes. Each agent then reads with its own small model on the plan you already pay for: Claude Code → Haiku, Codex → gpt-6-luna, Gemini CLI → Flash-Lite…

Only Claude Code? claude plugin install harness-offload --marketplace levgiorg/harness-offload

What it changes, and where
AgentWhat happensWhere
Claude Codeclaude plugin install … --scope user (or project)managed by Claude Code (~/.claude, or the project's .claude/settings.json)
Codex · Copilot CLI · Qwen Code · Pi · Devintheir own plugin/extension commandmanaged by each agent
Gemini CLIa new extension folder~/.gemini/extensions/harness-offload/
Cursora copy of the plugin~/.cursor/plugins/local/harness-offload/
OpenCode · Kiloone one-line plugin file~/.config/opencode/plugins/, ~/.config/kilo/plugin/
Crush2 hooks and a guide added to your settings (backup kept)~/.config/crush/crush.json
Offload itselfits own copy, so agents don't depend on the npx cache~/.local/share/harness-offload/

Nothing runs at npm install time; only install changes anything. Details per agent: docs/hosts.md.

  • Check: npx harness-offload doctor · Update: run the install command again (it says updated 0.2.0 → …)
  • Change who reads (another model, an API key, a local model): npx harness-offload model … (18 providers + local), or /harness-offload:setup in Claude Code
  • No questions (scripts, CI, or from inside an agent): npx harness-offload@latest install --yes [--agents claude,codex] [--scope project]
  • Remove: npx harness-offload uninstall (asks; your settings stay unless you say so) · Claude Code alone: claude plugin uninstall harness-offload@harness-offload
  • Let your agent do it: paste "Run npx harness-offload@latest install --dry-run, show me what it would change, then run it with --yes --agents <this agent>."

What it saves

Your agent asked forWould have readGot backFacts found
Questions about a 919-line module9,666 tokens402–4124 / 4
A 2,323-line CI log with two failures32,771651–6653 / 3
Pytest file written from a reference test7595230 / 30 and 24 / 26 tests pass¹

Measured 2026-11-02 with Haiku as the worker, on both engines (a range = the two engines) — docs/VALIDATION.md. ¹ The two failures were wrong expected values in the generated tests: review what write produces.

How you use it

You mostly don't: hooks catch the expensive moves and steer the agent. When you or the agent want it directly:

offload read -q "how are late fees applied?" src/ledger.ts   # answer + checked path:line citations
offload explore "where is the retry policy configured?"      # read-only search across the repo
offload run -- npm test                                      # long output → digest + verbatim errors
offload task review-sql src/db/                             # your own task: your instructions, checked citations
offload dashboard --open                                     # what stayed out of your context

Your own tasks are a few lines of config — docs/commands.md.

The offload dashboard: tokens kept out of context per day, breakdowns by kind and model, and citation checks (example data)

How it works

  1. A hook holds the big read back. A full read over 600 lines (or a cat of one) gets an outline and cheaper options instead.
  2. A small model reads it. offload sends the file to the worker with deny-all permissions and secrets removed.
  3. The answer is checked. Every path:Lx-Ly must quote text that really is there, or it is flagged.
  4. Noisy output becomes a digest. Verbatim error lines and the tail come from a script; the model only adds a summary.

Everything fails open: if no worker is available, your agent's tools work as before.

Docs

Harnesseswhat each integration does, install notes
Backends@host, OpenCode, Codex, Gemini, Copilot, Qwen, Crush, Pi, API keys, local models, fallbacks
Commandsevery command, exit codes, troubleshooting
Configurationthresholds, guard modes, per-project settings, privacy
How it worksdesign, caveats, why the numbers are estimates
Comparedhow it differs from RTK, squeez, context-mode, shunt and model routers
Performancewhat the hooks cost per tool call, with and without offload (measured)
Securitytrust model, worker lockdown, known limits
Developmenttests, layout, releases

Contributing

PRs welcome — CI runs both engines' conformance suites, the routing table, the TypeScript tests on three OSes and lint on every pull request. See CONTRIBUTING.md.

Acknowledgements

Harness Offload is original MIT-licensed code. Its ideas were shaped by Spotify's "shunt" plugin (Apache-2.0, in spotify/portal-ai-plugins), which routes large reads to cheaper models through coding-agent hooks; OpenCode's headless opencode run; the hook and plugin systems of Claude Code, Codex, Cursor, Gemini CLI and Pi; Boris Cherny's notes on goal- and loop-driven agent workflows; and community research on token savings (JetBrains' study of output compressors, the LogDx-CI benchmark). No third-party source code is included. The stats report embeds latin subsets of the Archivo, Public Sans and Courier Prime typefaces (SIL Open Font License 1.1; notices in LICENSE-FONTS).

License

MIT

版本与发布记录

harness-offload 共发布 3 个版本,首次发布于 2026/11/04;过去 12 个月发布了 3 个版本。

版本发布日期距今
0.2.1latest2026/11/04今天
0.0.0-stage2026/11/04今天
0.2.02026/11/021 天前

关于 harness-offload 的常见问题

harness-offload 是什么?

线束卸载器:通过将批量I/O委托给您已经付费的廉价模型,将其排除在编码代理的上下文中。

如何安装 harness-offload?

在项目目录运行 npm install harness-offload,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 offload、harness-offload,可以用 npx offload 直接运行。

harness-offload 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/harness-offload 是否存在。

harness-offload 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

harness-offload 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

harness-offload 可以商用吗?

harness-offload 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

harness-offload 还在维护吗?

最新版本 0.2.1 发布于 2026/11/04(今天);至今共发布 3 个版本,其中过去 12 个月发布了 3 个;首次发布于 2026/11/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。