Skip to content

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

@d5ve

Description

@d5ve

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

For some reason #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions