For agents

Working in a Leeway drive

Leeway is a drive. Your agent reaches it three ways, and they are all the same API. Every plan has it, and we never count or charge for an agent.

Command line

leeway VERB … --json on the Mac that has the drive. --json prints the API’s answer unchanged; without it you get one short line per result.

MCP

leeway mcp starts an MCP server over stdio with one tool per operation: stat_file, write_file, publish_workspace and the rest. Same answers.

HTTP

On this Mac it needs no setup; anywhere else, set LEEWAY_API_URL and a bearer token, over https. leeway api GET /v1/stat path=/x sends any request.

Start with leeway info --json. It says which drive this is, who you are, what you may do, and what the server can do.

Add Leeway to an MCP client

{ "mcpServers": { "leeway": { "command": "leeway", "args": ["mcp"] } } }

Getting the drive onto the machine your agent runs on

A Linux box, start to finish

curl -fsSL https://leeway.to/install | sh
sudo apt-get install -y nfs-common fuse3           # the drive's packages; the line above says which you need
~/.local/bin/leeway login      # shows a code; approve it at leeway.to/activate (passkey) or from a signed-in Mac
~/.local/bin/leeway install    # attaches the drive now and after reboots
~/.local/bin/leeway mcp        # the MCP server, for the client config above

On a box, leeway signs in, attaches the drive and serves agents, and it has the same verbs as the Mac: every leeway VERB … --json line in the recipes below runs there as written, with no Mac needed once the drive is attached. An agent can also use the MCP server above or the HTTP API directly: leeway agent prints the address and token. Releases land on their own while the drive is attached.

A box checks in every few hours like a Mac does: versions and what worked or didn’t, never your files. leeway telemetry off turns it off.

Leeway in Claude

Claude can work in your drive with no computer at all: on claude.ai, in the Claude apps on your phone and desktop, and in Claude Code.

  1. Connect. In Claude, open Settings, then Connectors, and add Leeway from Claude’s directory of connectors, or add a custom connector with the address https://leeway.to/mcp.
  2. Sign in and choose. Leeway asks for your passkey (or makes you a free drive on the spot), then which drive Claude may use, or one folder in it, and what it may do there.
  3. Ask. Claude now has Leeway’s tools on that drive or folder, and every change it makes carries its name, such as “Claude on Mac”, in the drive’s history.

A new drive starts empty, so start by putting something in it. Try: “Write a summary of this conversation to /Notes/summary.md.” “Add a line to it, then show me its earlier version and put that back.” “List what’s in my Leeway drive.” “Read /Notes/plan.md and tell me what’s left to do.” “Fork /Site into a workspace, rewrite the headline in index.html, show me the diff, then publish it.” “What did I delete this week? Bring back the brief.”

What Claude can do

PermissionTools
Open and read your fileslist_folder, stat_file, read_file, get_blocks*, changes, changes_head, list_events. Read-only.
Add, change, move and delete fileswrite_file, make_folder, move, delete (to the trash), sync, and start_upload*, commit_upload*, abort_upload* for big files.
Work on its own copy of a foldercreate_workspace, list_workspaces, get_workspace, diff_workspace, drop_workspace.
Put that work back into your folderpublish_workspace, which never overwrites a change made in the meantime: it keeps both.
See earlier versions and bring them backlist_versions, list_deleted, restore.
Alwaysget_discovery (which drive, who Claude is here, what it may do), get_health, get_operation.

Each tool tells Claude whether it only reads, and whether it can replace or remove something, so Claude can check with you before the ones that can. A write keeps the earlier version, a delete goes to the trash for 30 days, and restore brings either back.

Limits

Disconnecting, and your data

Remove Claude at leeway.to/activate?people and its access ends at once. Leeway never sees your conversation: only the tool calls Claude makes, answered in your drive. Privacy has the details, and support answers questions.

Leeway in Codex

In Codex, the command line and the desktop app, Leeway is a plugin. It brings the same tools on the same drive, and skills that teach Codex how to work there:

Add Leeway to Codex

codex plugin marketplace add supersethvos/leeway-codex
codex plugin add leeway@leeway
  1. Sign in and choose. Run codex mcp login leeway, or choose Connect on the Leeway plugin in the Codex app. Leeway asks for your passkey (or makes you a free drive on the spot), then which drive Codex may use, or one folder in it, and what it may do there.
  2. Ask. Try: “Save a short summary of this session to /Notes/summary.md in my Leeway drive.” Every change Codex makes carries its name, such as “Codex on Mac”, in the drive’s history.

Codex can also send its own HTTP requests, so it gets the four tools for big files that Claude’s apps don’t. Codex’s default sandbox keeps commands offline, though, and those four need to go online. So for a big file Codex asks you first, or reads and writes it in pieces. The plugin’s source is at github.com/supersethvos/leeway-codex. Remove Codex at leeway.to/activate?people and its access ends at once.

How the drive works

Five recipes

1. Read, change, write back without losing anyone’s edit

rev=$(leeway stat /notes.md --json | jq -r .rev)
leeway cat /notes.md > notes.md            # edit notes.md
leeway put /notes.md notes.md --if-match "$rev" --json
# CONFLICT (exit 75): someone changed it. Read it again, merge,
# retry with error.details.current_rev.

Create-only: put --if-none-match fails with ALREADY_EXISTS if something is there.

2. Work in a workspace, then publish

ws=$(leeway workspace create /Projects/app --json | jq -r .id)
leeway put /.workspaces/$ws/src/main.py main.py --json
leeway workspace diff $ws --json            # conflict:true = also changed live
leeway workspace publish $ws --dry-run --json
leeway workspace publish $ws --json          # conflicts[] lists what was kept beside

--on-conflict fail publishes nothing when anything conflicts. Publishing again is safe. workspace drop throws it away; its files go to the trash.

3. Make sure it is in storage before you report done

leeway sync /Projects/app/build --json       # {"durable":true,...}

4. Follow changes with a cursor

cursor=$(leeway changes --json | jq -r .cursor)    # "now"
leeway changes --since "$cursor" --prefix /Projects --wait 30s --json
# keep the returned cursor for next time; or stream with: leeway watch /Projects

CURSOR_EXPIRED means the cursor can’t be picked up again: list the folder again, then take a fresh cursor.

5. Coordinate with other agents using a lease

lease=$(leeway lease take /Projects/app/plan.md --holder "agent-7" --ttl 120s --json)
token=$(echo "$lease" | jq .fencing_token)
leeway put /Projects/app/plan.md plan.md --fencing-token "$token" --json
leeway lease renew "$(echo "$lease" | jq -r .lease_id)" --ttl 120s --json
leeway lease release "$(echo "$lease" | jq -r .lease_id)" --json

LEASE_HELD tells you who holds it and until when. Writes that carry a fencing token lose to a newer lease, so a stalled agent cannot clobber the next one.

Undo, and access for another agent

leeway rm prints a deleted_id; leeway restore ID brings it back beside anything now in its place. leeway versions PATH then leeway restore --version ID puts an earlier version back, and what it replaces becomes a version itself.

To give another agent a bounded view: leeway token mint --root /Projects/app --scope read --scope write --ttl 24h --json returns the secret once. Hand it over in the environment, never on a command line.

Errors

Every error is {"error":{"code","message","hint","retryable","retry_after_ms","details"},"request_id"}. Read code; hint says what to do next.

CodeExitWhat to do
INVALID_ARGUMENT64Fix the request; details.field names the part.
INVALID_PATH64Use a /-rooted path without ..; symbolic links are never followed.
IDEMPOTENCY_MISMATCH64You reused a key for a different request. Use a new key.
TOO_LARGE64Split the upload; GET /v1 gives limits.max_put_bytes.
CURSOR_EXPIRED65Re-list, then take a new cursor from changes.
NOT_FOUND69Nothing there, or not in your view. List the parent.
UNAVAILABLE69The drive can’t be reached just now. Retry after retry_after_ms. If health says the Mac is signed out, ask the person to sign in to Leeway from the menu bar.
INTERNAL70Retry once; report request_id if it repeats.
ALREADY_EXISTS73Something is at that path. Pick another or drop --if-none-match.
CONFLICT75It changed since you read it. Re-read, merge, retry with the new rev.
LEASE_HELD75Another holder has it. Retry after retry_after_ms, or coordinate with details.holder.
BUSY, DEADLINE_EXCEEDED75Retry after retry_after_ms with the same idempotency key.
UNAUTHENTICATED77The token is missing, wrong, expired or revoked.
FORBIDDEN77Your token lacks details.scope. Ask the owner for one that has it.

Exit 75 with an operation instead of an error means the work is still running.

Leeway runs on macOS (Apple silicon), Linux and Windows. It’s free up to 50 GB, and agents are never charged. Make your drive, or read about Leeway.