machines/cloud. When a session starts, it reads the snapshot and installs the skills. A session never writes to your account remote.
Supported environments
Before you start
You need:-
An account remote that Git can reach over HTTPS, such as
https://github.com/you/skills. The session needs the HTTPS URL: it has no SSH key, and the token works only over HTTPS. Your computer can keep an SSH URL for the same repository. -
Skills on the cloud machine. On your computer, copy all of its skills to the cloud machine:
Or turn on one skill at a time, see Change the cloud machine’s skills. Until the cloud machine has a snapshot, sessions start without your skills.
- A token that can only read the account remote. See Create a read-only token.
agentx export --machine cloud copies your computer’s settings, skills and placements to the cloud machine:
- The snapshot keeps each MCP server’s command, arguments and URL as your configuration writes them, and these can hold a token. Keep the account remote private, or remove such values from your configuration before you export.
- It replaces the cloud machine’s whole snapshot. A skill you placed only on the cloud machine, or a
--copyyou gave with--machine cloud, is gone until you place it again. - A skill from a shared source stays at the version your computer had. To move it to a newer version, export again, or run
agentx skill place <name> --machine cloud. After that, sessions take its latest version. - Sessions install your own skills at their latest version on the account remote.
Create a read-only token
The setup script holds the token, so give it the least access that works: read access to the account remote and nothing else. On GitHub, create a fine-grained personal access token:- Open Settings, then Developer settings, then Personal access tokens, then Fine-grained tokens, and select Generate new token.
- Set an expiration date.
- Under Repository access, select Only select repositories and pick your account remote.
- Under Permissions, set Contents to Read-only. Leave every other permission at No access.
- Generate the token and copy it.
Set up Claude Code on the web
- Copy the setup script below.
- Set the three values at its top:
AGENTX_VERSION:nightlyorstable.ACCOUNT_REMOTE: the HTTPS URL of your account remote. Ifagentx source listshows an SSH URL, such asgit@github.com:you/skills.git, use the HTTPS URL of the same repository,https://github.com/you/skills.ACCOUNT_TOKEN: your read-only token. For a public account remote, leave it empty.
- In Claude Code on the web, open the settings of the environment you work in.
- Paste the script into the environment’s setup script, and save.
- If the environment limits network access, allow
github.com,api.github.com,raw.githubusercontent.com,objects.githubusercontent.com,release-assets.githubusercontent.comand the host of your account remote. - Start a new session.
The setup script
What the script does
- Installs agentx to
~/.local/binwith the install script: the newest nightly build fornightly, or the latest release forstable. - Sets a Git credential helper in
~/.gitconfigthat gives the token to Git for the account remote and no other repository. - Adds the account remote with
agentx source add <url> --account. - Adds a
SessionStarthook to~/.claude/settings.json. It keeps every other setting and hook in the file, and replaces only an earlier agentx hook, so running the script again adds no second hook.
agentx import --machine cloud --yes each time a session starts or resumes. The import installs the skills that the snapshot on machines/cloud lists, and places them. Then the hook asks Claude Code to look for skills again, so a skill the import installs is there in that same session. See Restore from the account remote.
The script always exits 0, so the environment starts even if a step fails. The setup output shows the error.
Change the cloud machine’s skills
On your computer, turn skills on and off for the cloud machine with the same commands you use on your computer, plus--machine cloud:
skill placewithout--toplaces the skill in every configuration your computer detects and enables. Sessions then take the skill’s latest version.- Add
--copytoskill placefor a client that cannot follow a symlink. Sessions then give that client a copy of the skill. skill removewith--fromtakes the skill out of those configurations and keeps it on the cloud machine. Without--from, it takes the skill off the cloud machine.- Each command commits to
machines/cloudon your account remote, pushes, and changes nothing on your computer. - A later
agentx export --machine cloudreplaces all of these changes with your computer’s skills and settings.
Limits
- The hook relies on Claude Code reading
~/.claude/settings.jsonon the session’s own computer. This works in Claude Code on the web today, but Claude Code does not document it, so it can change. - The token reads only the account remote. If a skill comes from a source the session cannot reach, such as another private repository or an SSH URL, the import skips it, and the log says why.
- A session reads the cloud machine’s snapshot and never writes it. Edits you make to a skill in a session stay in that session.
Revoke the token
The token is in the environment’s setup script. If someone else can read the script, or you stop using the environment, revoke the token with your Git host. On GitHub, open Settings, then Developer settings, then Personal access tokens, then Fine-grained tokens, and delete it. Then create a new token and paste it into the script.Troubleshooting
A skill is missing in a session
The hook writes the output of every import to/tmp/agentx-import.log. The log names each skill that the import skipped, and why.
Ask the agent: