Skip to content

Working with AI agents

Two separate things live here. One lets an agent on this machine share files. The other lets you hand a file and a prompt to an agent session on a different machine.

Terminal window
s2u install-agent-tools

That registers Share2Us with Codex, Claude Code and Gemini CLI, so the agent can create a share without you pasting commands. Pick one with --agent codex, --agent claude-code or --agent gemini-cli.

Underneath it is a tool server:

Terminal window
s2u mcp serve # run as a tool provider
s2u mcp token # a scoped token, for a remote agent

The local secret scan still runs. An agent that tries to share a file containing credentials gets the same refusal you would.

Take a screenshot on one machine and give it, with a prompt, to a Claude Code, Codex or Gemini session running somewhere else. The agent acts on it there.

On the machine with the agent sessions:

Terminal window
s2u daemon run --agent-bridge

From anywhere:

Terminal window
s2u agent list
s2u agent send --device <id> --session <id> --file shot.png \
--prompt "what is wrong here?"

The prompt and the file are encrypted to the target device. The server relays something it cannot read.

A device you have not sent to before does not get through. The first request waits on the target machine:

Terminal window
s2u agent pending
s2u agent approve <id> # this one request
s2u agent allow <device> # standing access, until revoked
s2u agent revoke <device>

Guardrails apply with no setup. Pushing, deleting and outbound network are blocked, and a remote prompt cannot edit the rules that constrain it. That last part is the one that matters: a prompt that could rewrite its own limits is not a limit.

Add your own in a plain-text .s2u.rules:

Terminal window
s2u setup # start a .s2u.rules for this project
s2u agent rules # what is hard-enforced and what is advisory, per tool