Claude Code First, specification version 0.1.0. The plain-language guide
Version 0.1.0. Level 2. Best evidence grade R4/S3.
EP-6 No source edited through a heredoc
An agent SHOULD NOT write or edit source files through a shell heredoc.
| Field | Value |
|---|---|
| Keyword | SHOULD NOT |
| Level | 2 |
| Checked | by judgement |
| Findings | F404 |
| Harness facts | none |
| Threat | external: one platform, Windows shells |
| Status | active |
Rationale: in roadkeep "three heredoc edits corrupted a test file's string literals and only the parser noticed" [roadkeep@91754240:docs/CHANGELOG.md#L655], and the project's rule became never to edit source that way (F404). A heredoc passes source through the shell's quoting and newline handling, which the writer does not see. The finding is R4 for text crossing a boundary in general, but the heredoc is one project's observation, so this rule carries SHOULD NOT. The harness's own file-editing tools write the bytes given to them, which is the alternative the rule points to.
Holding the committed settings and the wiring of every guard under a gate is rule GH-5 in GH.md; it is not repeated here.