Claude Code and Claude Agent SDK
Let Claude Code write a persistent handoff note, then read it from a fresh Claude Agent SDK agent through mountable.io.
Claude Code writes files with the CLI. A fresh Claude Agent SDK reviewer reads the same files through the Python SDK. Both use one mountable.io filesystem, so the reviewer can run on another machine or in a sandbox without copying the writer's directory.
The runnable example is maintained by mountable.io. It uses the released MCP server to check storage usage and the existing agent skill for the writer's CLI workflow.
Prerequisites
Use an existing mountable.io account with a saved payment method, an existing filesystem and an API key granted access to it. Storage and file operations follow the usage prices. The example creates no free account or credits.
You also need Python 3.11+, uv, Node.js/npm and Claude Code. Set up Anthropic credentials as described in the Agent SDK quickstart. Anthropic model usage is billed separately.
Set MOUNTABLE_API_KEY in your private environment or secret manager.
Never put a key in a prompt or command argument.
Set MOUNTABLE_ORG to your organisation ID. Use your own filesystem ID and
organisation ID in place of FS_ID and ORG_ID below.
Set those shell variables before running the reviewer:
export FS_ID="your-filesystem-id"
export ORG_ID="your-organisation-id"
export MOUNTABLE_ORG="$ORG_ID"Claude Code: write the handoff
Install the CLI and skill in your coding-agent project:
npm install -g mountable-cli@0.8.0
npx skills add writeitai/mountable --skill mountable --agent claude-code
mountable fs list --json
claudeAsk Claude Code, replacing FS_ID with the chosen filesystem:
Use the mountable skill to write "Parser review complete. Check empty input next." plus a newline to /handoff.txt on filesystem
FS_ID. Use mountable files write with--if-none-matchand stdin. Read it back with mountable files read. Do not mount or print credentials.
Approve the specific CLI commands when asked. The command uses your
environment's key; the prompt contains only IDs and note text.
Use a fresh note path per run. --if-none-match refuses an existing file.
After a timeout, read back before retrying.
The skill also covers mounting for agents that need ordinary local file operations.
Agent SDK: read it in a fresh run
Check out the public example and run its reviewer:
git clone https://github.com/writeitai/mountable.git
cd mountable/examples/claude-workspace
uv sync --locked
uv run python review.py --filesystem "$FS_ID" --org "$ORG_ID" --note /handoff.txtSet the environment in this runtime too. The reviewer reads the named note and checks stored-byte usage through MCP. It prints tool names, its summary and the model cost.
The reviewer uses Haiku with at most five turns and a $0.50 SDK budget guard. The final model request can exceed the guard. No filesystem mount is needed for this CLI-to-SDK handoff.
Keep the reviewer to the chosen note
The backend chooses the filesystem and path. The model's read_note tool
has no arguments and uses a read-only SDK handle. A hook allows that tool
and the MCP filesystem_usage call for the chosen filesystem and
organisation. Built-in tools are disabled, and user/project settings are
not loaded.
This limits the tools offered to the reviewer. It does not isolate the trusted host process, which keeps the API key. Use a filesystem-limited read-only key and a separate runtime for a production reviewer. Only send notes you intend to share with Anthropic; notes must not contain credentials.
MCP in interactive Claude Code
For interactive management, add this .mcp.json to your project:
{
"mcpServers": {
"mountable": {
"command": "npx",
"args": ["-y", "mountable-cli@0.8.0", "mcp"],
"env": { "MOUNTABLE_API_KEY": "${MOUNTABLE_API_KEY}" }
}
}
}Claude Code expands the environment variable when it starts the server.
Use filesystem_usage for your filesystem, or list_filesystems to discover
those the key can access.
The MCP reference lists all ten tools and their permission
requirements. File contents in this example are read by the SDK.
Sources: Claude Code MCP, Agent SDK MCP, Agent SDK custom tools.