[Bug] The .claude.json elephant in the room: Is this "vibe coding" in production?

Resolved 💬 18 comments Opened Sep 6, 2025 by kolkov Closed Feb 5, 2026

The .claude.json architectural failure: When "vibe coding" meets production reality

Dear Anthropic team,

After months of watching critical architectural issues go unresolved (#5024, #1449, #6394), while your competitors prepare to launch competing products, I feel compelled to address the elephant in the room with the technical rigor this problem deserves.

The Fundamental Architectural Failure

The .claude.json issue is not a "bug" - it's a textbook violation of basic software engineering principles that any CS undergraduate would recognize:

1. Violation of Single Responsibility Principle (SRP)

Even Bash - a tool from 1989 - understands separation of concerns:

  • .bashrcconfiguration (static settings, aliases, environment)
  • .bash_historylogs/history (dynamic, growing data)

Claude Code violates this fundamental principle by mixing:

  • Static configuration (MCP settings, model preferences)
  • Dynamic unbounded data (conversation history growing to 100MB+)

This is not an "expected behavior" - it's an architectural antipattern.

2. Performance Degradation (O(n) Operations)

Current implementation:

// Every. Single. Operation.
const config = JSON.parse(fs.readFileSync(massiveFile)); // O(n)
config.history.push(newEntry);
fs.writeFileSync(massiveFile, JSON.stringify(config)); // O(n)
  • Parsing/serializing growing JSON files is O(n) complexity
  • Users report 65MB+ files causing startup delays
  • 72+ duplicate MCP processes spawning (reported by @vincentortegajr)
  • This is amateur hour, not enterprise software

3. Data Integrity & Concurrency Issues

Multiple reports of corruption (#3117, #2593, #6181) because:

  • No proper locking mechanisms
  • No atomic writes
  • No transaction safety
  • Concurrent sessions = corrupted JSON

Solution exists since 1970s: Use a database (SQLite would work perfectly).

4. Security & Privacy Nightmare

  • Configuration files are commonly version-controlled
  • Your implementation forces users to commit conversation history to Git
  • Sensitive data, API keys, business logic - all exposed
  • This is a compliance disaster waiting to happen

"Moving to cache" is NOT a Solution

Your proposed "fix" of moving to ~/.cache/ is cosmetic theater, not engineering:

  • Still unbounded growth ❌
  • Still O(n) operations ❌
  • Still corruption-prone ❌
  • Still no rotation/cleanup ❌

This is hiding garbage under the bed, not taking it out.

Your Own Article Describes This Problem

From ["Vibe coding is not the same as AI-Assisted engineering"](https://addyo.substack.com/p/vibe-coding-is-not-the-same-as-ai):

"It worked for a small dataset, but as soon as real-world traffic hit, the system slowed to a crawl"

This literally describes the .claude.json problem.

"No one could trace what was connected to what... There was no mental model, just vibes"

Is this how Claude Code was developed?

"This isn't engineering, it's hoping"

We're not hoping anymore. We're demanding proper engineering.

The Competition Isn't Waiting

DeepSeek is launching their AI coding agent by end of 2025 (Bloomberg, Sept 2025). They're not dealing with config files that corrupt themselves. Microsoft's Copilot Workspace doesn't mix settings with chat history. Even open-source alternatives understand basic data management.

While you're debating whether to move a broken implementation to a different folder, your competitors are building actual solutions.

The Professional Solution (Not Rocket Science)

# Proper Architecture (CS101):
~/.claude/
├── config.json          # Static configuration (5KB)
├── mcp_servers.json     # MCP settings (versioned)
└── data/
    └── history.db       # SQLite for chat history

Benefits:

  • ✅ Proper separation of concerns
  • ✅ O(1) operations with indexing
  • ✅ ACID compliance (no corruption)
  • ✅ Built-in rotation/cleanup
  • ✅ Version control friendly

Questions for Leadership

  1. Resource Allocation: With $2B+ funding, why can't you fix a config file issue that any mid-level engineer could resolve in a sprint?
  1. Quality Assurance: Do you have:
  • Engineers who understand SOLID principles?
  • QA who uses the product beyond demos?
  • Code reviews that would flag this obvious antipattern?
  • Or just "prompt engineers" generating solutions?
  1. Accountability: Who approved shipping production code that:
  • Violates basic CS principles
  • Ignores 8+ months of user reports
  • Damages your technical credibility

Call to Action

Option 1: Fix It Properly

  • Implement proper data separation
  • Use SQLite or similar for history
  • Add rotation/cleanup mechanisms
  • Ship it within 30 days

Option 2: Open Source It

  • Let the community fix it in a weekend
  • We've already built extraction tools (#15)
  • We understand the problem better than you apparently do

Option 3: Continue Ignoring

  • Watch users migrate to DeepSeek's agent
  • Become a cautionary tale about "vibe coding in production"
  • Lose technical credibility permanently

Final Technical Assessment

You're asking developers to trust you with AI-assisted coding while demonstrating inability to:

  • Separate configuration from data
  • Implement basic file management
  • Respond to critical issues for 8+ months
  • Follow your own published best practices

This is not just a bug. It's a competence crisis.

The community has been patient. We've provided workarounds. We've even quoted your own articles back at you.

What we need now is engineering, not excuses.

Respectfully but urgently,
[Anfrey Kolkov]

---

Technical References:

Community Evidence:

  • "This is nuts to do this in this manner" - @nonrev76
  • "IT MAKES THE ENTIRE claude.json COMPLETELY UNUSABLE" - @cosier
  • "Totally unacceptable to be storing mutable data in a config file" - @rebuyengine
  • Files growing to 65MB+ - Multiple reports
  • 72+ duplicate MCP processes - @vincentortegajr

P.S.

If you need help understanding why this is wrong, perhaps ask Claude to explain the Single Responsibility Principle. Or better yet, ask it to review your codebase - it might be horrified by what it finds.

P.P.S.

What is the choice of TS for writing Claude Code worth, when the TS compiler itself is already being rewritten in Go!

View original on GitHub ↗

18 Comments

github-actions[bot] · 10 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5024
  2. https://github.com/anthropics/claude-code/issues/6394
  3. https://github.com/anthropics/claude-code/issues/2539

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

dimension-zero · 10 months ago

This is not a duplicate as it offers fresh ideas for a solution.

1. Fix it properly: Separate concerns, implement rotation, use proper cache directories

+100 on this

2. Open source the relevant modules: Let the community fix what you apparently cannot

+1,000,000,000,000 on this

3. Be transparent: Explain why a multi-billion dollar AI company can't fix a config file issue

+10,000 on this

So I asked Claude Code to analyse its own .claude.json architecture:

Review .claude.json . Then search in github.com/anthropics/claude-code/issues for bug reports about this file. Then constructively criticise the architectural decisions that are revealed. Give me a better approach, so that I can recommend it to Anthropic in issue 7243

and it said the following:

Analysis of .claude.json Architecture Problems Based on my review, here are the critical architectural flaws in Claude Code's configuration system: 1. Fundamental Design Violations Single File Anti-Pattern: Using .claude.json as a monolithic store for configuration, user state, conversation history, and project data violates separation of concerns. Your 392KB file with 1349 lines demonstrates this bloat. Non-Atomic Writes: Direct file overwrites without atomic operations cause corruption during concurrent access - a basic file system reliability failure. 2. Data Architecture Failures Mixed Data Types: Combining: - Static config (theme, autoUpdates) - Runtime state (numStartups, promptQueueUseCount) - Conversation history (massive history arrays) - Project-specific data No Data Lifecycle Management: Conversation history grows indefinitely with no cleanup or archival strategy. Privacy Violation: Sensitive conversations stored in config files create security risks and accidental exposure. 3. Concurrency and Reliability Issues Race Conditions: Multiple Claude instances corrupt the shared file No Locking Mechanism: No file-level coordination between processesPoor Error Recovery: Corrupted files break the entire application Recommended Architecture for Issue #7243 1. Separate Data Concerns
  ~/.config/claude/
  ├── config.json          # Static user preferences
  ├── state.db             # SQLite for runtime state
  ├── projects/            # Per-project configurations
  │   └── {project-hash}.json
  └── sessions/            # Conversation data (separate from config)
      ├── active/
      └── archived/
2. Use Appropriate Storage Technologies SQLite for State Management: - Built-in concurrency control - ACID transactions - Efficient querying - Automatic corruption recovery Structured File Hierarchy: - Configuration files remain JSON for human editing - State data uses SQLite - Large data (conversations) stored separately 3. Implement Proper Concurrency File Locking:
  const writeConfig = async (data) => {
    const tmpFile = `${configPath}.tmp.${process.pid}`;
    await fs.writeFile(tmpFile, JSON.stringify(data, null, 2));
    await fs.rename(tmpFile, configPath); // Atomic operation
  };
Database Transactions for shared state modifications. 4. Data Lifecycle Management Conversation Archival: - Keep only recent conversations in active storage - Archive older conversations to compressed files - Implement retention policies Configuration Validation: - Schema validation on read/write - Automatic migration for version changes - Graceful fallbacks for corruption 5. Privacy and Security Separate Sensitive Data: - Move conversation history out of config - Implement encryption for sensitive conversations - Clear separation between shareable config and private data Environment-Specific Storage: - Machine-specific state stays local - Shareable config can be version-controlled - Clear documentation on what's safe to sync This architecture would eliminate the corruption issues, improve performance, enable proper concurrent usage, and address the privacy concerns while maintaining the user experience Claude Code aims for.

Share the code with me and I will do all of this!

sldx · 10 months ago

I came here to write a similar message to yours. So thank you for sparing me of the ordeal.

Unfortunately, I see it's not a very popular issue, though I wish it was.

I can't believe a company like Anthropic put in a configuration file with MCP configurations and other user-level configs, the history junk, allowed tools per folder, and changelog(!?!?!?). What intern from hell designed this??

What's worse is that this wasn't like this from the beginning, unless my memory fails me. I remember when these were separated. I used to, from time to time, edit this file to add or remove an MCP or change some other configuration, and it wasn't a pile of junk.

Anyway, to also offer some solutions.

  • Keep all the user level configs in this file. That's perfectly fine.
  • Move all the project level configs in the project folder itself, where it already creates a /.claude/ folder with a json in it. Keeping project level configs in a completely different location is prone to desynchronization errors: like if I just rename that project folder, all the settings for it will be lost because they are not connected to this folder anymore 🤦‍♂️

Please fix this steaming pile of crap in this otherwise pretty brilliant product 🙏

sldx · 10 months ago

To also offer a solution to all the poor souls who want to clean up this mess. Run this:

jq 'walk(if type == "object" and has("display") and has("pastedContents") then empty else . end)' .claude.json

Not an ideal solution since new junk will continue to accumulate and you will lose your history, but such is life.

sldx · 10 months ago

Also, while we're at it, maybe we can also fix the two claude config files that don't really make any sense: the ~/.claude.json and ~/.claude/settings.json

kolkov · 9 months ago

@bcherny - Following up on v2.0.0 release and #8353

Hi Boris,

Congratulations on the v2.0.0 release! The native VS Code extension and new features look great. However, I wanted to respectfully bring your attention to this critical issue that remains unresolved.

Current Situation

  1. v2.0.0 shipped without addressing the .claude.json architectural issues documented here
  2. Issue #8353 (requesting release notes) was closed with a brief changelog that doesn't mention this problem
  3. 8+ months have passed since the initial reports (#5024, #1449, #6394)

The Impact

This isn't just a minor inconvenience. Users are experiencing:

  • Config files growing to 65MB+
  • Startup delays of 30+ seconds
  • Regular data corruption requiring manual cleanup
  • Performance degradation making the tool unusable for long-running projects

Constructive Request

I understand major releases involve complex prioritization decisions. Could you please help us understand:

  1. Is this issue on the roadmap? Even a "yes, targeted for v2.1" would help manage expectations
  2. Are there technical blockers? The community has proposed several solutions and would be happy to contribute
  3. Can we help? Many of us are experienced engineers willing to submit PRs if given guidance

Why This Matters

Your article on ["Claude Code Best Practices"](https://www.anthropic.com/engineering/claude-code-best-practices) emphasizes professional engineering approaches. This architectural issue contradicts those principles by violating SRP and basic data management patterns.

As Claude Code gains adoption in professional environments, stability and performance become critical for maintaining trust.

Moving Forward

Rather than just highlighting problems, here's a minimal fix proposal:

~/.claude/
├── config.json          # Static configuration only
├── mcp_servers.json     # MCP settings  
└── data/
    └── history.db       # SQLite for conversation history

This separation would solve the immediate issues while maintaining backward compatibility through a migration script.

Would you be open to discussing this further? The community is eager to help make Claude Code the reliable tool we all want it to be.

Best regards,
Andrey Kolkov

P.S. - Appreciate all the work you and the team put into Claude Code. We're raising this because we care about the product's success.

---

cc: @anthropic-team
Related: #5024 #1449 #6394 #8353

dimension-zero · 9 months ago

Excellent comment. Agreed all points.

@anthropics please communicate with the community! Set up a bot if you have to! We are very keen to hear your thoughts. And are here to help.

kolkov · 9 months ago

@dimension-zero They don't want to listen to us at all, ok, let's create our own agent, open source, I guess... :)

dimension-zero · 9 months ago
@dimension-zero They don't want to listen to us at all, ok, let's create our own agent, open source, I guess... :)

Let's not be unkind. The market will fix this.

kolkov · 9 months ago

@dimension-zero Chinese, where there is a communist party, will fix it. ))
https://api-docs.deepseek.com/news/news250929#-api-update

https://www.leidenranking.com/ranking/2024/list - Mathematics and computer science 30 of 30!!!

sldx · 9 months ago
@dimension-zero They don't want to listen to us at all, ok, let's create our own agent

With blackjack, and h**kers

InfiniteInsight · 9 months ago

This is a huge problem that most people probably don't know about. This regularly grinds my progress to a halt.

okke-formsma · 7 months ago

aargh this still happens all the time. It's December now. I guess i'll use another agent that won't forget about my mcp servers all the time.

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

kolkov · 6 months ago
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

This not fixed yet!

github-actions[bot] · 5 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 5 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 5 months ago

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.