---
description: "Varda distinguishes structured API calls from literal file edits, giving harness designers two costs to test separately: string escaping and unfamiliar edit syntax."
source: https://x.com/KentonVarda/status/2127800394860347843
captured: "2026-12-02T10:36:58.141265+00:00"
capture: xdk
status_id: 2127800394860347843
conversation_id: 2127800394860347843
post_count: 4
genre: conceptual-essay
snapshot_sha256: 4312aa40cc93f60659daff596cd33a793a05ce3d8f573c064b021dc708d73a75
ingested: "2026-12-02"
type: types/ingest-report.md
learning_claims: true
domains: [code mode, file editing, tool-call syntax]
---

# Ingest: Why keep file reads and edits outside code mode?

## Classification

[Kenton Varda’s four posts](https://x.com/KentonVarda/status/2127800394860347843) make one design argument rather than report a benchmark. Varda credits himself with naming code mode, not inventing the idea.

## Summary

In code mode, a model writes a program that calls tools as APIs. Varda favors it for operations on structured parameters but makes two exceptions. For edits, putting replacement text inside a JavaScript string requires escaping characters that the model could supply literally to a dedicated tool. He suspects that even correct escaping can come at the expense of the edit itself. He also favors the edit format familiar from training: string replacement for Claude and patches for GPT are his examples. For reads, the argument is frequency, not escaping: having to write a snippet for every routine read adds work.

## Quotes

> But if it has to use code mode to edit files, then the file-edit content needs to be written as strings, which need to be escaped, which makes the model dumber.
> --- `kb/sources/.snapshots/as-the-person-who-coined-code-mode-i-actual-2127800394860347843.md` @ `sha256:4312aa40cc93f60659daff596cd33a793a05ce3d8f573c064b021dc708d73a75` — post 1

## Connections Found

[The Anatomy of an Agent Harness](./the-anatomy-of-an-agent-harness-2031408954517971368.ingest.md) uses `apply_patch` to illustrate how a model’s performance can depend on the interface it trained with. Varda contributes a rival explanation for a familiar editor’s apparent advantage: the same replacement text may be harder to express as a string inside a program. A comparison that changes both the edit format and the need for escaping cannot distinguish the two explanations.

## Learning Claims (our opinion)

Varda attributes model-specific preferences to prior exposure to particular edit tools. That account concerns using a learned convention, not learning a better one during an edit. The convention is explicit in the tool format, but the thread identifies no corresponding stated rule inside the model. It describes models using the format, not criticizing such a rule or carrying a revision into another attempt. The proposed training effect could persist across tasks without this being a [theory builder](../theory/definitions/theory-builder.md); the posts do not measure that persistence or a training-induced gain.

## Extractable Value

1. **Separate escaping from format familiarity.** For a KB editor, compare direct replacement with the same replacement embedded in code on passages with and without quotes, backslashes, or newlines. Score the resulting text, not just whether the call ran: valid code can still make the wrong edit. [experiment]

## Limitations (our opinion)

Varda gives no matched edits or error counts to show whether escaping changes output quality when the string is syntactically valid. The public API’s JSON encoding does not establish what the model generates internally; Claude’s description of its own delimiters is not independent documentation. Nor does preference for a patch format establish which training examples caused it. These are reasons to test the interface on a particular model, not to rule out code-based editing for all models.

## Recommended Next Action

Run a paired direct-tool versus code-mode replacement test on the same quoted Markdown passages with one fixed model and edit format.
