Exporting what an agent sees
An agent’s harness reads its instructions, skills, memory and settings from several layers:
the platform’s, the project’s, its user’s and its own. space-env export, in an agent’s
machine, writes one archive of exactly what the harness sees, with a manifest that says where
every file comes from. Use it to debug an agent, to compare two agents, or to run the same
layering outside the platform.
From your own computer, space agents export
runs it for you and downloads the result.
The command
space-env export
space-env export -o agent.tar.zst --sessions
space-env export -o - --max-bytes 3145728| Flag | Meaning |
|---|---|
-o FILE | Where to write the archive (default agent.tar.zst); -o - writes it to stdout. |
--sessions | Include the agent’s sessions (large, and they hold the conversation). |
--max-bytes N | Refuse an archive larger than N bytes: exit status 5, nothing written. |
It works only in an agent’s machine. The archive is a zstd-compressed tar (.tar.zst); the
exit status is 0 when it is written, 5 when it would be over --max-bytes, and 1 for any other
error, with the reason on stderr. See the space-env reference for
every flag.
What is in the archive
| Path | What |
|---|---|
manifest.json | The key to reproducing it (below). |
home/ | Every path of the agent’s home that its harness reads for instructions, skills and settings: AGENTS.md or CLAUDE.md, the skills directories of each harness, settings.json and the like, with links resolved to their content. |
layers/<platform|project|user|agent>/ | Each layer as it is: its AGENTS.md, skills/ and memory/. |
managed/ | Managed settings, such as /etc/claude-code. |
sessions/ | The agent’s sessions, only with --sessions. |
manifest.json holds:
- the guest image, the platform layer’s digest and the kernel;
- the harness and ACP adapter versions;
- the commit of each repository (project, user, agent);
- the layering order;
- for every path in
home/, which layer it comes from and what hides it, if anything.
Never in the archive: credentials and sign-ins (such as .claude/.credentials.json or a
harness’s auth.json). They stay in the platform’s credential service and in the machine; the
manifest only records whether they are present.