This document outlines potential improvements, new features, and enhancement ideas for the claude-code-zed integration. Contributions welcome!
- P0 - Critical / High Impact
- P1 - Important / Medium Impact
- P2 - Nice to Have / Low Impact
- Effort: S (small, <1 day), M (medium, 1-3 days), L (large, 1+ week)
Currently the integration is primarily one-way (Zed → Claude). Enabling Claude to send commands back to Zed would unlock powerful features.
What: When Claude references a file, clicking it opens in Zed at the correct line.
Implementation:
- Implement
openFiletool handler inmcp.rs(currently stubbed) - Use Zed's LSP
workspace/applyEditor custom command - Pass file path, line number, and optional selection range
Files to modify:
claude-code-server/src/mcp.rs- Implement actual file openingclaude-code-extension/src/lib.rs- Handle incoming commands
What: When Claude suggests code changes, apply them directly in Zed with a diff view.
Implementation:
- Implement
openDifftool handler properly - Create temporary file with new content
- Trigger Zed's diff view between original and modified
- Handle accept/reject callbacks
Protocol reference: See openDiff in claudecode.nvim PROTOCOL.md
What: Claude can insert code snippets at the current cursor position.
Implementation:
- Track cursor position (not just selection)
- Implement
insertTextcommand - Use LSP
workspace/applyEditwith insert operation
What: Share TypeScript errors, ESLint warnings, etc. with Claude for context-aware debugging.
Current state: LSP client in extension doesn't expose diagnostics.
Implementation options:
Option A: Zed Extension API (if available)
- Check if Zed's extension API exposes
textDocument/publishDiagnostics - Subscribe to diagnostic events in
lib.rs - Forward to server via custom LSP notification
Option B: External LSP Client
- Run a separate LSP client for the target language
- Parse diagnostics and merge with selection context
- More complex but doesn't depend on Zed API
Files to modify:
claude-code-extension/src/lib.rs- Diagnostic subscriptionclaude-code-server/src/lsp.rs- New notification typeclaude-code-server/src/mcp.rs-getDiagnosticstool
What: Filter diagnostics by severity (errors only, warnings, hints).
Implementation:
- Add configuration option
- Filter in server before sending to Claude
What: Send list of all open files in Zed to Claude for broader context.
Implementation:
- Implement
getOpenEditorstool (currently returns empty) - Track document open/close events in LSP server
- Maintain in-memory list of open documents
What: Allow Claude to search for symbols across the workspace.
Implementation:
- Forward
workspace/symbolrequests to Zed's built-in LSP - Parse and return results to Claude
- Enable "find all usages of X" type queries
What: Send project file tree to Claude for navigation context.
Implementation:
- Walk directory tree (respecting .gitignore)
- Send as context with selection
- Cache and invalidate on file system changes
What: Support Zed's multiple cursor selections.
Current state: Only tracks single selection.
Implementation:
- Modify
SelectionChangedNotificationto include array of selections - Update Claude context to show all selected regions
What: Remember recent selections for "what did I select before?" queries.
Implementation:
- Ring buffer of last N selections (configurable)
- Timestamp each selection
- Expose via
getSelectionHistorytool
What: Automatically expand selection to semantic boundaries (function, class, block).
Implementation:
- Use LSP
textDocument/selectionRangecapability - Offer "expand to function" style commands
- Requires language-aware parsing
What: Auto-reconnect when connection drops, don't require /ide again.
Implementation:
- Implement heartbeat/ping in WebSocket
- Auto-reconnect with exponential backoff
- Persist auth token for session
What: Don't read entire file on every selection, use ranges.
Current state: read_text_from_range reads full file each time.
Implementation:
- Cache file contents with modification timestamp
- Invalidate on
didChangeevents - Only read changed portions
What: Don't spam selection events on rapid cursor movement.
Implementation:
- Add configurable debounce (default 100ms)
- Only send after selection stabilizes
- Reduces WebSocket traffic significantly
What: Show connection status in Zed's status bar.
Implementation:
- Use Zed's status bar API (if available)
- Show: Connected/Disconnected, last selection sent
- Click to reconnect or show logs
What: Add Zed commands like "Send selection to Claude", "Connect to Claude".
Implementation:
- Define commands in extension manifest
- Implement command handlers
- Keyboard shortcuts (configurable)
What: Settings panel for port, auto-connect, debug logging, etc.
Implementation:
- Use Zed's settings API
- Persist in
~/.config/zed/settings.json - Live reload on config change
- Send import statements with selection
- Include type definitions for selected symbols
- Forward TSServer quick fixes to Claude
- Include trait implementations
- Send cargo check output
- Macro expansion context
- Virtual environment detection
- Type stub information
- Docstring context
What: Don't send sensitive content (env files, secrets).
Implementation:
- Configurable file/pattern blacklist
- Warn when sending from sensitive files
- Option to require confirmation
What: Rotate auth token periodically.
Implementation:
- Generate new token on schedule
- Update lock file atomically
- Handle reconnection with new token
What: Automated tests for the full flow.
Implementation:
- Mock Zed extension environment
- Test WebSocket protocol
- CI pipeline with GitHub Actions
What: Ensure MCP implementation matches spec.
Implementation:
- Test each tool against expected behavior
- Validate JSON-RPC responses
- Compare with reference implementations
What: Publish to official Zed extensions.
Requirements:
- Clean up extension metadata
- Binary hosting (GitHub releases works)
- Documentation in extension format
What: brew install claude-code-zed
Implementation:
- Create formula for server binary
- Auto-install extension or provide instructions
What: curl ... | sh style installer.
Implementation:
- Detect platform
- Download binary
- Install extension
- Configure automatically
| Feature | Impact | Effort | Priority |
|---|---|---|---|
| Apply Diffs in Zed | High | Large | P0 |
| Open File in Zed | High | Medium | P0 |
| LSP Diagnostics | High | Large | P0 |
| Connection Resilience | High | Medium | P0 |
| Zed Extension Marketplace | High | Medium | P0 |
| Open Editors List | Medium | Medium | P1 |
| Debounced Selection | Medium | Small | P1 |
| Status Bar Integration | Medium | Medium | P1 |
| One-Line Installer | Medium | Small | P1 |
| Multiple Selections | Medium | Medium | P1 |
| Selection History | Low | Small | P2 |
| Configuration UI | Low | Medium | P2 |
- Pick an item from this list
- Open an issue to discuss approach
- Fork, implement, test
- Submit PR with before/after demo
For large features (Effort: L), consider opening a discussion first to align on design.
These items need more investigation before implementation:
- Zed Extension API capabilities - What's exposed for diagnostics, status bar, commands?
- Zed's LSP client behavior - Can we intercept or extend it?
- MCP protocol evolution - Are there new capabilities we should support?
- ACP vs native comparison - Detailed feature matrix to ensure we cover all use cases
Have an idea not listed here? Open an issue with:
- Use case description
- Expected behavior
- Any technical considerations
We'll add promising ideas to this roadmap!