Description
The .claude.json file continuously accumulates conversation history for each project, leading to:
- File sizes growing to hundreds of MB or more
- Slower Claude Code startup times
- Potential system performance degradation
- No automatic cleanup mechanism
Current Behavior
- Every conversation in every project is stored indefinitely
- History entries include full conversation context, pasted contents, and metadata
- File can grow to 968KB+ (as observed) and continues growing
- No built-in limits or rotation mechanism
Expected Behavior
- Automatic history rotation/cleanup after reaching a size limit
- Configurable history retention (e.g., last N conversations or last X days)
- Option to disable history storage entirely
- Better separation of configuration (MCP servers) from history data
Impact
- Users must manually edit
.claude.json to remove old history
- Risk of losing MCP server configurations during manual cleanup
- Performance degradation as file size increases
- Poor user experience for long-term users
Suggested Solutions
- Implement automatic history rotation (e.g., keep only last 100 conversations per project)
- Add configuration option for history retention limits
- Separate history storage from configuration storage
- Add
claude history prune command with options like --older-than 30d
- Show warnings when history file exceeds certain size thresholds
Environment
- Claude Code version: Latest
- OS: macOS (but affects all platforms)
- File size observed: 968KB+ and growing
Reproduction Steps
- Use Claude Code regularly across multiple projects
- Check
~/.claude.json file size after a few weeks/months
- Observe performance degradation and file bloat
Workaround
Currently users must manually edit .claude.json or use claude history clear which removes ALL history across all projects.
Description
The
.claude.jsonfile continuously accumulates conversation history for each project, leading to:Current Behavior
Expected Behavior
Impact
.claude.jsonto remove old historySuggested Solutions
claude history prunecommand with options like--older-than 30dEnvironment
Reproduction Steps
~/.claude.jsonfile size after a few weeks/monthsWorkaround
Currently users must manually edit
.claude.jsonor useclaude history clearwhich removes ALL history across all projects.