[BUG] Claude Code - Persistent Logout & Configuration Loss Bug Report

Resolved 💬 43 comments Opened Jun 5, 2025 by appboypov Closed Jan 8, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Claude Code - Persistent Logout & Configuration Loss Bug Report

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.11 (Claude Code)
  • Operating System: macOS 15.5.0 (Darwin Kernel Version 24.5.0)
  • Terminal: Warp Terminal

Bug Description

Claude Code persistently logs users out and loses all configuration settings including:

  • Authentication session
  • Theme preferences
  • MCP server configurations
  • All personalized settings

This occurs after system events like battery drain, laptop sleep, or unexpected shutdowns, making the development experience frustrating and unreliable.

Steps to Reproduce

  1. Set up Claude Code with authentication
  2. Configure theme preferences
  3. Set up MCP servers
  4. Work on development projects normally
  5. Experience a system event (battery drain, forced shutdown, extended sleep)
  6. Restart laptop and attempt to use Claude Code
  7. Observe that user is logged out and all configurations are lost

Expected Behavior

  • Authentication session should persist across system restarts
  • Theme preferences should be saved and restored
  • MCP server configurations should be preserved
  • User should not need to reconfigure everything after normal system events
  • Settings should be stored in a persistent location that survives system events

Actual Behavior

  • User gets logged out completely
  • All theme preferences reset to default
  • MCP servers configuration completely disappears (shows "No MCP servers configured")
  • User must manually reconfigure everything from scratch
  • This creates significant workflow disruption and productivity loss

Frequency

  • Occurs consistently after system events
  • Has happened multiple times (at least twice in recent days)
  • Appears to be a recurring pattern, not a one-time issue

Impact

  • High - Causes significant workflow disruption
  • Forces complete reconfiguration of development environment
  • Leads to lost productivity and frustration
  • Makes Claude Code unreliable for regular development work

Additional Context

System Context

  • Development machine: MacBook Pro with Apple Silicon (arm64)
  • Common scenario: Working on development projects with Claude Code active
  • Triggering events: Battery depletion, forced restarts, extended system sleep, MCP server configuration with Claude piping

Previous Incident Pattern

Critical Discovery: A previous logout/reset occurred without battery loss during MCP server configuration. The incident happened while configuring an MCP server that uses "Claude piping" functionality, where Claude Code can serve as an MCP server itself (claude mcp serve).

Suspicious Configuration Evidence: The searchable directories found in ~/.claude/config.json match directories that were being configured during the previous incident:

{
  "searchableDirectories": [
    "/Users/codaveto/Repos/Forks/flutter-packages",
    "/Users/codaveto/Repos/Forks/flutter-packages/turbo_response"
  ]
}

This suggests the MCP configuration process may be writing to or modifying Claude Code's internal configuration in ways that trigger instability or reset behavior.

Configuration Lost

  • Authentication tokens/sessions
  • Theme settings (dark/light mode preferences)
  • MCP server configurations (complete loss of server setups)
  • Any personalized UI preferences

Expected Configuration Persistence

The following should persist across sessions:

  • User authentication (secure token storage)
  • User preferences (theme, UI settings)
  • MCP server configurations
  • Project-specific settings

Suggested Investigation Areas

  1. Authentication Token Storage: Check if tokens are stored in temporary locations that get cleared on restart
  2. Configuration File Location: Verify if config files are being saved to persistent directories
  3. MCP Server Config: Investigate why MCP configurations completely disappear
  4. Session Management: Review session persistence mechanisms
  5. macOS Keychain Integration: Consider using macOS Keychain for secure credential storage
  6. MCP Piping Configuration Safety: Investigate how claude mcp serve and MCP server configuration affects Claude Code's internal state
  7. Directory Scope Conflicts: Examine how MCP server scoping (local/project/user) interacts with Claude Code's searchable directories configuration

Logs/Debugging Information

  • Current MCP status: "No MCP servers configured"
  • No error messages displayed during logout
  • Silent failure - user only discovers the issue when trying to use Claude Code again

Actual Configuration Analysis

Current Configuration Files Found

Configuration is stored in ~/.claude/ directory with the following files:

MCP Server Configuration (~/.claude/.mcp.json):

  • Contains 12 configured MCP servers including TAV2, context7, Firecrawl, Supabase, Google Drive, and others
  • All servers have proper configuration with API keys and environment variables
  • File shows extensive setup that gets completely lost during logout events

Settings (~/.claude/settings.json):

{
  "model": "opus"
}

Search Directories (~/.claude/config.json):

{
  "searchableDirectories": [
    "/Users/codaveto/Repos/Forks/flutter-packages",
    "/Users/codaveto/Repos/Forks/flutter-packages/turbo_response"
  ]
}
MCP Server Logs Show Connection Issues

From ~/Library/Logs/Claude/mcp.log, the logs reveal a pattern of server connections followed by unexpected disconnections:

Recent Session (2025-05-18T22:12:02):

  • All 7 MCP servers initialize successfully
  • Servers establish connections and receive initialization messages
  • Within 2-3 seconds, all servers disconnect unexpectedly with transport closure errors
  • Error pattern: "Server transport closed unexpectedly, this is likely due to the process exiting early"

Specific Error Messages:

[error] [supabase] Server disconnected. For troubleshooting guidance, please visit debugging documentation
[error] [markdownify] Server disconnected. For troubleshooting guidance, please visit debugging documentation  
[error] [gdrive] Server disconnected. For troubleshooting guidance, please visit debugging documentation
[error] [mcp-server-firecrawl] Server disconnected. For troubleshooting guidance, please visit debugging documentation
Root Cause Analysis
  1. Configuration Persistence: Config files exist and are properly formatted, but Claude Code appears to ignore them after logout events
  2. MCP Server Instability: Servers connect but immediately disconnect, suggesting process management issues
  3. Authentication State: No authentication tokens found in accessible config files, suggesting they may be stored in macOS Keychain or temporary locations that get cleared
  4. MCP Configuration Corruption: Previous incident occurred when configuring MCP servers with Claude piping functionality, suggesting MCP configuration process may trigger system instability
Critical Technical Findings
  • Configuration files are preserved but not being loaded after logout
  • MCP servers show successful initialization followed by immediate disconnection
  • The disconnect pattern suggests Claude Code process management issues rather than configuration corruption
  • All servers fail simultaneously, indicating a systemic issue rather than individual server problems

Diagnostic Information for Claude Code Team

Confirmed Configuration Locations
  • Primary config directory: ~/.claude/
  • MCP configuration: ~/.claude/.mcp.json (confirmed working config with 12 servers)
  • User settings: ~/.claude/settings.json
  • Search directories: ~/.claude/config.json
  • Log files: ~/Library/Logs/Claude/mcp.log
Authentication Token Storage

Authentication tokens are NOT found in the readable configuration files, indicating they are likely stored in:

  • macOS Keychain (recommended but may be getting cleared)
  • Memory-only storage (problematic for persistence)
  • Temporary directories that get cleared on restart
MCP Configuration Corruption Pattern

Key Finding: The searchable directories configuration appears to be left over from MCP server setup, specifically when configuring servers that access local repositories. This suggests:

  1. MCP Scope Confusion: MCP servers can be configured with different scopes (local/project/user), and the configuration process may be incorrectly writing to Claude Code's global configuration
  2. Claude Piping Side Effects: Using claude mcp serve (Claude Code as MCP server) may create feedback loops or configuration conflicts
  3. Directory Persistence: The fact that these directories persist in config.json after MCP configuration suggests the MCP setup process is modifying Claude Code's core configuration files

Reproduction Path: The bug may be reproducible by:

  1. Configuring MCP servers with local directory access
  2. Setting up Claude Code as an MCP server (claude mcp serve)
  3. Creating MCP servers that reference local repositories/directories
  4. The configuration process appears to modify Claude Code's internal settings, potentially triggering logout/reset behavior
Current Session Information
  • Working directory: /Users/codaveto/Repos/Forks/prompt-forge-ui-builder
  • Shell: $SHELL environment
  • Terminal: Warp Terminal
  • Architecture: arm64 (Apple Silicon)

Workaround

Currently, the only workaround is to manually reconfigure everything:

  1. Re-authenticate with Claude Code
  2. Reset theme preferences
  3. Reconfigure all MCP servers
  4. Restore any custom settings

This is time-consuming and disruptive to development workflow.

---

Priority: High - This severely impacts user experience and productivity
Category: Authentication & Configuration Management
Affected Versions: 1.0.11 (likely affects other versions)

View original on GitHub ↗

43 Comments

appboypov · 1 year ago

!Image

It just happened again, I had 5 instances running in 3 different projects. I closed one instance with Ctrl + C and then started it again. It showed me the Welcome to Claude Code message, I then closed the tab in hopes that it would not be reset again. However as you can see in the screenshot it was. I have to auth myself again and add all MCP servers as well. Luckily I have them somewhere and Claude Code can add them globally based on that, but it's getting pretty annoying. No idea why it happened this time.

edit: Might worth noting everything kept working fine in the other sessions, but from experience I know that would only last until I ended the session. I have now logged back in and restored the MCP servers.

appboypov · 1 year ago

Courtesy of Claude Code:

Debug Information for Claude Code Issue #1676

MCP Server Configuration Loss After Restart

Issue Summary

Claude Code restarted itself, logged the user out, and lost all MCP server configurations. This is the third occurrence of this issue.

Environment Details

  • Claude Code Version: 1.0.17
  • macOS Version: 15.5 (24F74) - Darwin 24.5.0
  • Node Installation: Using Homebrew (/opt/homebrew/bin/node)
  • Shell: zsh with custom Claude alias
  • Date: June 8, 2025

Key Findings

1. Multiple Claude Processes

There are 5 Claude CLI processes running in different terminal sessions, plus the Claude desktop app processes:

codaveto  68760  claude (terminal session s005)
codaveto  59507  claude (terminal session s016)
codaveto  56270  claude (terminal session s010)
codaveto  48768  claude (terminal session s002)
codaveto  40885  claude (terminal session s001)

This might indicate:

  • Multiple concurrent sessions could be causing conflicts
  • Possible race conditions when accessing configuration files
2. Configuration File State
  • ~/.claude/.mcp.json: Last modified May 27, 20:11 (old timestamp)
  • ~/.claude/settings.json: Empty {}
  • ~/.claude/settings.local.json: Contains MCP permissions but no server configurations

``json
{
"permissions": {
"allow": [
"Bash(claude mcp add -s user dart -e DART_TOKEN=XXX npx -y dart-mcp-server)",
"Bash(claude mcp add:*)"
]
},
"enableAllProjectMcpServers": false
}
``

  • No project-specific directory found for bwai
3. Missing Logs

No log files found in standard locations:

  • No Claude logs in ~/Library/Logs
  • No .log files in ~/.claude/
  • No apparent crash reports or error logs
4. Shell Configuration

User has a custom alias in .zshrc:

# Claude fix for env -S issue
alias claude='/opt/homebrew/bin/node /opt/homebrew/bin/claude'

Potential Issues Identified

  1. Configuration Storage Inconsistency: The MCP configuration appears to be stored separately from the .mcp.json file (which has an old timestamp)
  2. Runtime Storage: The actual user-scoped MCP configurations might be stored in the __store.db file or elsewhere
  3. Process Synchronization: Multiple Claude processes could be causing state synchronization issues
  4. No Persistent Logging: Lack of logs makes it difficult to trace what happens during the failure

Recommendations for Developers

1. Add Comprehensive Logging

Implement detailed logging for:

  • MCP server configuration changes (add/remove/update)
  • Authentication state changes
  • Configuration file reads/writes
  • Process lifecycle events
  • Error conditions and stack traces
2. Investigate Storage Mechanism
  • The .mcp.json file timestamp suggests configs might be stored elsewhere
  • Check if __store.db is where runtime configurations are actually stored
  • Ensure proper file locking when multiple processes access configuration
  • Document the actual storage location and format for MCP configurations
3. Handle Multiple Processes
  • Implement proper IPC or file locking to prevent configuration conflicts
  • Consider using a single configuration service process
  • Add mutex/semaphore protection for configuration file access
  • Implement configuration change notifications across processes
4. Add Recovery Mechanism
  • Backup configurations before updates
  • Implement configuration validation on startup
  • Add ability to restore from backup if primary config is corrupted
  • Consider versioning configuration files
5. User Experience Improvements
  • Add clear error messages when configuration is lost
  • Provide automatic backup/restore functionality
  • Show warnings when multiple Claude instances are detected
  • Add a claude mcp backup and claude mcp restore command

Additional Context

This appears to be a critical issue affecting user workflow, especially given it's happened three times to the same user. The lack of error logs and the fact that configurations are completely lost (not just corrupted) suggests this might be related to:

  • Authentication token expiration causing a full reset
  • Process cleanup routines being too aggressive
  • Storage location being cleared during some update or cleanup process

Restored MCP Servers

The following servers were restored from the user's backup:

  1. TAV2 (Tavily search)
  2. dart (Dart package server)
  3. context7 (Upstash context)
  4. mcp-server-firecrawl (Web scraping)
  5. figma-developer-mcp (Figma API)
  6. gdrive (Google Drive)
  7. supabase (PostgreSQL database)
  8. supabase-postgrest (REST API)
  9. markdownify (Markdown conversion)
  10. puppeteer (Browser automation)
  11. local-context (Local repository scanner)
  12. imagen-3-0-generate-google (Google's Imagen 3.0)
appboypov · 1 year ago

Aaaand again.. 😩

!Image

!Image

germanoeich · 1 year ago

I'm experiencing the same thing on PopOS 22.04 (Ubuntu based), have been experiencing this since 1.0, roughly. In my case, every time I restart my computer claude loses its configuration, mcp, everything. I'm forced to setup everything again. Sometimes a restart is not even needed to trigger this bug. Using GNOME Terminal.

nikolaidk · 1 year ago

Same problem. After new login on max plan all configuration is lost and gone; empty config file.

zsbenke · 1 year ago

I encountered this issue twice last week. All my configuration and MCP server setup was lost. Fortunately, I have a setup script for MCP servers, but this issue is quite frustrating. I haven’t noticed any patterns that could trigger this. I didn’t restart my MacBook either.

mattgodbolt · 1 year ago

I just had this happen twice, back to back, losing my (global) MCP configuration twice! argh

mattgodbolt · 1 year ago

And just now a third time: seems like the latest update (1.0.29) seems to happen each time I start up

micahscopes · 1 year ago

This happened to me just now when I tried using a configuration of this form:

{
  "mcpServers": {
    "language-server": {
      "command": "/full/path/to/your/clone/mcp-language-server/mcp-language-server",
      "args": [
        "--workspace",
        "/path/to/workspace",
        "--lsp",
        "language-server-executable"
      ],
      "env": {
        "LOG_LEVEL": "DEBUG"
      }
    }
  }
}

(notice the env key, when I added that claude code crashed and overwrote my config 😭 )

ashwin-ant collaborator · 1 year ago

I believe this is actually a duplicate of #1788, which we should have fixed in the next release.

appboypov · 1 year ago

@ashwin-ant I don't think it is. #1788 just mentions a reset of MCP config. We are also being logged out and need to reauthenticate. It happened to me AGAIN a few minutes ago. First session of the day.

appboypov · 1 year ago

claude --version
1.0.31 (Claude Code)

notabene00 · 1 year ago

Agreed. Also, the problem mentioned is macOS related as far as I understand. I'm experiencing this one on Debian

mattgodbolt · 1 year ago

This absolutely still happens to me too on Ubuntu 25.04

ashwin-ant collaborator · 1 year ago

Can you confirm if this tends to happen after modifying the an MCP configuration, or if it's just random?

mattgodbolt · 1 year ago

@ashwin-ant not clear who you're asking. For me it was outside of MCP configuration (I have stopped reconfiguring MCPs as I expect to lose the configuration again)

ashwin-ant collaborator · 1 year ago

I'm trying to understand this better. ~/.claude/.mcp.json is not a supported file path for MCP config. The only place where MCP configs are stored currently are ~/.claude.json and .mcp.json in your project directory. It sounds like the issue here is that ~/.claude.json is being reset in some way. If anyone's able to confirm that, that would be very helpful here.

jfaithedu · 1 year ago

can confirm this issue on ubuntu - has been driving me nuts. Have to log in multiple times per day, and loose all MCP configurations each time. The reset is seemingly random for me. I have stopped utilising MCPs as a result of not wanting to set them up every two hours.

mattgodbolt · 1 year ago

Exactly; the main Claude dotfile config gets replaced and I lose my MCP config and credentials etc, as if I had just installed for the first time.

appboypov · 1 year ago

@ashwin-ant - indeed not the ~/.claude/.mcp.json, just using that as my backup source. but good to know the location of the actual config! that was a mystery to me.

i've copied its contents and will compare / checkout the contents should it happen again. i'm pretty sure it does though if I look at my firstStartTime it says 5 days ago (see screenshot, second arrow).

i'll keep an eye on this file and will update with my findings should it happen again. if you need any other details let me know

<img width="870" alt="Image" src="https://github.com/user-attachments/assets/bbe1d391-1a3c-4855-970d-75db2f1a1370" />

appboypov · 1 year ago

Something interesting happened today. I tried to start claude after exiting my terminal (warp) accidentally and it showed my my .claude.json was corrupt (image 1). I looked it up and it showed the mess you in (image 2) at line 2340. Partially duplicated the end of the JSON somehow.

After removing the duplicated partial data it all worked fine.

I'm guessing this is a new mechanic and could be the culprit of previous issues. No idea how it happened though, I haven't touched it anywhere. Perhaps closing the terminal interrupted some kind of update to the file is all I can think of, still weird that it shows double partial data. Either way hope this helps and I'm glad I still have my config.

!Image

!Image

ashwin-ant collaborator · 1 year ago

Hey all, thanks again for the patience here. We believe we have a fix, but we're taking some extra time to make sure we get it right.

appboypov · 1 year ago

I hope so! Just happened again for the first time. I opened a window, typed claude and it somehow launched two instances shortly after each other. I quit because I thought I saw two claude interfaces in one session. Then started it again and I had to choose the theme. I saw these corrupted files in my finder and the .claude.json is pretty much empty.

!Image

!Image

jfaithedu · 1 year ago

I found the source issue for me, and implemented an easy fix that seems to have solved it.

When running the local installation, it would attempt an auto update - but would install the update globally rather than locally. This would result in two conflicting versions attempting to run when running "claude"

Running migrate-installer would return "Already running from local installation. No migration needed."

However, upon inspection of .claude.json it was evident that installation method was set to "global"

i corrected it to local, removed the global installation, and no longer have the issue of being logged out every 45 minutes.

ashwin-ant collaborator · 1 year ago

Are people still seeing this in 1.0.43? We rolled out a potential fix but please let me know if it's still happening and we can keep working on this.

kylesnowschwartz · 1 year ago

Hello @ashwin-ant I've actually experienced this for the first time Today after a marathon claude-coding session yesterday. It's possible that the version update with multiple instances open may have actually caused the corrupted .claude.json file.

What would be your suggested approach for recovery? Should I start with a fresh settings file (I've re-logged into my Anthropic account and it has provided a different userID which I find somewhat concerning) or try and fix the .claude.json.corrupted.xxxxxx file?

igorkofman collaborator · 1 year ago

@kylesnowschwartz - did you confirm your claude --version

kylesnowschwartz · 1 year ago

@igorkofman I surely did - 1.0.43 (Claude Code) - I have it on auto-update as well. FWIW the claude.json.corrupted file was 20mb large

igorkofman collaborator · 1 year ago

What happens if you rename claude.json.corrupted to claude.json and launch
claude (backup your real claude.json) - it should tell you what failed to
parse on launch.

On Mon, Jul 7, 2025 at 2:42 PM kylesnowschwartz @.***>
wrote:

kylesnowschwartz left a comment (anthropics/claude-code#1676) <https://github.com/anthropics/claude-code/issues/1676#issuecomment-3046597633> @igorkofman <https://github.com/igorkofman> I surely did - 1.0.43 (Claude Code) - I have it on auto-update as well. FWIW the claude.json.corrupted file was 20mb large — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/1676#issuecomment-3046597633>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AADSWQRH3HIJDRYJXKMDUR33HLSTTAVCNFSM6AAAAAB6WPLWC2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANBWGU4TONRTGM> . You are receiving this because you were mentioned.Message ID: @.***>
jfaithedu · 1 year ago
Are people still seeing this in 1.0.43? We rolled out a potential fix but please let me know if it's still happening and we can keep working on this.

yes

appboypov · 1 year ago

<img width="1051" height="508" alt="Image" src="https://github.com/user-attachments/assets/36182e10-66c1-4d22-9328-04eccdc36726" />

just happened again.

as seen in my previous comment the JSON gets malformed, it duplicates a part of it and makes the JSON invalid.

This time exactly the same happened. After restoring one of the backups everything is fine.

I tihnk it has to do with the fact that every paste i make gets saved locally am I right. This makes the JSON grow incredibly large and then when i quit claude (with multiple or single sessions(s)) by closing my terminal it doesnt have enough time toparse and save the JSON or something? I know it happens after I close Claude at least. So probably the big file size + serialisation and deserialissation

appboypov · 1 year ago

I think if we make some kind of invalid JSON fixer it might be a good workaround for now. Everytime I checked the corrupted JSON i see there is duplicated parts of the JSON added to the end of the file. when i remove that the JSON becomes valid again

dmitryrechkin · 1 year ago
Are people still seeing this in 1.0.43? We rolled out a potential fix but please let me know if it's still happening and we can keep working on this.

Yes, nothing has changed

dhollman contributor · 10 months ago

Are people still seeing this on 1.87 or later? It's been a couple of months since we've seen this issue reported.

mattgodbolt · 10 months ago

I consistently lose my MCP configuration: most recently had to re-re-re-re-install the user-level github MCP on Tuesday. Not sure what version that was (I keep it autoupdated). Today I am on version 1.88

mattgodbolt · 10 months ago

I just went to check again and I am totally lost about what's going on.

I can see from my _shell history_ that I ran:

> 786ms  3d ago claude mcp add github-mcp-server -s user -- github-mcp-server stdio

From my home directory:

bollo:~ 8.8s $ claude mcp list
No MCP servers configured. Use `claude mcp add` to add a server.
bollo:~ 0.7s $ 

So!? where did it go
?
I _distinctly recall_ it saying it had written to ~/.claude.json:

bollo:~ $ ls -l ~/.claude.json
-rw-rw-r-- 1 matthew matthew 2292681 Aug 23 09:05 /home/matthew/.claude.json

which is a gargantuan document, but poring over it with jq shows _no_ github MCP.. I _know_ that before now I've seen the MCP configuration in there.

Confusingly there's also a ~/.claude directory:

bollo:~ 50.8s $ ls -l ~/.claude
total 108
drwxrwxr-x  2 matthew matthew  4096 Jul 29 11:28 agents/
lrwxrwxrwx  1 matthew matthew    50 Apr 15 08:17 CLAUDE.md -> ../.homesick/repos/dotfiles/home/.claude/CLAUDE.md
drwxrwxr-x  2 matthew matthew  4096 Jul 30 15:04 config/
drwxrwxr-x  2 matthew matthew  4096 Aug 22 09:58 ide/
drwxrwxr-x  3 matthew matthew  4096 Aug 20 09:37 plugins/
drwxrwxr-x 22 matthew matthew  4096 Aug 22 17:39 projects/
-rw-rw-r--  1 matthew matthew   726 Aug 13 11:51 settings.json
-rw-rw-r--  1 matthew matthew   145 Jun 10 15:07 settings.local.json
drwxrwxr-x  2 matthew matthew  4096 Aug 22 17:39 shell-snapshots/
drwxrwxr-x  2 matthew matthew  4096 Jun 21 12:57 statsig/
drwxrwxr-x  2 matthew matthew 69632 Aug 22 17:39 todos/

The settings.json contains:

bollo:~ $ jq -C . ~/.claude/settings.json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "feedbackSurveyState": {
    "lastShownTime": 1754004393588
  },
  "model": "opusplan",
  "statusLine": {
    "type": "command",
    "command": "input=$(cat); cwd=$(echo \"$input\" | jq -r '.workspace.current_dir'); hostname_short=$(hostname -s); user=$(whoami); if [ \"$user\" = \"root\" ] || [ \"$user\" = \"toor\" ]; then suffix='#'; else suffix='$'; fi; git_info=\"\"; if [ -d \"$cwd/.git\" ]; then cd \"$cwd\" && git_branch=$(git branch --show-current 2>/dev/null) && [ -n \"$git_branch\" ] && git_info=\" ($git_branch)\"; fi; printf \"\\033[2;36m%s\\033[0m:%s%s %s \" \"$hostname_short\" \"$(basename \"$cwd\")\" \"$git_info\" \"$suffix\""
  }
}

and

bollo:~ $ jq -C . ~/.claude/settings.local.json
{
  "permissions": {
    "allow": [
      "WebFetch(domain:cppcast.com)",
      "Bash(curl:*)"
    ]
  },
  "enableAllProjectMcpServers": false
}

... so where the heck did github MCP go? I haven't removed it. It has vanished.

I _know_ that I used it after re-adding it 3 days ago as it's part of a process where my CLAUDE instructions tell it to _only use the MCP_.

---

Now trying to -re-add it, to see what happens.

bollo:~/d/c/compiler-explorer (main|✔) 1.0s $ claude mcp add github-mcp-server -s user -- github-mcp-server stdio
Added stdio MCP server github-mcp-server with command: github-mcp-server stdio to user config
File modified: /home/matthew/.claude.json

so, yes, it wants to edit my ~/.claude.json as I recalled. and now there's an MCP servers section:

  "mcpServers": {
    "github-mcp-server": {
      "type": "stdio",
      "command": "github-mcp-server",
      "args": [
        "stdio"
      ],
      "env": {}
    }
  },

Just observationally there is a _TON_ of chat history context in that file. How do multiple concurrent claude sessions handle updating that file? I'll likely have 3-5 claude sessions open at once and my expectation is that adding an MCP "user level" should be "sticky" EVEN if there are running claude sessions. Is that part of it?

That said I'm sure I've also tried adding MCPs other ways.

Additionally:

  • _please_ don't mix config and history in a file like this. It seems really bad and prone to this kind of problem. I'm sure if MCPs were stored in ~/.claude/mcp.json we would not have this issue
  • why on earth is there a ~/.claude.json and a ~/.claude directory? Please put everything in one place.

I'm on Linux, claude doctor says:

bollo:~/d/c/compiler-explorer (main|✔) 2.7m $ claude doctor

 Diagnostics
 └ Currently running: native (1.0.88)
 └ Path: /home/matthew/.local/bin/claude
 └ Invoked: /home/matthew/.local/share/claude/versions/1.0.88
 └ Config install method: native
 └ Auto-updates enabled: true
 └ Search: OK (bundled)

 Press Enter to continue…

@dhollman

mattgodbolt · 10 months ago

To the extent it's helpful I can share my entire .claude.json or whatever with daisy directly (and/or screenshare). Let me know :)

ollie-anthropic collaborator · 10 months ago

hey all, we thought we had landed a fix for this a few weeks ago, but evidently @mattgodbolt is stilling getting errors, even if the number of users reporting this has decreased - i'll pick this up and investigate a fix

mattgodbolt · 10 months ago

Thank you! I haven't tried recently making any changes to configuration, but still re add my MCPs and see if I can get it to trigger again.

CyrisXD · 9 months ago

Been experiencing these issues as well, as well as Claude Code that keeps expiring my login sessions. I've found the VSCode extension extremely buggy as well but this is in Cursor which I assume isn't tested.

github-actions[bot] · 7 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.

github-actions[bot] · 6 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.

github-actions[bot] · 6 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.