Artfical AI / Docs
tCode overview Open tAI Install tCode
How it works

Writing and editing

write_file and edit_file are the only two ways tCode actually changes something on disk. write_file creates a new file or replaces an existing one entirely; edit_file makes a targeted change by replacing one specific piece of text with another.

In practice, edit_file is what handles most real changes to existing code, since it touches only the lines that actually need to change rather than rewriting an entire file around a small fix, which keeps the resulting diff readable and focused on exactly what changed.

Both are permission-gated without exception; there is no configuration that makes a write or an edit run without asking first, aside from the explicit auto-approve setting covered in Permissions and safety.

Choosing between them is not something you do explicitly; the model reaches for edit_file whenever a targeted change is possible, and write_file specifically when a file needs to be created new or replaced wholesale, matching how a careful engineer would decide the same thing by hand.

Both tools show you the exact resulting content before it is written, an edit's diff or a new file's full text, so the permission prompt is never asking you to approve something you have not actually seen in full.