• Claude
  • Column

I banned the em dash from everything Claude writes for me

My take: The em dash has become the tell of AI text nobody reread. Claude never leaves one in my files: a hook sends it back before I see it.

Text that an AI wrote and nobody reread has a tell: the long dash, the em dash, dropped in the middle of every other sentence. Typographically, it isn't wrong. But when I meet one now, I stop trusting the paragraph. So I banned it from my site, my emails and my code, and I let a machine enforce the rule instead of my patience.

Asking was not enough

I first wrote the rule into Claude's memory: no em dash, ever. It held most of the time. Most of the time means that I still had to check every file myself, which is exactly the work I wanted gone.

A hook does the checking

Claude Code runs hooks: shell commands that fire on events, such as right after a tool writes a file. Mine lives in ~/.claude/settings.json, so it covers every project on my Mac. After each Write or Edit, it reads the path of the file from the JSON that Claude Code passes on standard input, then searches the file for the three bytes of the em dash. When it finds one, it exits with code 2. For a hook that runs after a tool, the Claude Code documentation says that this exit code shows the error message to Claude, which rewrites the sentence on its next move.

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "f=$(jq -r '.tool_input.file_path // empty'); [ -f \"$f\" ] || exit 0; if LC_ALL=C grep -Iq -- \"$(printf '\\342\\200\\224')\" \"$f\"; then echo \"Em dash found in $f: rewrite the sentence without it.\" >&2; exit 2; fi"
          }
        ]
      }
    ]
  }
}

The character never appears in the command itself: printf builds it from its three bytes, so the hook does not trip over its own settings file.

A second net

The hook only sees the files Claude writes. It misses what I paste myself and what Claude says in the chat. So this site has a second net: the checker that validates every post before it goes out refuses the em dash, along with every expression on my style guide's banned list.

Try it

Install jq (brew install jq on a Mac), copy the block into ~/.claude/settings.json, and swap the character for your own tell. The same pattern enforces any rule a grep can check: a word you never want to read again, a secret that must never land in a file.

Drafted with Claude, Anthropic's AI, from my take. Reviewed and owned by me.

Up next