[BUG] Some Session files break Auto complete propagation on start
Environment
- Platform (select one):
- [x] Anthropic API
- Claude CLI version: 1.0.3
- Operating System: macOS 15.5
- Terminal: iTerm2
Bug Description
After launching claude code the Project's custom commands are not available through autocomplete though they still run when called manually.
Steps to Reproduce
🤷
Expected Behavior
Autocomplete should propagate with custom tools
Actual Behavior
It does not show custom tools from the project
Additional Context
I noticed this the first time today in a more active project. After some trial and error i noticed it can be fixed by cleaning up the session files in ~/.claude/projects/
I kept trying and moving around files until i noticed it comes down to certain files causing trouble. I can't 100% reproduce but it seems to mainly be the big files causing troubles - maybe also the partly extreme long lines in the jsonl format are the issue. However - it should likely not cause the custom commands not load on application start. I'm also not sure why it needs to scan through all the session files on a start without -r to resume previous sessions. It should usually not be required to scan previous sessions but it seemingly does. One of the most recent sessions grew a bit too large maybe (8,1MB) so maybe it's caused by this. Some lines are even longer than 60k characters.
Maybe there's a way to at least manually override the loading of previous sessions if i want to start a new one anyways.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗