[BUG] The edit tool doesn't understand how to write with tab indentation
Resolved 💬 2 comments Opened Feb 15, 2026 by shaneholloman Closed Feb 16, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The Edit tool in Claude Code can't match tab characters in old_string. Read renders them fine, but Edit's string matching silently fails on any tab-indented file. Forces full file rewrites as a workaround. This is a basic find-and-replace -- tabs shouldn't break it.
This has been happening to me all week, at least it feels like it. Maybe the last four days.
⏺ Update(agent/src/tui/keys/theme.ts)
⎿ Error editing file
⏺ Bash(cat -A /Users/shaneholloman/git/sources/uicnz/aria/agent/src/tui/keys/theme.ts | sed -n '111,124p')
⎿ cat: illegal option -- A
usage: cat [-belnstuv] [file ...]
⏺ Bash(sed -n '111,124p' /Users/shaneholloman/git/sources/uicnz/aria/agent/src/tui/keys/theme.ts | cat -vet)
⎿ ^I^I^I^I{$
^I^I^I^I^Itype: 'hotkey',$
^I^I^I^I^Ihotkeys: ['Enter'],$
… +11 lines (ctrl+o to expand)
⏺ All tabs. The Read tool rendered them as spaces. Let me use the exact tab characters.
⏺ Bash(sed -i '' '/\t\t\t\t\t\thotkeys: \['\''Enter'\''\],/{
N;N;N;N;N;N;N…)
⎿ (No output)
⏺ Read 1 file (ctrl+o to expand)
What Should Happen?
Should be tabs aware.
Error Messages/Logs
none
Steps to Reproduce
Simply have Claude try to edit a TypeScript file that uses tabs.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Not sure since these versions move so fast.
Claude Code Version
But my version is this: 2.1.42
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗