About workspace
workspace provides unified read and write access to files in the current session, for workflows that need to move files among tools or skills. Logical path prefixes organize uploads, code outputs, and Office documents.
Key features
- 01List session files
- 02Read text and binary files
- 03Write text or Base64 content
- 04Pass files between tools and skills
- 05Access file categories by path prefix
Use cases
- 01Browse uploaded session files
- 02Read files created by the code agent
- 03Pass a file from one skill to another
- 04Save images or Office documents
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ aws-samples/ sample-strands-agent-with-agentcore --skill workspaceAfter installing, type/workspacein Claude Code to confirm it loaded.
Details
From the project READMEWorkspace
Provides unified read/write access to all files in the current session. The userId and sessionId are injected automatically — you only specify the logical path.
Path Conventions
| Prefix | What it accesses |
|---|---|
uploads/<file> | Files uploaded by the user |
code-agent/<file> | Files created by the code agent (auto-synced) |
code-interpreter/<file> | Files created in the Code Interpreter workspace |
documents/powerpoint/<file> | PowerPoint presentations |
documents/word/<file> | Word documents |
documents/excel/<file> | Excel spreadsheets |
documents/image/<file> | Images from other tools |
Note: Files written under
/mnt/workspacepersist for the chat session, and user uploads are available under/mnt/workspace/inputs. Code Agent downloads session uploads into its own working directory when delegated.
Usage
See everything in the session:
workspace_list()
workspace_list("uploads/")
workspace_list("code-agent/")
Read a file the code agent created:
workspace_read("uploads/data.jsonl") # uploaded structured data
workspace_read("code-agent/calculator.png") # binary → base64
workspace_read("code-agent/report.md") # text → string
Pass a file from one skill to another:
result = workspace_read("documents/excel/data.xlsx") # encoding: base64
workspace_write("code-agent/data.xlsx", result["content"], encoding="base64")
Notes
- Text files return
encoding: "text"with plain string content. Large text reads are bounded; whentruncatedis true, use Code Interpreter for the complete file instead of repeatedly reading it into model context. Code Interpreter uses/mnt/workspace/inputs/<file>. - JSON, JSONL, and NDJSON uploads are text files; large chat attachments may
be truncated in model context, but the complete file remains under
uploads/ - Binary files (images, Office docs, PDF, etc.) return
encoding: "base64" workspace_writeaccepts both encodings — use"base64"for binary- Files written here are immediately available to all other skills in the session
UI Guidance (from tools-config)
Path conventions (userId/sessionId injected automatically):
uploads/<file>— files uploaded by the usercode-agent/<file>— files from the code agentdocuments/powerpoint/<file>— PowerPointdocuments/word/<file>— Worddocuments/excel/<file>— Exceldocuments/image/<file>— images
Binary vs text: images/PDFs/Office files are returned base64-encoded (encoding: "base64"); use the same encoding when writing them back.