CKB + Zed: Lightning-Fast Editing with Semantic Intelligence
By CKB Team
Zed is a high-performance code editor built in Rust, known for its speed and modern AI integration. Adding CKB gives Zed's AI assistant semantic understanding of your codebase—combining Zed's lightning-fast editing with deep code intelligence.
What You'll Get
With CKB connected, Zed's AI can:
- Find function callers semantically (not just grep)
- Analyze change impact before you edit
- Navigate complex codebases with understanding
- Suggest reviewers based on code ownership
Prerequisites
- Zed editor (download from zed.dev)
- Node.js 18+
- A codebase to index
Setup
Step 1: Install CKB
npm install -g @tastehub/ckb
Step 2: Index Your Project
cd /path/to/your/project
ckb init
Step 3: Configure Zed
Open Zed's settings:
- Press Cmd+, (macOS) or Ctrl+, (Linux)
- Or: Menu → Zed → Settings
Find the assistant section and add MCP configuration:
{
"assistant": {
"version": "2",
"mcp_servers": {
"ckb": {
"command": "npx",
"args": ["@tastehub/ckb", "mcp"]
}
}
}
}
Step 4: Restart Zed
Close and reopen Zed for the configuration to take effect.
Step 5: Verify
Open the AI assistant panel (Cmd+?) and ask:
What MCP tools do you have access to?
You should see CKB tools listed.
Using CKB in Zed
Assistant Panel
Open with Cmd+? and ask questions:
You: "What calls the processOrder function?"
Zed AI: [uses CKB's getCallGraph]
"processOrder in src/orders/processor.rs is called by:
- OrderController::create at controllers/orders.rs:45
- WebhookHandler::order_created at webhooks/stripe.rs:89
- BatchProcessor::run at jobs/batch.rs:123
Callees: validate_order, charge_payment, send_confirmation"
Inline Assistant
Select code and press Cmd+Enter for inline assistance:
You: [select a struct, Cmd+Enter]
"What's the impact of adding a field to this struct?"
AI: [uses prepareChange]
"Adding a field to Order struct affects:
- 12 functions that construct Order
- 8 serialization points (JSON, DB)
- 23 tests
Risk: Medium
You'll need to update constructors and may need a DB migration."
Multi-Buffer Context
Zed's multi-buffer feature works great with CKB:
You: "Show me all usages of UserService"
AI: [uses findReferences]
"UserService has 18 references across 9 files:
- controllers/auth.rs:34 (method call)
- controllers/user.rs:12, 45, 78 (method calls)
- services/billing.rs:23 (dependency injection)
..."
Zed: [Opens multi-buffer with all references]
Preset Selection
Choose a preset based on your work:
{
"assistant": {
"mcp_servers": {
"ckb": {
"command": "npx",
"args": ["@tastehub/ckb", "mcp", "--preset=core"]
}
}
}
}
| Preset | Tools | Best For |
|---|---|---|
core |
21 | General coding |
review |
27 | Code review |
refactor |
33 | Cleanup work |
full |
92 | Everything |
Zed-Specific Tips
Use Zed's Speed
Zed is fast. CKB is fast. Combine them:
You: "Find all TODO comments in functions with high complexity"
AI: [uses searchSymbols and complexity analysis]
Results appear instantly, and you can Cmd+click to jump to each location.
Collaborative Features
When using Zed's collaboration features:
You: "Who owns the code we're looking at?"
AI: [uses getOwnership]
"This file (auth/middleware.rs) is owned by:
- @alice (67% - recent active)
- @bob (23% - original author)
Suggested reviewer for changes: @alice"
This helps when pairing—you know who to ask questions.
Project-Wide Analysis
Zed handles large projects well, and so does CKB:
You: "Give me an architecture overview"
AI: [uses getArchitecture]
"This Rust project structure:
src/
├── api/ - HTTP handlers (actix-web)
├── domain/ - Business logic (pure Rust)
├── infra/ - Database, external services
├── jobs/ - Background workers
Dependencies flow: api → domain ← infra
This is clean architecture (domain has no external deps)"
Workflows
Exploring Unfamiliar Code
You: "I need to understand how payments work"
AI: [uses explore and traceUsage]
"Payment flow in this codebase:
Entry: POST /api/payments → PaymentController::create
Flow:
1. PaymentController validates request
2. PaymentService::process handles logic
3. StripeClient::charge makes external call
4. OrderService::mark_paid updates state
5. NotificationService::send_receipt emails customer
Key files:
- src/services/payment.rs (main logic)
- src/clients/stripe.rs (Stripe integration)
- src/models/payment.rs (data structures)"
Safe Refactoring
You: "I want to split PaymentService into smaller services"
AI: [uses prepareChange and analyzeCoupling]
"Splitting PaymentService - analysis:
Current responsibilities:
1. Payment validation (8 methods)
2. Stripe integration (5 methods)
3. Order updates (3 methods)
Suggested split:
- PaymentValidator (low coupling, easy to extract)
- StripeGateway (external dependency isolation)
- PaymentOrchestrator (coordinates the above)
Impact of extraction:
- 23 files import PaymentService
- 15 would need updates for new structure
- Risk: Medium (well-tested area)"
Pre-Commit Check
You: "I've made changes to the auth module. What should I verify?"
AI: [uses prepareChange for modified files]
"Changes to auth module - verification checklist:
✓ 12 tests cover modified code
⚠ 2 edge cases have low coverage:
- Token refresh with expired refresh token
- Concurrent session invalidation
Suggested before commit:
1. Run: cargo test auth
2. Add test for token refresh edge case
3. Manual test: login flow in staging"
Troubleshooting
Tools not available
- Check Zed settings JSON syntax
- Verify CKB is installed:
npx @tastehub/ckb --version - Restart Zed completely
- Check Zed's assistant logs for errors
Slow indexing
For large Rust projects, first index may be slow:
# Index with progress output
ckb index --verbose
# Exclude build artifacts
echo "target/" >> .ckb/ignore
Stale results
Update the index:
ckb index
Or run the watcher:
ckb watch
Performance Notes
Zed and CKB are both optimized for speed:
- CKB queries typically complete in <100ms
- Rust project indexing is fast (parallel parsing)
- Results stream for large queries
This means AI responses feel instant even on large codebases.
Next Steps
- What is MCP? - Protocol basics
- Prompt Cookbook - Useful prompts
- Compound Operations - Efficient queries
Links: