[BUG] 953 empty [] files in ~/.claude/todos/ causes ECONNRESET on every API request
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?
When ~/.claude/todos/ accumulates a large number of empty JSON files (containing only []),
Claude Code starts throwing ECONNRESET errors on every API request, making it completely unusable.
The todos folder had 953 files, most of them empty (2 bytes, containing only []).
What Should Happen?
Claude Code should either clean up stale/empty todo files automatically,
or ignore them gracefully without affecting API connectivity.
Error Messages/Logs
API Error: Unable to connect to API (ECONNRESET)
Retrying in 1 seconds… (attempt 1/10)
...all 10 attempts fail
Steps to Reproduce
- Use Claude Code heavily over time, allowing todos to accumulate
- Check: ls ~/.claude/todos/ | wc -l → shows 953 files
- Most files contain only [] (empty arrays)
- Launch Claude Code → every request fails with:
API Error: Unable to connect to API (ECONNRESET)
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
2.1.50 (Claude Code)
Claude Code Version
2.1.50 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
The fix was instant — no restart required. This suggests Claude Code is loading/parsing
all todo files on every request rather than at startup only.
Related issues about large .jsonl files causing similar hangs: #22365, #21022
But this is different — the trigger is quantity of empty files, not file size.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗