tool-layer-bytes
Skill27 starsChanged 17 days agoApache-2.0View on GitHub
The shell and editing layers between Claude and a file rewrite bytes the author never touched (escapes dropped or turned into control bytes, CRLF turned LF, arguments rewritten), and the transcript still shows the command as written. Route any payload carrying a backslash, a quote of the enclosing kind or a `$'` through the Write or Edit tool, never a heredoc or an inline -e/-c string; never `sed -i` a CRLF file; and prove the bytes after any scripted edit. Triggers when writing code or regex through the shell, editing files with a script, reading or writing files from Python or Node, and checking whether a scripted edit applied. Does not fire on edits made with the Write or Edit tool, which carry bytes as given.
In this repository56 other files it gives its agents.
- ai-surface-disciplineSkill
- blast-radius-grepSkill
- checkpoint-logSkill
- commission-the-rosterSkill
- committee-reviewSkill
- confirm-before-pushSkill
- constant-time-secret-compareSkill
- context-economySkill
- contract-reviewSkill
- cross-agent-reviewSkill
- date-parse-utc-safeSkill
- db-migration-verificationSkill
- deliverable-integritySkill
- dependency-upgrade-verificationSkill
- earn-every-lineSkill
- email-delivery-verificationSkill
- enforce-invariants-in-buildSkill
- env-change-verificationSkill
- findings-are-evidenceSkill
- fixtures-from-realitySkill
- flag-deferred-itemsSkill
- guard-the-spend-pathsSkill
- handoverSkill
- honest-failure-surfacingSkill
- legal-citation-integritySkill
- legal-notice-handlingSkill
- live-data-surgerySkill
- live-state-firstSkill
- lock-at-the-chokepointSkill
- mass-red-triageSkill
- measure-per-routeSkill
- no-silent-data-dropSkill
- one-real-rideSkill
- outbound-side-effect-idempotencySkill
- parallel-work-reconSkill
- pin-to-what-was-seenSkill
- plan-firstSkill
- price-the-spendSkill
- prove-it-can-failSkill
- reproduce-the-real-buildSkill
- rerun-before-verdictSkill
- safe-smokesSkill
- secrets-in-outputSkill
- server-side-authoritySkill
- skill-library-builderSkill
- spawn-from-declared-stateSkill
- statute-to-obligations-registerSkill
- substantiate-outward-claimsSkill
- team-loopSkill
- trace-one-recordSkill
- unordered-eventsSkill
- unslop-codeSkill
- unslop-textSkill
- unslop-uiSkill
- verified-citationsSkill
- verify-the-effectSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Not a heredoc, not node -e, not python -c.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tool-layer bytes
Between the text Claude writes and the bytes on disk sit layers that rewrite: the Bash tool's
own escaping, the shell's quoting and heredoc rules, MSYS path conversion on Git for Windows,
sed -i and Python's newline handling, and git's core.autocrlf. Each reports success. A
green run afterwards proves nothing about whether the edit applied, because the run tests the
bytes that landed, not the ones intended.
The rules
- Code through files, not the shell. Any script or payload carrying a backslash, a quote
of the kind enclosing it, or a
$'goes to disk with the Write tool and runs as a file. Not a heredoc, notnode -e, notpython -c. The Bash tool has dropped one level of backslashes, turned\band\xNNinto raw bytes, and split a heredoc at a$'. - No in-place stream edits on Windows checkouts.
sed -iandperl -pirewrite the whole file and turn CRLF line endings LF;git diffundercore.autocrlf=truecannot see it. Use the Edit tool. - Python and Node read and write with the newline mode stated. Python's default
open(p)turns CRLF into LF on read, so "read normally, write withnewline=''" still writes LF. Read and write withnewline='', or bytes. - One input per command. A heredoc and a later
< fileredirect on one command: the later redirect wins and the heredoc never reaches the program. - Paths and revisions through MSYS: an argument like
origin/main:pathor one starting//can be rewritten; prefixMSYS_NO_PATHCONV=1.
Prove the bytes after any scripted edit
git diff --stat: a whole-file count for a one-line edit is the tell.- Line endings:
tr -cd '\r' < f | wc -cagainstwc -l < f;git ls-files --eol f. - Control bytes:
tr -d '\011\012\015\040-\176\200-\377' < f | wc -cshould print 0. - Syntax:
node --check f, or the language's own. - A mutation test is proved by its red run, read in full; if the mutation script reports it made no change, the escape was eaten and the red run never happened.
The hook
hooks/byte-layer-warn.mjs (PreToolUse, Bash) warns, never blocks, on a heredoc or inline
code string carrying a backslash (a git commit message is exempt), on sed -i and
perl -pi, and on a heredoc with a later input redirect. It is the moment-of-use half; this
skill is the rest.
Provenance
Twelve misses in four repositories, August to October 2026, while the rule lived only in a
machine memory: ICC L-043, L-046, L-083, L-094, L-120 and the session of 22 October 2026
(fifty working-copy files turned LF by Python's default read; three heredocs that dropped
backslashes); AI domain L-122, L-144, L-146; passive income L-084; RimModManager L-011.
docs/SKILL_PROPOSALS_2026-10-22.md, Tier 1 item 1.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

