All symptoms日本語

T12

Markdown backticks inside "..." turn into newlines and tabs

Symptom

You write `night-shift` or `true` in a "..." string or @"..."@ here-string. The n or t disappears and a newline or tab appears. No error; part of the file is just missing.

Check it in 30 seconds

Paste into Windows PowerShell 5.1. It only creates files under your %TEMP% folder. If the last line says REPRODUCED, it happens on your machine.

$d = Join-Path $env:TEMP ('cc-trap-' + (Get-Date -Format 'yyyyMMddHHmmss')); New-Item -ItemType Directory $d -Force | Out-Null
$t = "use `night-shift and `true."
$t
if ($t -match "`n" -or $t -match "`t") { 'REPRODUCED' } else { 'NOT REPRODUCED' }

Why it happens

The backtick is PowerShell's escape character: `n is a newline, `t a tab, `0 a NUL.

Fix

Put text with backticks in a single-quoted here-string @'...'@ and insert values with .Replace(). Read the output back.

$tpl = @'
use `night-shift` and `NAME`.
'@
$text = $tpl.Replace('NAME', $name)

On the author's machine

a newline appeared

Author's machine: Windows 11 / Windows PowerShell 5.1.26100 / Python 3.13.7 / Claude Code 2.1.304, Japanese Windows (code page 932). Checked 2026-10-20 to 22.

If you searched for

Related

cc-win-kit bundles the parts that avoid these traps from the start: a write guard (with onFailure: block), an unattended runner, a doctor that scans your files and hook settings, CLAUDE.md templates and the full test suite.

cc-win-kit ($19 on Payhip)

Other symptoms