Tools

File Operations

Read

> Read src/main.py            # whole file
> Read src/main.py:10-50      # line range

Edit (precise replacement)

> Edit src/user.py
# find:    "def get_user(id):"
# replace: "def get_user(id: int) -> User:"

old_string must match exactly — include enough surrounding context to be unique. A colored diff is shown before applying.

Write & delete

  • write creates or overwrites; overwrites snapshot first
  • delete always asks for confirmation

Search

> Grep "TODO" --include="*.py"
> Glob "src/**/test_*.py"
> Symbols *Service            # from the code index, faster than grep

Every modifying operation creates a rollback snapshot automatically.