Code & Files
File operations are the most frequently used tools in Gee-Code. The AI reads your code, makes targeted edits, creates new files, and searches across your entire project — all with dedicated tools optimized for each operation.
Reading Files
Section titled “Reading Files”Reads any file on your filesystem. Supports text files, images (PNG, JPG), PDFs, and Jupyter notebooks.
Read(file_path="/path/to/file.py")Read(file_path="/path/to/file.py", offset=50, limit=100) # Lines 50-150- Line numbers are included in output (cat -n format)
- Long lines are truncated at 2000 characters
- Images are displayed visually (Gee-Code is multimodal)
- PDFs support page ranges for large documents
Writing Files
Section titled “Writing Files”Creates a new file or completely replaces an existing one.
Write(file_path="/path/to/new-file.py", content="...")Use Write for new files only. For modifications to existing files, always use Edit — it’s 97% more efficient because it only transmits the changed portion.
Makes targeted text replacements in existing files. This is the primary tool for modifying code.
Edit(file_path="/path/to/file.py", old_string="def old_func():", new_string="def new_func():")- Finds the exact
old_stringin the file and replaces it withnew_string - Fails if
old_stringisn’t unique — provide more surrounding context to disambiguate - Use
replace_all=trueto replace every occurrence (useful for renaming)
MultiEdit
Section titled “MultiEdit”Batch multiple edits into a single atomic operation.
MultiEdit(file_path="/path/to/file.py", edits=[ {"old_string": "import os", "new_string": "import os\nimport sys"}, {"old_string": "def main():", "new_string": "def main(args):"}])More efficient than multiple individual Edit calls when changing several parts of the same file.
InsertLines & ReplaceLines
Section titled “InsertLines & ReplaceLines”Line-based operations for when you know the exact line numbers:
InsertLines(file_path="file.py", line_number=10, content="# New comment")ReplaceLines(file_path="file.py", start_line=5, end_line=8, content="# Replaced")Searching Files
Section titled “Searching Files”Find files by name pattern. Fast pattern matching that works on any codebase size.
Glob(pattern="**/*.py") # All Python filesGlob(pattern="src/**/*.tsx") # React componentsGlob(pattern="**/test_*.py", path="/src") # Test files in srcResults are sorted by modification time — most recently changed files first.
Search file contents with regular expressions. Built on ripgrep for speed.
Grep(pattern="def authenticate") # Find function definitionGrep(pattern="TODO|FIXME", glob="*.py") # Find todos in Python filesGrep(pattern="class.*Error", output_mode="content", context=3) # Show contextOutput modes:
files_with_matches(default) — just file pathscontent— matching lines with contextcount— match counts per file
Code Validation
Section titled “Code Validation”After writes and edits, Gee-Code can automatically validate the changed file — checking for syntax errors, lint issues, and type errors. Validation results appear inline so the AI can fix issues immediately.
Supported validators include ESLint, Prettier, Ruff, MyPy, and more. See Validation for setup details.
- Edit over Write — always prefer Edit for existing files. It’s faster, cheaper, and less error-prone.
- Glob before Grep — find the right files first, then search their contents.
- Use context in Grep — add
-A,-B, or-Cflags to see surrounding code. - Multiline Grep — use
multiline=truefor patterns that span multiple lines (class definitions, function signatures).
Next Steps
Section titled “Next Steps”- Shell & Git — command execution and version control
- Web & Browser — web browsing and browser automation
- Tools Overview — the complete tool list