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_file and write_file return a content_hash (sha256:...) so agents can make freshness-checked edit_file calls.

Read the contents of a file. Successful responses include content_hash.

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

Create or overwrite a file. Parent directories are created automatically. Successful responses include content_hash.

ParameterTypeRequiredDescription
pathstringyesAbsolute path
contentstringyesFile content

Apply one or more exact text replacements to an existing text file. This tool is text-only, requires the current content_hash from read_file or write_file, and uses compare-and-set semantics so concurrent writes fail cleanly instead of clobbering newer content.

ParameterTypeRequiredDescription
pathstringyesAbsolute path to an existing text file
expected_hashstringyesCurrent content_hash (sha256:...)
old_textstringyes*Exact text to replace (single-edit shorthand)
new_textstringyes*Replacement text (single-edit shorthand)
editsarrayyes*Batch of { old_text, new_text } replacements matched against the original file

* Provide either old_text/new_text or edits, not both.

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
  • Surgical refactors — agent reads a file, then applies freshness-checked exact replacements
  • 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")

Agent updates an existing file safely:

{
"path": "/workspace/app.py",
"expected_hash": "sha256:1c4d...",
"edits": [
{
"old_text": "return 'Hello, World!'",
"new_text": "return 'Hello from Everruns!'"
}
]
}
  • All paths must be under /workspace
  • Files are session-scoped — no cross-session access
  • Parent directories are auto-created on write
  • edit_file only works on text files and rejects binary/base64 content
  • edit_file applies all replacements against the original file content and rejects ambiguous or overlapping matches
  • edit_file preserves the file’s existing BOM and newline style (LF, CRLF, or CR)
  • edit_file returns a unified diff capped to a bounded size; oversized diffs are truncated and marked as such
  • Shared filesystem with Virtual Bash (same /workspace)