Skip to content

Conversation

@penberg
Copy link
Collaborator

@penberg penberg commented Dec 29, 2025

We already had most of the plumbing in place, but teach agentfs run about sessions with the newly added --session flag, which allows you to access the same agentfs session from multiple commands. For example, you might do:

> agentfs run --session my-session claude
Welcome to AgentFS!

The following directories are writable:

  - /home/penberg/src/tursodatabase/agentfs (copy-on-write)
  - /home/penberg/.claude
  - /home/penberg/.claude.json
  - /home/penberg/.local
  - /home/penberg/.npm

Everything else is read-only.

To join this session from another terminal:

  agentfs run --session my-session <command>

to start a Claude Code session, but then join the session with good old bash to see what's going on:

penberg@turing:~/src/tursodatabase/agentfs$ agentfs run --session my-session bash
Joining existing session: my-session

🤖 penberg@turing:~/src/tursodatabase/agentfs$ ls
CHANGELOG.md  cli  dist-workspace.toml  examples  integrations  MANUAL.md  README.md  sandbox  scripts  sdk  SPEC.md  TESTING.md

Fixes #126

Allow multiple `agentfs run` sessions to share the same delta layer by
specifying a session ID. When --session is provided, the run uses that
ID instead of generating a unique UUID, enabling multiple runs to
operate on the same filesystem state.

Closes #126
Print the session ID in the welcome banner along with instructions on
how to join the session from another terminal. This improves DX by
making it easy to discover and share the session ID.
Set AGENTFS_SESSION environment variable inside the sandbox so that
processes can discover which session they're running in. This is useful
for scripts and tools that need to know the session ID.
…variable

Add documentation for the session feature including:
- --session <ID> option description
- --allow and --no-default-allows options (previously undocumented)
- AGENTFS_SESSION environment variable
- Examples for persistent sessions, joining sessions, and accessing session ID
@penberg penberg merged commit 1eaeeaf into main Dec 29, 2025
33 checks passed
@penberg penberg deleted the agentfs-run-session branch December 29, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow multiple agentfs run sessions on the same agent filesystem

2 participants