[FEATURE] Claude Code edit tool to retry deleting temp files when locked for n iterations
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When Claude Code is editing files in a Visual Studio 2026 WSL solution temporary files are not being deleted.
Claude suggested The pattern *.tmp.<pid>.<timestamp> is the Edit tool's atomic write — it writes to the temp file, then renames it to the final destination. If the rename succeeds the temp file vanishes. If it fails (e.g. the file is locked by the linter or VS at that moment), the temp file is left behind.
It does seem that the rename is succeeding as the edited code seems to be correct. This could be a bug.
Proposed Solution
The Edit tool should retry the temporary file delete n times then report if it fails.
Alternative Solutions
I delete the file manually. Sometimes I miss them and they end up in git.
Priority
Low - Nice to have
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗