Claude Code Rust-Analyzer Conflict — Fix (2026)
The Error
Claude Code conflicts with rust-analyzer: duplicate completions
The Fix
// Add to your VS Code settings.json
{
"claude-code.completions.disabledLanguages": ["rust"]
}
# Open VS Code settings directly
code ~/.config/Code/User/settings.json
Why This Works
Both Claude Code and rust-analyzer register as completion providers for Rust files. VS Code merges their results, producing duplicates and slowing the completion popup. Disabling Claude Code completions for Rust files lets rust-analyzer handle language-specific completions while Claude Code still provides chat, edits, and tool use for Rust projects.
If That Doesn’t Work
# If duplicates persist, set completion provider priority
# Add to settings.json:
# "editor.snippetSuggestions": "bottom",
# "rust-analyzer.completion.autoimport.enable": true,
# "[rust]": { "editor.defaultFormatter": "rust-lang.rust-analyzer" }
# Alternatively, reload after the change
# Command Palette > Developer: Reload Window
Ensure you are running the latest versions of both extensions. Older versions of Claude Code (pre-1.2) lacked the disabledLanguages setting. If you use multiple Rust workspaces, apply the setting at the user level rather than the workspace level to avoid repeating the configuration in every project.
Prevention
Add to your CLAUDE.md:
Claude Code inline completions are disabled for Rust files. Use Claude Code for chat-based assistance and refactoring in Rust projects, not inline completions.
See Also
Related Error Messages
This fix also applies if you see these related error messages:
Error reading configuration fileJSON parse error in configConfig key not recognizedSyntaxError: Unexpected token in JSON at position 0JSON.parse: unexpected character at line 1 column 1
Frequently Asked Questions
Where does Claude Code store its configuration?
Configuration is stored in ~/.claude/config.json for global settings and .claude/config.json in the project root for project-specific settings. Project settings override global settings for any overlapping keys.
How do I reset Claude Code configuration?
Delete the configuration file and restart Claude Code: rm ~/.claude/config.json && claude. Claude Code recreates the file with default values on next startup. Back up the file first if you have custom settings you want to preserve.
Can I share configuration across a team?
Yes. The project-level .claude/config.json and CLAUDE.md files can be committed to version control. Team members get consistent Claude Code behavior when they check out the repository. Keep API keys and personal preferences in the global config only.
Why does JSON parsing fail on API responses?
JSON parse failures on API responses typically indicate a network issue where an intermediate proxy returned an HTML error page instead of JSON. Check the raw response by enabling debug logging with CLAUDE_LOG_LEVEL=debug to see the actual content received.
Related Guides
Configure permissions → Build your settings with our Permission Configurator.
Try it: Paste your error into our Error Diagnostic for an instant fix.
- Terminal Emulator Rendering Artifacts — Fix (2026)
- How to Use Thirdweb SDK Workflow (2026)
- Python Virtualenv Not Activated — Fix (2026)
- Claude Code Offline Mode Setup (2026)
Implementation Details
When working with this in Claude Code, pay attention to these practical details:
Project configuration. Add specific instructions to your CLAUDE.md file describing how your project handles this area. Include file paths, naming conventions, and any patterns that differ from common defaults. Claude Code reads CLAUDE.md at the start of every session and uses it to guide all operations.
Testing the setup. After configuration, verify everything works by running a simple test task. Ask Claude Code to perform a read-only operation first (like listing files or reading a config) before moving to write operations. This confirms that permissions, paths, and tools are all correctly configured.
Monitoring and iteration. Track your results over several sessions. If Claude Code consistently makes the same mistake, the fix is usually a more specific CLAUDE.md instruction. If it makes different mistakes each time, the issue is likely in the project setup or toolchain configuration.
Troubleshooting Checklist
When something does not work as expected, check these items in order:
- CLAUDE.md exists at the project root — run
ls -la CLAUDE.mdto verify - Node.js version is 18+ — run
node --versionto check - API key is set — run
echo $ANTHROPIC_API_KEY | head -c 10to verify (shows first 10 characters only) - Disk space is available — run
df -h .to check - Network can reach the API — run
curl -s -o /dev/null -w "%{http_code}" https://api.anthropic.com(should return 401 without auth, meaning the server is reachable) - No conflicting processes — run
ps aux | grep claude | grep -v grepto check for stale sessions