[BUG] Refactoring python code, Claude has issues with indenting using these tool-based edits
Environment
- Platform (select one):
- [X] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: 1.0.34 (Claude Code)
- Operating System: macOS 15.3,
- Terminal: IntelJIdea
Bug Description
Refactoring python code, you have to watch Claude like a hawk. Test everything. EVERYTHING.
Issue: finding random blocks of code that are at the wrong indentation level after a refactoring.
Steps to Reproduce
- Write a ton of python code
- Have Claude work in it using tool based edits
- Hilarity ensues
Expected Behavior
Indentation at the expected level
Actual Behavior
Wild and zany adventures debugging white space
Found 2 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/5278
- https://github.com/anthropics/claude-code/issues/2707
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
Neither of those are a duplicate: this issue relates to indentation at the beginning of lines, whereas those relate to superfluous trailing whitespace at the end of lines and a missing newline at EOF.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Still an issue.