You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rtk rewrite turns head -N file1 file2 ... into rtk read file1 file2 ... --max-lines N, but rtk read only accepts a single <FILE> argument. When invoked with multiple files, rtk read falls through to the system read command (/usr/bin/read on macOS, which is a POSIX wrapper around the shell builtin), which interprets the first filename as a variable name and fails with "not a valid identifier".
Same class of bug as #989 (cat multi-file, fixed) and #1108 (tail -N).
$ head -5 .claude/skills/generate/SKILL.md .claude/skills/enclosure-design/SKILL.md
Exit code 1
/usr/bin/read: line 4: read: `.claude/skills/generate/SKILL.md': not a valid identifier
Environment
OS: macOS (Darwin 25.2.0)
rtk: 0.37.0 (also 0.31.0)
Claude Code hook v2 (auto-patched via rtk init -g --auto-patch)
Expected
Either:
rtk rewrite returns exit 1 (no rewrite) when head -N has >1 file argument, so the shell runs native head — consistent with the cat fix in Cat multiple files result in an error #989.
rtk read natively supports multiple files.
Workaround
Use rtk proxy head -N file1 file2 ... to bypass the rewrite, or use editor/IDE file-read tools that don't go through Bash.
Summary
rtk rewriteturnshead -N file1 file2 ...intortk read file1 file2 ... --max-lines N, butrtk readonly accepts a single<FILE>argument. When invoked with multiple files,rtk readfalls through to the systemreadcommand (/usr/bin/readon macOS, which is a POSIX wrapper around the shell builtin), which interprets the first filename as a variable name and fails with "not a valid identifier".Same class of bug as #989 (cat multi-file, fixed) and #1108 (tail -N).
Repro
Real-world Claude Code failure:
Environment
rtk init -g --auto-patch)Expected
Either:
rtk rewritereturns exit 1 (no rewrite) whenhead -Nhas >1 file argument, so the shell runs nativehead— consistent with thecatfix in Cat multiple files result in an error #989.rtk readnatively supports multiple files.Workaround
Use
rtk proxy head -N file1 file2 ...to bypass the rewrite, or use editor/IDE file-read tools that don't go through Bash.Related
tail -Nrewrite produces invalidrtk read -N(should be-n N) #1108 Claude Code hook: `tail -N` rewrite produces invalid `rtk read -N` (same class)