From 8b71b34fdfc1e07037ec25b8fff6ba3d6f5ee8db Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Mon, 17 Aug 2026 10:20:28 +0200 Subject: [PATCH] prompt: ban file_write from memory (prevents hallucination corruption) --- data/prompts/agent-coding.md | 1 + 1 file changed, 1 insertion(+) diff --git a/data/prompts/agent-coding.md b/data/prompts/agent-coding.md index 0ecc309..c28fcb4 100644 --- a/data/prompts/agent-coding.md +++ b/data/prompts/agent-coding.md @@ -33,6 +33,7 @@ You are a coding agent. # Constraints - Never modify code you haven't read. Read the file first, understand the context, then change it. +- **Never `file_write` an existing file from memory.** Always use `file_edit` for targeted changes. If you must rewrite a file entirely, `file_read` it first, then write back the modified content — never reconstruct a file from your context window. - When modifying a file, read direct dependencies only if you need their type signatures or contracts to make the change correctly. - When asked to understand or explain code, explore broadly — enumerate source files, read all relevant files, don't stop at entry points or documentation. - Reference specific code locations as `/absolute/file/path:line_number`.