Skip to content

File System

IDsession_file_system
CategoryFile Operations
Featuresfile_system (unlocks Workspace tab)
DependenciesNone

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 the contents of a file.

ParameterTypeRequiredDescription
pathstringyesAbsolute path (e.g., /workspace/src/main.py)

Create or overwrite a file. Parent directories are created automatically.

ParameterTypeRequiredDescription
pathstringyesAbsolute path
contentstringyesFile content

List files and directories at a given path.

ParameterTypeRequiredDescription
pathstringyesDirectory path

Search file contents with regex patterns.

ParameterTypeRequiredDescription
patternstringyesRegex pattern
pathstringnoDirectory to search (default: /workspace)

Delete a file or directory.

ParameterTypeRequiredDescription
pathstringyesPath to delete

Get file metadata (size, type, timestamps).

ParameterTypeRequiredDescription
pathstringyesPath to stat
  • 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

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)