File System
| ID | session_file_system |
| Category | File Operations |
| Features | file_system (unlocks Workspace tab) |
| Dependencies | None |
Provides tools to access and manipulate files in the session workspace. Each session has an isolated filesystem rooted at /workspace. Files persist for the session duration.
read_file
Section titled “read_file”Read the contents of a file.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Absolute path (e.g., /workspace/src/main.py) |
write_file
Section titled “write_file”Create or overwrite a file. Parent directories are created automatically.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Absolute path |
content | string | yes | File content |
list_directory
Section titled “list_directory”List files and directories at a given path.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Directory path |
grep_files
Section titled “grep_files”Search file contents with regex patterns.
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern | string | yes | Regex pattern |
path | string | no | Directory to search (default: /workspace) |
delete_file
Section titled “delete_file”Delete a file or directory.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Path to delete |
stat_file
Section titled “stat_file”Get file metadata (size, type, timestamps).
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Path to stat |
Use Cases
Section titled “Use Cases”- Code generation — agent writes source files, configs, and scripts to the workspace
- Document processing — read uploaded files, transform content, write results
- Project scaffolding — create directory structures with boilerplate files
- Log analysis — grep through log files for patterns and errors
Example
Section titled “Example”Agent creates a Python project:
User: Create a Flask hello world app
Agent: → write_file("/workspace/app.py", "from flask import Flask\napp = Flask(__name__)\n\[email protected]('/')\ndef hello():\n return 'Hello, World!'\n") → write_file("/workspace/requirements.txt", "flask>=3.0\n")- All paths must be under
/workspace - Files are session-scoped — no cross-session access
- Parent directories are auto-created on write
- Shared filesystem with Virtual Bash (same
/workspace)
See Also
Section titled “See Also”- Virtual Bash — execute commands against these files
- Storage — key/value and secret storage
- Capabilities Overview