You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: .claude.json automatically stores conversation history when it shouldn't #1449
The .claude.json configuration file is automatically storing conversation history in a "history" array, which appears to be unintended behavior. This creates privacy concerns and file bloat.
Expected Behavior
The .claude.json file should only contain configuration settings like:
Hi! This is expected behavior -- it's what makes it so you can arrow up to see previous prompts, the same way you can do with your bash history. We're in the process of migrating this file to a more standard cache directory, to make its purpose more clear.
Reacted by bailey cosier, expozeur, fooddjstudio and Yury Pikhtarev
@bcherny Thanks for clarifying! I understand the arrow-up functionality is
valuable. However, I'm experiencing some significant operational issues
with the current implementation:
Current Impact:
My .claude.json has grown to 65MB, causing MCP server initialization
failures
This results in 72 duplicate MCP processes spawning as the system
struggles to parse the file
Only 1 of 6 configured MCP servers successfully connects
Suggestion:
Would it be possible to prioritize the cache directory migration? The
current approach is creating a bottleneck where configuration parsing
blocks core functionality. Perhaps implementing a simple split:
~/.claude.json → Keep under 1MB (config only)
~/.claude/history.json → Conversation history (can grow freely)
This would maintain the arrow-up feature while ensuring config parsing
remains performant.
Temporary Workaround Request:
Could you provide guidance on safely trimming the history entries without
breaking functionality? Or perhaps a flag like --max-history-size to
prevent unbounded growth?
I appreciate the work you're doing on Claude Code - it's an amazing tool.
Just hoping we can find a solution that balances feature richness with
operational stability.
Reacted by Aditya Thebe, Shiqi Zhang, Eelco and Dorian Massoulier
Another pain point: Storing chat history in ~/.claude.json makes it annoying to version control the user config in ~/.claude.json, because every time you run claude the file updates and your git repo is dirty again.
I'd like to be able to version control my ~/.claude.json file without machine-generated noise like:
project "history"
"cachedChangelog"
etc.
Reacted by Eelco and Dorian Massoulier
Reacted by VINCENT ORTEGA JR, Aditya Thebe, Shiqi Zhang, expozeur, Eugen Klymniuk and fooddjstudio
I'll add that I agree with everyone above me. This is nuts to do this in this manner. The bloat and privacy considerations are a pretty big deal. I'm reduced to using a .bak of the clean file and replacing the json file over and over.
Having issues with bloated .config.json file, full of projects history and cachedChangelog. Storing unbounded conversation history in a config file doesn't make sense. Config is static data. Conversation history is stately and should be cached somewhere, per project. Also using one file for all projects centralizes risk on a single point of failure / contention. Risky design.
Needs
~/.claude/projects/[project-hash]/ - Per-project configs, history & cache
.claude/ in each project directory - Project-local settings
Separate cache directory for changelogs
Ask Claude Code yourself and see its answer. There is already the ~/.claude/projects directory for exactly this purpose so it makes no sense.
Have written a script to back-up .config.json and trim out the fat from it, in the interim. Runs once a day on a timer.
Just figured out this is happening - unbelievable. Any time I ask claude to add an MCP server, it's throwing it in there, along with everything else I have ever said and done with Claude code. No wonder nothing ever worked!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
bcherny commentedon May 30, 2025
Hi! This is expected behavior -- it's what makes it so you can arrow up to see previous prompts, the same way you can do with your bash history. We're in the process of migrating this file to a more standard cache directory, to make its purpose more clear.
vincentortegajr commentedon Jun 3, 2025
@bcherny Thanks for clarifying! I understand the arrow-up functionality is
valuable. However, I'm experiencing some significant operational issues
with the current implementation:
Current Impact:
failures
struggles to parse the file
Suggestion:
Would it be possible to prioritize the cache directory migration? The
current approach is creating a bottleneck where configuration parsing
blocks core functionality. Perhaps implementing a simple split:
~/.claude.json → Keep under 1MB (config only)
~/.claude/history.json → Conversation history (can grow freely)
This would maintain the arrow-up feature while ensuring config parsing
remains performant.
Temporary Workaround Request:
Could you provide guidance on safely trimming the history entries without
breaking functionality? Or perhaps a flag like --max-history-size to
prevent unbounded growth?
I appreciate the work you're doing on Claude Code - it's an amazing tool.
Just hoping we can find a solution that balances feature richness with
operational stability.
jdanbrown commentedon Jun 6, 2025
Another pain point: Storing chat history in
~/.claude.jsonmakes it annoying to version control the user config in~/.claude.json, because every time you runclaudethe file updates and your git repo is dirty again.I'd like to be able to version control my
~/.claude.jsonfile without machine-generated noise like:"history""cachedChangelog"expozeur commentedon Jun 24, 2025
Agreed — it's pretty bizarre to store chat logs in a config file. Why is this the case?
cosier commentedon Jul 9, 2025
Seriously this is ridiculous!! WHY is this a thing? ITS A HUGE MESS!!
IT MAKES THE ENTIRE claude.json COMPLETELY UNUSABLE.
Thanks for creating edit hell guys, rendering the claude.json as a pile of stinky vibes.
nonrev76 commentedon Jul 20, 2025
I'll add that I agree with everyone above me. This is nuts to do this in this manner. The bloat and privacy considerations are a pretty big deal. I'm reduced to using a .bak of the clean file and replacing the json file over and over.
dimension-zero commentedon Jul 27, 2025
Having issues with bloated
.config.jsonfile, full ofprojectshistory andcachedChangelog. Storing unbounded conversation history in a config file doesn't make sense. Config is static data. Conversation history is stately and should be cached somewhere, per project. Also using one file for all projects centralizes risk on a single point of failure / contention. Risky design.Needs
~/.claude/projects/[project-hash]/- Per-project configs, history & cache.claude/in each project directory - Project-local settingsAsk Claude Code yourself and see its answer. There is already the ~/.claude/projects directory for exactly this purpose so it makes no sense.
Have written a script to back-up .config.json and trim out the fat from it, in the interim. Runs once a day on a timer.
ALeslie743 commentedon Aug 1, 2025
Just figured out this is happening - unbelievable. Any time I ask claude to add an MCP server, it's throwing it in there, along with everything else I have ever said and done with Claude code. No wonder nothing ever worked!
github-actions commentedon Aug 11, 2025
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.