Ctrl+W word boundary is hardcoded to whitespace since 2.1.261; expose it as a setting or bindable action

Status Open
Reported on v2.1.261
Maintainer reply None cached
Activity 0 comments · opened Sep 24, 2026

Problem

2.1.261 changed Ctrl+W in the prompt to Bash unix-word-rubout (delete back to whitespace) and removed the keybindingFlavor toggle that 2.1.238 had added. There is now no way to get punctuation-aware word deletion on Ctrl+W.

Concrete cost, a dozen times a day: I copy a PR's diff URL from the browser, paste it into the prompt, and press Ctrl+W to drop the trailing files:

https://github.com/anthropics/claude-code/pull/95932/files

Before 2.1.261 that left https://github.com/anthropics/claude-code/pull/95932/. Now it deletes the entire URL, and I have to retype or arrow-key through it. URLs and paths are the most common thing pasted into Claude Code, and whitespace-only deletion makes every one of them all-or-nothing.

Every real shell lets me choose this. Zsh has WORDCHARS. Bash lets .inputrc swap unix-word-rubout for backward-kill-word. Claude Code copied the Bash default without the configurability.

What the binary does today (2.1.281)

  • Ctrl+W → deleteWORDBefore() → prevWORD(), whitespace-delimited.
  • Option+Backspace / Ctrl+Backspace → backwardKillWord() → getReadlineWordBoundaries(), punctuation-aware.
  • Ctrl+W is matched by key name inside the input handler. It is not a chat:* action, so ~/.claude/keybindings.json cannot remap or unbind it.

Ask

Any one of these fixes it:

  1. Expose chat:backwardKillWord and chat:unixWordRubout as bindable actions so Ctrl+W can be remapped in keybindings.json.
  2. Add a wordChars setting (zsh WORDCHARS semantics) that both Ctrl+W and Option+Backspace respect.
  3. Restore keybindingFlavor.

Option 1 is the smallest change and matches how Ctrl+U was handled: https://github.com/anthropics/claude-code/issues/49317 was fixed in 2.1.113 within two days once users showed it was hardcoded and unbindable.

Related

https://github.com/anthropics/claude-code/issues/47312 asked for a bindable chat:backwardKillWord and was auto-closed as a duplicate of closed issues. https://github.com/anthropics/claude-code/issues/34505 and https://github.com/anthropics/claude-code/issues/38354 were the "Ctrl+W eats too much" reports that likely motivated the whitespace change. Whitespace fixed their case by breaking this one.

View original on GitHub ↗