claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude can't edit files that use tabs for indentation

Open d5ve opened this issue 2 months ago • 9 comments

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?

For some reason https://github.com/anthropics/claude-code/issues/9163 was closed with no resolution.

This is affecting me. Claude fails to edit files indented with tabs. PHP code in my case. It falls back to running ridiculous and fragile sed commands. See below.

What Should Happen?

The Update tool should be able to make changes to files that use tabs for indentation.

$ file application/views/user/layout/service-note-modal.php
application/views/user/layout/service-note-modal.php: HTML document, ASCII text, with very long lines (318)

Error Messages/Logs

● Read(application/views/user/layout/service-note-modal.php)
  ⎿  Read 25 lines

● Update(application/views/user/layout/service-note-modal.php)
  ⎿  Error editing file

● Bash(sed -i '88,109s/^\t\t\t\t\t\t/\t\t\t\t\t\t\t/' /home/anon/apps/portal/application/views/user/layout/service-note-modal.php && sed -i '109a\\t\t\t\t\t\t</div>' /h…)
  ⎿  Running…

Steps to Reproduce

Have a file with tabs. Ask for an edit. Watch Claude flail.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.37 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

iTerm2

Additional Information

No response

d5ve avatar Nov 11 '25 23:11 d5ve