Skip to content
Mastering Claude

Home / Everyday moves

Everyday moves11 minApplication

Writing pitfalls: files, parallel edits and lost deliverables

A success report written by a sub-agent proves nothing about the real state of files, since it starts in an isolated context with no access to what the main agent has already read or written, and the only reliable proof remains a diff checked afterwards, not the text of the report.

A sub-agent starts with a context that is isolated and fresh on every call, except for a fork, which instead inherits the whole conversation in progress. It sees neither the main conversation's history, nor the skills already invoked, nor the files the main agent has already read. This isolation does not stop it from checking the disk itself: it has the same reading and execution tools as the main conversation, and can very well run a git diff or reread a file to check its own work. What is missing is an outside eye: a success report remains text produced by the same agent that has just acted, never an independent check, and nothing guarantees it matches a real write to disk until someone else has checked it.

The text report is not the proof

Documented good practice is to ask for a verifiable diff rather than trusting the text of the report. A diff shows the lines actually changed in a real file, a success report is only a sentence generated by the same agent claiming to have succeeded.

mkdir -p /tmp/demo-diff
echo "version initiale" > /tmp/demo-diff/avant.txt
echo "version modifiee" > /tmp/demo-diff/apres.txt
diff /tmp/demo-diff/avant.txt /tmp/demo-diff/apres.txt
# result: the changed line appears, the proof is in the diff, not in a sentence

A text report claiming that apres.txt has been updated adds nothing beyond this diff, and without it, nothing distinguishes a real write from a made up sentence. A one line script containing backticks runs into a related trap: the shell running it can interpret them before the command reaches its target, and what shows up afterwards looks like a success even though the command actually run was truncated. Rereading the command exactly as the shell received it, not just as it was typed, answers the same need for proof as the diff.

Two writes to the same file are never independent

Two edits sent together on the same file, whether by two sub-agents or by two calls of the edit tool in the same turn, apply one after the other on the content the tool finds at the moment it acts, never on two separate copies merged afterwards. The second edit can therefore fail to find the text it was looking for, because the first has already changed it. Sending the two edits in sequence, rereading the file in between, reduces this risk and makes each step verifiable on its own.

The same principle of verifiable proof applies to a long deliverable: content spanning several paragraphs that only exists in the displayed reply disappears with it as soon as the conversation continues. Writing it to a real file before displaying it, as with structured output in headless mode, guarantees it stays accessible independently of the conversation thread, exactly as a diff stays readable independently of the report that comes with it.

Figure 1

Success report against verifiable proof

Proof that a write actually happenedWhat produces itWhat it showsHow to check it
Text success reportGenerated by the same agent claiming to have succeededA sentence claiming the file has been updatedNothing to check, the sentence takes itself as proof
Diff of the real fileProduced by a command that reads the file's content on diskThe exact lines that changed, or no line if nothing changedRereads independently of what the agent claims
The comparison crosses three criteria, what produces each proof, what it shows and how to check it, between a text success report and a diff of the real file.
Calibrate it yourself

A developer asks a sub-agent to add a configuration line to a file, receives a reply announcing that the change is done, then opens the file himself on disk and reads its content.

Write, in one sentence, what this situation establishes, and in one sentence what it does not establish.

What to remember
  • A sub-agent starts with an isolated context, with no access to the main conversation's history, to the skills already invoked, or to the files already read by the main agent.
  • A sub-agent can read the disk just like the main conversation, but its report remains text produced by the same agent that acted, never an independent check, hence the risk that it does not match any real write.
  • A diff of the lines actually changed is verifiable proof, a text report claiming success is not.
  • Two edits sent together on the same file apply one after the other on the content found at the moment of the action, never on two copies merged afterwards.
  • A long deliverable written only in the displayed reply disappears with it, writing it to a real file makes it accessible independently of the conversation thread.
Do this now

Open a file you recently asked a sub-agent or a tool to write, run a diff or a direct reread of its content on disk, and confirm that what you find there exactly matches the success report you received.

Check the source

Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.