Separate configuration from conversation history in ~/.claude.json
Resolved 💬 3 comments Opened Oct 17, 2025 by gitmor Closed Oct 21, 2025
Feature Request: Separate Configuration from Conversation History in ~/.claude.json
Problem
Currently, ~/.claude.json mixes two very different types of data:
- Configuration data (MCP servers, settings, user preferences)
- Conversation history (every prompt entered across all projects)
This causes several issues:
1. File Size and Performance
- The file grows indefinitely with conversation history
- My
~/.claude.jsonis currently 1300+ lines with history from multiple projects - Large file size impacts:
- Startup time (parsing large JSON on every launch)
- Write performance (updating the entire file frequently)
- Memory usage
2. Mixed Concerns
{
"mcpServers": { /* actual config */ },
"projects": {
"/some/path": {
"history": [
/* 100+ conversation entries */
]
}
}
}
Configuration (MCP servers, allowed tools) is permanent, while history is ephemeral and grows constantly.
3. Difficult to Manage
- Hard to manually edit MCP server configuration when surrounded by hundreds of history entries
- Can't easily version control just the configuration
- Risk of corruption increases with file size
- No easy way to clear history without losing configuration
4. Privacy Concerns
- All conversation history stored in plain text
- Includes potentially sensitive commands, file paths, and prompts
- Difficult to selectively clean up
Proposed Solution
Split into separate files:
~/.claude/
├── config.json # MCP servers, global settings
├── sessions.db # Conversation history (already exists)
└── project-metadata.json # Per-project stats, last used, etc.
config.json
{
"mcpServers": { /* ... */ },
"numStartups": 51,
"autoUpdates": false,
"forceLoginMethod": "...",
"subscriptionInfo": { /* ... */ }
}
project-metadata.json
{
"/home/user/project": {
"lastSessionId": "...",
"lastCost": 0.15,
"allowedTools": [],
"projectOnboardingSeenCount": 4,
"exampleFiles": [/* ... */]
}
}
sessions.db
(Already exists - continue using for full conversation storage)
Benefits
- Performance: Smaller config file = faster startup
- Maintainability: Easy to edit MCP configuration
- Version Control: Can safely commit
config.jsonto dotfiles - Privacy: History is in database, easier to manage/purge
- Stability: Less risk of corrupting important configuration
Migration Path
- Automatically migrate existing
~/.claude.jsonon first launch - Keep reading old format for backwards compatibility
- Warn users after migration completes
Alternative: At Minimum
If full separation is too complex, at least:
- Limit history entries per project (e.g., keep only last 50)
- Add
claude config clear-historycommand - Move history to a separate section that can be easily deleted
---
Current Workaround
Users currently have no good options except:
- Manually editing the large JSON file (risky)
- Periodically deleting the entire file (loses all configuration)
- Living with the growing file size
Related
This aligns with the existing pattern where full conversations are stored in ~/.claude/sessions.db, so history in the JSON file is redundant for anything except recent command autocomplete.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗