anthropics / anthropics/claude-code

[Bug] System directive causes CRLF line endings in markdown files on Windows despite project LF convention

Offen
#89,307 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:tools bug platform:windows
Vorherrschende Sprache
Python
Sterne
145k
Forks
23.1k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

**Bug Description**
Claude just told me that "
It arrived in this conversation as a system-injected message, prefixed "While auto mode is active:" — verbatim:

▎ Do your work through the Bash tool wherever it can accomplish the job: read files with cat, head, or sed -n, search with grep and find, and make file changes with sed, heredocs, or short scripts, rather than using the dedicated Read, Edit, or Write tools. Fall back to a dedicated tool only when Bash genuinely cannot do the job.

That's Anthropic-side, tied to some "auto mode" the harness turned on — not you, and not anything in the repo.
"
This is a problem, because in auto-mode claude keeps inserting CR at the line-endings of .md files that it is updating. Yes, I'm on windows. But the convention of this project is LF-only when possible. Claude has been good about respecting that, but recently this has crept up. It just did a few edits to some docs and they had 5 (five!) carriage returns on each line.

Amazingly, Claude just thought about that directive and decided:
That said, the immediate failure was still mine — the instruction says "wherever it can accomplish the job," and Python that silently rewrites every line ending isn't accomplishing the job. I'll use Edit for prose from here on and treat shell-scripted text rewriting as the exception it should have been.

A bit amusing. So I don't know what your goal is with the directive in the first place (do you not trust your own Read/Edit/Write tools?), but it has decided it can't fulfil your directive so is ignoring it.

**Environment Info**
- Platform: win32
- Terminal: windows-terminal
- Version: 2.1.241
- Feedback ID: 798a4817-b939-40af-8443-5514f23cd364

**Errors**
```json
[{"error":"TelemetrySafeError: VirtualMessageList: itemKeys/messages length desync (keys=72 messages=71 range=[0,72))\n at X20 (B:/~BUN/root/cli:23311:34430)\n at mCg (B:/~BUN/root/cli:23311:27293)\n at Fr (B:/~BUN/root/cli:2993:21427)\n at qc (B:/~BUN/root/cli:2993:40531)\n at Ss (B:/~BUN/root/cli:2993:51459)\n at Oze (B:/~BUN/root/cli:2993:89122)\n at $7e (B:/~BUN/root/cli:2993:88070)\n at pae (B:/~BUN/root/cli:2993:87890)\n at pv (B:/~BUN/root/cli:2993:84152)\n at mt (B:/~BUN/root/cli:2993:6693)","timestamp":"2026-08-24T04:15:24.466Z"}]
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

No source file, entry point, or test is identified in the report. Start by reproducing the markdown edit on win32 with auto mode enabled, then trace how the system directive selects editing tools and verify that changed .md files retain LF-only line endings without the reported message-list error.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
bash
Bereich
cli, operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
32/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.