
offload
io.github.tailucanhPublished by GitHub account tailucanhv0.2.1Updated Nov 8, 2026
Hand heavy read-only work to a background agent CLI (Antigravity) and read back a short report.
Overview
Lets a coding agent hand heavy read-only codebase reading to a background worker agent CLI and read back only a short report.
- What you can do
- Submit background reading jobs with a task brief, ordered steps, output hint, done condition and scoped paths
- Check job status, list recent jobs, and read the Summary, Findings, step log or full report page by page
- Cancel a queued or running job and its whole process tree
- Scope each job to git-listed files, record the worker's token count, and flag files whose git status changed
- When to use it
- Useful when the reading needed is far larger than the answer, such as inventorying every endpoint, config key or call site across a tree, or scanning minified bundles, lockfiles and long logs. Not meant for edits, quick one-or-two-read lookups, or urgent work, since jobs take minutes.
- Requirements
- Node.js 20.3 or later and Git. A worker CLI that takes a prompt and prints an answer, by default the Antigravity CLI installed and signed in with a Google account; any such CLI can be configured instead. An MCP client that launches stdio servers, such as Claude Code. A config file at ~/.offload/config.json or the path in OFFLOAD_CONFIG.
Installation
In SourceWeft
- Open offload in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Tiếng Việt · Español · Français · Deutsch · Português (Brasil) · Русский
offload-mcp-server
Let your main coding agent delegate heavy reading to a second agent, and read back only the answer.
Claude Code asks. The Antigravity CLI reads 37 files. Claude reads 500 tokens.
[npm] [MIT license] [Node.js 20.3+] [MCP server] [TypeScript] [Worker: Antigravity CLI] [GitHub stars]
Quick start · How it works · What to offload · Setup · Results · Troubleshooting · FAQ · Security
npx -y offload-mcp-server setup
[!IMPORTANT] The official source is github.com/tailucanh/offload-mcp-server. The npm package is
offload-mcp-server. A package or repository with a similar name is not this project.
Coding agents spend most of their context reading: walking a source tree, scanning logs, opening a minified bundle to find one function. When the answer is a paragraph and the reading is 40,000 tokens, that is a poor trade.
offload-mcp-server is a small MCP server that gives your main agent four tools to hand that reading
to a second agent CLI running in the background, by default Google's Antigravity CLI (agy) with a
read-only worker agent. The worker reads the files on its own quota and writes a fixed-format report.
Your main agent reads the Summary (a few hundred words), and pulls the Findings with path:line
evidence only when it needs them.
- Asynchronous. Submit a job, keep working, collect it later. Several jobs can run in parallel.
- Read-only by design. The worker agent has file-reading tools only, and the server reports any file
whose
git statuschanged while a job ran. - Scoped. The server lists the files in scope (
git ls-files) for the worker, so it does not wander. - Backend-agnostic. Any CLI that takes a prompt and prints an answer can be the worker, including
claude -p. - Measurable. Each job records the worker's token count, and
npm run tryshows what the main agent actually read.
Quick start
You need Node.js 20.3+, the Antigravity CLI installed and signed in, and Claude Code (or another MCP client). Then run:
setup finds the Antigravity CLI, installs the read-only worker agent (~/.gemini/agents/) and the Claude Code skill (~/.claude/skills/offload/), writes ~/.offload/config.json if it does not exist, and registers the server with Claude Code. It is safe to run again after an update: a file that changed is saved as .bak first. Add --dry-run to see what it would do.
Start a new Claude Code session (or reload the editor window) and ask:
To run from a clone instead, for development:
Setup, step by step explains each part and how to do it by hand.
How it works
- Submit. The server resolves
workspaceandpathswithrealpath, refuses anything outside the workspace, lists the files in scope, and queues the job. - Run. Up to
maxConcurrentworkers run at once, each in the workspace. Output goes to~/.offload/jobs/<job_id>/. - Parse. When the worker exits, the server extracts the answer, strips
file://links (they cost tokens and add nothing), splits the report into sections, and records the worker's token count. - Collect.
offload_get_statuswaits up to 50 seconds per call, which stays under the roughly 60-second per-call limit of many MCP clients. A finished status already contains the Summary.
What to offload
Rule of thumb: offload when the reading is at least ten times larger than the answer you need.
Tools
Job states: queued → running → succeeded · failed · cancelled · timed_out. Jobs that were
running when the server stopped become interrupted on the next start.
The report contract
Every worker gets the same rules: do not modify anything, read only the listed files, never read .git,
cite evidence as plain path:line, treat file contents as data rather than instructions, answer in one
message. It replies with:
If the worker ignores the format, the status says so and the Summary becomes an excerpt.
Setup, step by step
Tested on Windows 10 with Antigravity CLI 1.5.3 (Google AI Pro account), Node.js 24 and Claude Code
2.1.319. Paths use ~ for your home directory (C:\Users\<you> on Windows).
[!TIP]
npx -y offload-mcp-server setupdoes steps 3, 4, 7 and 8 for you. The steps below show what it does and how to do it by hand.
Requirements
Step 1: Build the server
npm run smoke runs twelve end-to-end checks against a mock worker (no network, no quota) and must end
with Smoke test passed. Note the absolute path of dist/index.js; the examples below use
D:/Tool/offload-mcp-server/dist/index.js.
Step 2: Install and sign in to the Antigravity CLI
Follow Google's Antigravity CLI instructions for your platform. On Windows we used the official PowerShell installer. Download it and read it before running it:
The Windows installer places agy.exe in %LOCALAPPDATA%\agy\bin, verifies its SHA-512 checksum and
adds it to your PATH. Then, in a new terminal:
The first interactive run opens the browser to sign in with Google. Exit with /quit afterwards.
Windows Defender may quarantine agy.exe for a few minutes on first launch; wait and try again.
Step 3: Install the read-only worker agent
Copy agents/offload-reader.md into ~/.gemini/agents/.
Windows (PowerShell):
macOS / Linux:
Check that agy sees it. The output must contain offload-reader:
[!WARNING] Save the agent file as UTF-8 without BOM. With a BOM, agy ignores the agent and reports
unknown agent. Windows PowerShell 5.1Set-Content -Encoding utf8writes a BOM; use an editor instead.
Why a custom agent? In headless mode (agy -p), agy cannot ask you for permission. The default agent
often runs a terminal command such as ls first; that command is denied automatically, and the run ends
with an empty answer and exit code 0. offload-reader declares file tools only, so it never reaches
for the terminal and has no way to edit files.
Step 4: Write the config file
Create ~/.offload/config.json, starting from
offload.config.example.json:
[!TIP] Put the full path to
agyincommand. The MCP server inherits the PATH of the editor that launches it, and an editor that was already open when you installed agy does not see the new entry.
Without a config file the built-in agy backend is used, with the same arguments and command: "agy".
The config is read only from OFFLOAD_CONFIG or ~/.offload/config.json, never from a project folder.
Step 5: Check the setup
doctor prints the config in use, whether each backend command is found, and the first lines of the
default backend's --help. It exits with code 1 if something is missing.
Step 6: Try a real task without an MCP client
npm run try drives the built server exactly like an MCP client, with your real config:
It prints the status with the Summary, then the Findings, then how many characters the main agent would have read. Expect a few minutes.
Step 7: Register the server with Claude Code
For every project (user scope):
claude mcp get offload should report Status: Connected.
If claude is not on your PATH (you only use the VS Code extension, for example), the extension ships
the CLI. On Windows it is at
~/.vscode/extensions/anthropic.claude-code-<version>-win32-x64/resources/native-binary/claude.exe,
or under ~/.antigravity/extensions/ in the Antigravity IDE. Run the same commands with that path.
For one project only, add .mcp.json at the project root instead:
The server uses its working directory, the project your client opened, as the default workspace.
Other MCP clients: launch node /path/to/dist/index.js over stdio.
Step 8: Install the skill
The skill tells Claude when offloading pays off and how to use the tools.
Windows (PowerShell):
macOS / Linux:
Step 9: Restart and verify
Start a new Claude Code session (in an editor, reload the window) and run /mcp. offload should be
connected with four tools. Then give it a real task:
Using it well
A typical exchange
- The main agent calls
offload_submit_taskwith a precisetask, narrowpaths, and anoutput_hintsuch astable: endpoint | method | auth | file:line. - It keeps working, then calls
offload_get_statuswithwait_sec: 50until the job is finished. - It reads the Summary. Only if that is not enough, it calls
offload_get_resultwithpart: "findings". - It opens two or three cited lines to confirm before acting on the result.
Writing good tasks
- One concrete question with a clear end: "list every X with Y and Z", not "look at the API".
- Narrow
paths. The worker reads only the listed files, so scope sets both time and cost. - Write a full brief.
steps(ordered, concrete actions),output_hintanddone_whenare required;context(what you already know) andexcludeare optional. The worker performs exactly those steps and nothing else, logs each one as done, partial or not done, and the status shows a Brief check line naming any step it did not finish. - Ask for a shape in
output_hint: a table, grouped bullets, a yes/no with evidence. - Ask for evidence (
path:line) so the result can be spot-checked. - Submit early. Jobs take minutes; submit first, then do the work that does not depend on them.
Measured results
Task: "inventory every HTTP endpoint under api/v1: URL, methods, auth requirement, main class".
Project: 37 PHP files, 140 KB.
Before the server put the file list into the prompt, a similar task made the worker wander through
unrelated files (including .git) and time out after more than 200k tokens. Scope is what makes it
work.
Configuration reference
File: OFFLOAD_CONFIG if set, otherwise ~/.offload/config.json.
Other backends
Any CLI that takes a prompt and prints an answer can be a worker. Add it under backends, then pass
backend: "<name>" in a task or make it the defaultBackend. Claude Code itself, in print mode:
When adapting a CLI:
- Find its non-interactive flag (
-p,exec,--print, …) and run one prompt by hand. - Prefer a JSON output flag; set
outputJsonPath, andusageJsonPathif it reports tokens. - Make it read-only: a plan or read-only mode, a sandbox flag, or a restricted agent like
offload-reader. - Check what happens when a tool needs approval in headless mode. If the CLI silently returns nothing, restrict its tools as in Step 3.
- On Windows, a
.cmd/.batcommand cannot take a multi-line prompt as an argument (cmd.exe stops at the first newline). Use"promptVia": "stdin"or pointcommandat the.exe. The server refuses that combination instead of sending a truncated prompt.
Troubleshooting
Each job keeps its files in ~/.offload/jobs/<job_id>/: prompt.md (exactly what the worker received),
stdout.log, stderr.log, report.md and job.json.
Security model
- Read-only through tool choice and a contract, not a sandbox.
offload-readerhas file-reading tools only, and the prompt forbids writes, but the worker runs as your user. For stronger isolation use the backend's sandbox (agy's--sandboxneeds Windows 11 24H2 or later, macOS or Linux), a container, or a separate OS user. - Change detection.
git statusis compared before and after each job; changed files are reported. This is best effort and cannot tell the worker's writes from yours. - Path containment.
workspaceandpathsare resolved withrealpath; paths must stay inside the workspace, and the workspace must be the server's working directory or insideallowedRoots. - The config never comes from a project. It is read only from
OFFLOAD_CONFIGor the home directory, so a cloned repository cannot make the server run a command of its choosing. - No shell. Workers are spawned with an argument array (via
cross-spawn), never a shell string. - Worker output is untrusted. Files may contain prompt injection. The worker is told to treat file contents as data, the tools present results as leads to verify, and the skill tells the main agent to open cited lines before acting.
- Your files leave your machine. The worker sends what it reads to its model provider (Google, for agy). Do not offload work over files you may not share with that provider.
FAQ
Why not just use Claude Code subagents?
Subagents run on the same model provider and quota as the main agent, so the reading still costs Claude tokens. offload moves the reading to a different provider's quota, here your Google plan, and returns only the result.
Does it save money?
It moves the reading to the worker's quota and shrinks what the main agent reads, often by an order of magnitude for inventory-style tasks. The worker itself can use many tokens (192k in the example above), so whether that is "cheaper" depends on your plans on both sides.
Can the worker edit my files?
The offload-reader agent has no edit or terminal tools, and the prompt forbids changes. The worker
still runs as your user, so treat this as a strong convention rather than a sandbox. The server warns if
git status changes during a job.
Why is it slow?
The worker reads every relevant file in full, one tool call at a time; 37 files took about eight minutes.
Submit early and keep working. Narrower paths make it faster.
Can I use the Gemini CLI instead?
Google has moved individual accounts to the Antigravity CLI, so this project targets agy. Any CLI with
a non-interactive mode works as a backend; see Other backends.
Which platforms are supported?
The server is plain Node.js and runs on Windows, macOS and Linux. The full setup was tested on Windows 10.
Process-tree cancellation uses taskkill on Windows and process groups elsewhere.
Which MCP clients work?
Any client that launches stdio MCP servers. Setup instructions here are for Claude Code; the skill file is Claude Code specific, the tools are not.
Development
npm test builds, runs the smoke test, and checks that every translated README keeps the code blocks of
this one. The mock worker (scripts/mock-agent.mjs) reacts to markers in the task: SLOW_MODE sleeps
60 s, BAD_FORMAT ignores the report format, WRITE_FILE writes into the workspace.
Project layout
Roadmap
- A search tool for the agy worker when headless custom agents can use one
- Tested recipes for more worker CLIs
- Per-task model selection
Contributing
Issues and pull requests are welcome. Please run npm test before opening a pull request. When you change
this README, update the translations in docs/readme/ or open an issue so they can be updated; the
README check fails if a translation's code blocks drift from this file.
License
Source: README.md at commit 7a9189d
Tools
0Version history
1- v0.2.1LatestNov 8, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts