Docs / Guides / Work on a metered link

Guides

Work on a metered link

Keep a coding agent from burning through a phone hotspot or a travel data plan: why agent traffic is so large, how to move the work to another machine, and how to send Claude Code's API calls through a relay that only transmits what is new.

Updated Nov 19, 2026

A coding agent on a laptop that is tethered to a phone can use a month of data in an afternoon. We measured one long Claude Code job that worked on slide decks with images: 18 GB in a day. This guide explains where those bytes come from and shows two ways to stop them, using offload (opens in new tab) , a small open-source tool (one Python file, MIT).

Why agent traffic is so large

Every call an agent makes to the model API resends the whole conversation: the system prompt, the tool definitions, and every file, screenshot and image already in context. A session with 2 MB of context that makes 300 calls uploads about 600 MB, even if each turn adds only a few lines.

Two things that look like fixes are not:

  • Prompt caching lowers the bill, not the bytes. The cached prefix is still uploaded on every call so the server can match it.
  • A proxy or VPN through another machine changes the route, not the amount. The same bytes still cross the metered link, plus tunnel overhead.

Data is only saved when the work itself happens somewhere else, or when the repeated part of each request never leaves the laptop.

Three ways to work, and what each costs

SetupWhat crosses the metered linkSaving
Agent on the laptop, as usualevery request in fullnone
Agent on the laptop, API calls through offload redirectonly what is new in each requestlarge on long sessions
Agent on another machine (offload claude), you watch over sshterminal trafficthe most

Running the agent on the other machine is the better choice when you can: its API calls, tool work and web fetches all use that machine’s connection. The redirect is for when the agent has to run on the laptop, for example because the files or the apps it drives are there.

Install

You need a second machine with a normal connection that the laptop reaches with ssh <box> without a password prompt. Install on both:

git clone https://git.nuilab.org/f.ortega/offload.git
sh offload/install.sh        # copies offload to ~/.local/bin

offload needs Python 3.8 or newer, ssh, and rsync for the file commands.

Run the agent on the other machine

offload box mybox            # set the default machine once
offload claude ~/work/deck   # copy the folder there and start Claude Code in tmux
offload get ~/work/deck      # later: bring the results back

Paths map by home directory, so ~/work/deck on the laptop is ~/work/deck on the box. Copies use rsync: only changed parts of files cross the link, compressed. Each command prints how many bytes it sent, and asks before a first copy larger than 50 MB.

For a single command instead of a whole session:

offload run make report      # copy this folder, run there, bring changed files back
offload fetch https://example.org/big-dataset.zip   # the box downloads it; nothing comes to the laptop

Compression helps text, not media

Code, logs, CSV and JSON shrink five to ten times. Images, video, PDF and Office files are already compressed, so the saving there comes from sending only what changed.

Send Claude Code’s API calls through a relay

offload redirect mybox       # turn it on
offload redirect status      # is it on, and how many bytes it saved
offload redirect off         # turn it off

redirect starts a small relay on the laptop and sets ANTHROPIC_BASE_URL in ~/.claude/settings.json to point Claude Code at it. Sessions started after that use the relay; sessions that are already running must be restarted.

Claude Code ──► relay on the laptop ══ ssh ══► relay on the box ──► model API
               only what is new crosses        full request rebuilt

The laptop relay cuts each request into chunks at JSON block boundaries. Both relays remember the chunks they have seen. A new request is sent as “the same chunks as an earlier request, plus these new ones”, compressed. The relay on the box rebuilds the exact bytes, checks them against a hash, and forwards the request with its original headers. Replies stream back as they arrive.

In our test session, requests after the first went from about 170 KB each to 1–4 KB each. The first request of a session crosses in full, and new content, such as a new image, crosses once.

What the redirect does not cover

Only API calls go through the relay. Tools still run on the laptop, so a web page the agent fetches or a file it uploads still uses the metered link. If the box cannot be reached, calls go straight to the API so the agent keeps working; offload redirect status shows how much went that way.

What happens to your credentials

Your login token travels in the request headers through both relays. The laptop relay listens on 127.0.0.1 only. The relay on the box listens on a unix socket that only your user can open, and the laptop reaches it through ssh. Neither relay logs or stores headers. Request bodies are held in memory on the box while the relay runs.

Measure before and after

The operating system counts bytes per network interface. Read the counter, work for a while, read it again:

netstat -ib -I en0 | sed -n 2p     # macOS: columns 7 and 10 are bytes in and out
cat /sys/class/net/wlan0/statistics/{rx,tx}_bytes   # Linux

The counter covers the laptop only. The phone’s own apps use the same plan, so the carrier’s number is the one that decides when the plan runs out.

  • Connect machines for the ssh setup between the laptop and the box.
  • amux for keeping agent sessions running on the other machine.

Source: content/guides/work-on-a-metered-link.md · maintained in the nuilab-agenticai repository.