Filesystem
Write Files
Section titled “Write Files”cell.write_file("config.json", '{"model": "gpt-4"}')cell.write_file("data/input.csv", csv_content)await cell.writeFile("config.json", '{"model": "gpt-4"}');Read Files
Section titled “Read Files”content = cell.read_file("config.json")print(content) # {"model": "gpt-4"}List Directory
Section titled “List Directory”entries = cell.list_files("/data/")for entry in entries: print(f"{entry.type} {entry.name} ({entry.size} bytes)")File Info
Section titled “File Info”info = cell.file_info("config.json")print(info.name) # config.jsonprint(info.type) # fileprint(info.size) # 19print(info.permissions) # rw-r--r--print(info.modified_time) # 2026-05-14T12:00:00ZCheck Existence
Section titled “Check Existence”if cell.file_exists("output.txt"): data = cell.read_file("output.txt")Create Directories
Section titled “Create Directories”cell.make_dir("data/processed/2026") # Creates parentsRename / Move
Section titled “Rename / Move”cell.rename_file("old_name.txt", "new_name.txt")cell.rename_file("data/raw.csv", "data/processed/clean.csv")Remove Files
Section titled “Remove Files”cell.remove_file("temp.txt")cell.remove_file("data/cache/") # Removes directories tooE2B Compatibility
Section titled “E2B Compatibility”If using the E2B compat layer, the familiar sandbox.files namespace works:
from synapse.e2b_compat import Sandbox
sbx = Sandbox()sbx.files.write("/home/user/hello.txt", "Hello!")content = sbx.files.read("/home/user/hello.txt")entries = sbx.files.list("/home/user/")