CKB - Code Knowledge Backend
Know your code. Change it safely. Ship with confidence.
CKB transforms your codebase into a queryable knowledge base. Ask questions, understand impact, find owners, detect dead code, and make changes without fearβall through a unified interface that works with your AI tools, CI/CD pipelines, and custom scripts.
CKB analyzes and explains your code but never modifies it. Think of it as a senior engineer who knows every line of code, every decision, and every ownerβavailable 24/7 to answer your questions.
What is CKB?
CKB (Code Knowledge Backend) gives you instant answers to the questions that slow down development:
| Question | Without CKB | With CKB |
|---|---|---|
| "What breaks if I change this?" | Grep and hope | Precise blast radius with risk score |
| "Who should review this PR?" | Guess from git blame | Data-driven reviewer suggestions |
| "Is this code still used?" | Delete and see what breaks | Confidence-scored dead code detection |
| "What tests should I run?" | Run everything (30 min) | Run affected tests only (2 min) |
| "How does this system work?" | Read code for hours | Query architecture instantly |
| "Who owns this code?" | Search CODEOWNERS manually | Ownership with drift detection |
More Than Code Search
CKB isn't just another code search tool. It's a complete code intelligence platform:
π Understand β Semantic search, call graphs, usage tracing, architecture maps
β‘ Analyze β Impact analysis, risk scoring, hotspot detection, coupling analysis
π‘οΈ Protect β Affected test detection, breaking change warnings, PR risk assessment
π Secure β Secret detection, credential scanning, security-sensitive code identification
π₯ Collaborate β Ownership lookup, reviewer suggestions, architectural decisions (ADRs)
π Improve β Dead code detection, tech debt tracking, documentation coverage
π Integrate β CLI, HTTP API, MCP for AI tools, CI/CD pipelines, custom scripts
Works With Your Tools
| AI Assistants | CI/CD | IDEs & Editors |
|---|---|---|
| Claude Code | GitHub Actions | VS Code |
| Cursor | GitLab CI | Any editor via CLI |
| Windsurf | Jenkins | Custom extensions |
| Any MCP client | Any CI system |
Built for Scale
- Incremental indexing β Update in seconds, not minutes
- Multi-repo federation β Query across all your repositories
- Token-optimized β 83% reduction in LLM context usage with presets
- Language-agnostic β Go, TypeScript, Python, Rust, Java, and more
What's New in v8.0
v8.0 focuses on reliability, error clarity, AI efficiency, and security:
- Compound tools β
explore,understand,prepareChange,batchGet,batchSearchreduce AI tool calls by 60-70% - Secret detection β
scanSecretsfinds exposed API keys, tokens, passwords with 26 builtin patterns - Enhanced
getStatusβ Health tiers (available/degraded/unavailable), backend remediation, actionable suggestions - New
reindextool β Trigger index refresh without restarting, with scope control (full/incremental) - Structured error codes β All errors include remediation steps and drilldown suggestions
- Breaking change detection β Compare API versions with
compareAPItool - Affected tests β Find tests that cover a symbol with
getAffectedTests
π Looking for specific features? See Features for a complete guide organized by what you want to accomplishβcode navigation, impact analysis, architecture, ownership, and more.
The Problem CKB Solves
AI Assistants Are Blind to Code Structure
When you ask an AI assistant "what calls this function?", it typically:
- Searches for text patterns (error-prone)
- Reads random files hoping to find context (inefficient)
- Gives up and asks you to provide more context (frustrating)
Existing Tools Don't Talk to Each Other
Your codebase has valuable intelligence scattered across:
- SCIP indexes - Precise symbol information, but requires setup
- Language servers - Real-time analysis, but slow for large queries
- Git - History and blame, but no semantic understanding
- CODEOWNERS - Ownership rules, but no integration with code intelligence
Each tool speaks a different language. None of them are optimized for AI consumption.
Context Windows Are Limited
Even with 100K+ token context windows, you can't just dump your entire codebase into an LLM. You need:
- Relevant information only
- Properly compressed responses
- Smart truncation with follow-up suggestions
How CKB Helps
For AI-Assisted Development
You: "What's the impact of changing the UserService.authenticate() method?"
CKB provides:
βββ Symbol details (signature, visibility, location)
βββ Blast radius: 4 modules, 12 files, 18 callers β high risk
βββ 12 direct callers + 6 transitive callers (depth 2-3)
βββ Risk score: HIGH (public API, many dependents)
βββ Affected modules: auth, api, admin, tests
βββ Code owners: @security-team, @api-team
βββ Suggested drilldowns for deeper analysis
For Code Understanding
You: "Show me the architecture of this codebase"
CKB provides:
βββ Module dependency graph
βββ Key symbols per module
βββ Module responsibilities and ownership
βββ Import/export relationships
βββ Compressed to fit LLM context
For Refactoring Safety
You: "Is it safe to rename this function?"
CKB provides:
βββ All references (not just text matches)
βββ Cross-module dependencies
βββ Test coverage of affected code
βββ Hotspot risk assessment
βββ Breaking change warnings
For Code Review
You: "Who should review changes to internal/api?"
CKB provides:
βββ Primary owners from CODEOWNERS
βββ Recent contributors from git blame
βββ Related architectural decisions
βββ Historical hotspot trends
Key Capabilities
CKB provides deep code intelligence across six areas. See Features for detailed documentation and example prompts.
| Capability | What It Does | Key Tools |
|---|---|---|
| Features#code-navigation--discovery|Code Navigation | Find symbols, trace usage, explore call graphs | search, refs, callgraph, trace |
| Features#impact-analysis--safety|Impact Analysis | Assess blast radius, detect breaking changes | impact, impact diff, audit, hotspots, pr-summary |
| Features#architectural-understanding|Architecture | Module overview, ADRs, explain code origins | arch, modules, decisions, explain |
| Features#ownership--review|Ownership | CODEOWNERS + git blame, reviewer suggestions | ownership, ownership-drift, recent |
| Features#code-quality--risk|Code Quality | Dead code, coupling, complexity, quick wins | dead-code, coupling, justify, audit |
| Security|Security | Secret detection, credential scanning | scanSecrets, audit --factor=security_sensitive |
| Features#documentation-intelligence|Documentation | Doc-symbol linking, staleness detection | docs index, docs stale, docs coverage |
Additional Capabilities
- Features#multi-repo--federation|Multi-Repo Federation β Query across repositories, analyze API contracts
- Features#runtime-intelligence|Runtime Intelligence β OpenTelemetry integration for production insights
- Features#automation--cicd|Automation & CI/CD β Daemon mode, webhooks, incremental indexing
Technical Foundation
| Feature | Description |
|---|---|
| Multi-backend orchestration | Routes queries to SCIP, LSP, or Git automatically |
| Stable symbol identity | IDs survive renames, moves, and refactoring |
| Smart compression | Token budgets, truncation, drilldown suggestions |
| Three-tier caching | Query, view, and negative caches with auto-invalidation |
| Presets|Tool presets | Load 14-81 tools based on task (83% token savings) |
Use Cases
| Use Case | Without CKB | With CKB |
|---|---|---|
| Find all callers | Grep + manual filtering | Precise semantic results |
| Understand function | Read surrounding files | Structured summary with context |
| Safe refactoring | Hope for the best | Impact analysis + risk score |
| Code review | Check changed files only | See downstream effects + owners |
| Onboarding | Read docs + explore | Query architecture instantly |
| Find code owner | Search CODEOWNERS manually | Query ownership for any path |
| Track tech debt | Gut feeling | Hotspot trends with data |
Who Should Use CKB?
- Developers using AI assistants - Give your AI tools superpowers
- Teams with large codebases - Navigate complexity efficiently
- Anyone doing refactoring - Understand impact before changing
- Code reviewers - See the full picture of changes
- Tech leads - Track architectural health over time
Documentation
Getting Started
| Page | Description |
|---|---|
| Features | Complete feature guide organized by use case |
| Quick Start | Installation for Windows, macOS, and Linux |
| Prompt Cookbook | Real prompts for real problems |
| User Guide | CLI commands and best practices |
| Language Support | Supported languages and quality tiers |
| Practical Limits | Accuracy notes and how to validate results |
Integration
| Page | Description |
|---|---|
| Integration Guide | How to use CKB in your own tools (CLI, API, MCP) |
| MCP Integration | Claude Desktop and AI assistant setup |
| Presets | Tool presets for token optimization |
| CI/CD Integration | GitHub Actions and automated analysis |
| Workflow Examples | Production-ready CI/CD workflow templates |
| Quality Gates | Complexity, risk, coupling, and coverage gates |
| Daemon Mode | Always-on service with webhooks |
| Index Management | Automatic refresh, branch switching, freshness |
Advanced
| Page | Description |
|---|---|
| Security | Secret detection, credential scanning, allowlists |
| Impact-Analysis | Blast radius, risk scoring, and change analysis |
| Federation | Cross-repository queries and contracts |
| Telemetry | Runtime observability with OpenTelemetry |
| Doc-Symbol Linking | Documentation-code linking |
| Incremental Indexing | Fast index updates (Go) |
| Hybrid Retrieval | Graph-based search ranking |
Reference
| Page | Description |
|---|---|
| MCP Tools | Complete MCP tool reference (81 tools) |
| API Reference | HTTP API documentation |
| Configuration | All configuration options |
| Authentication | API tokens and rate limiting |
| Architecture | System design |
| Performance | Latency targets and benchmarks |
| Contributing | Development guidelines |
Installation
npm (Recommended)
# Install globally
npm install -g @tastehub/ckb
# Or run directly without installing
npx @tastehub/ckb --help
Build from Source
git clone https://github.com/SimplyLiz/CodeMCP.git
cd CodeMCP
go build -o ckb ./cmd/ckb
New to CKB? See the Quick Start guide for detailed instructions.
Quick Start
# Initialize in your project
cd /path/to/your/project
ckb init # or: npx @tastehub/ckb init
# Generate SCIP index (auto-detects language)
ckb index
# Check status
ckb status
# Configure Claude Code
ckb setup
# Search for symbols
ckb search "myFunction"
# Find references
ckb refs "symbol-id"
# Analyze impact
ckb impact "symbol-id"
# Query ownership
ckb ownership internal/api/handler.go
# View architectural decisions
ckb decisions
# Start MCP server for AI assistants
ckb mcp
MCP Tools
CKB exposes 81 tools through the Model Context Protocol. Use Presets to load only what you need:
| Preset | Tools | Best For |
|---|---|---|
core |
14 | General development (default) |
review |
19 | PR reviews, ownership |
refactor |
19 | Refactoring, dead code |
docs |
20 | Documentation maintenance |
federation |
28 | Multi-repo work |
full |
81 | Everything |
ckb mcp --preset=review
See MCP Tools for the complete tool reference and MCP Integration for setup instructions.
Interfaces
CKB provides three ways to interact:
| Interface | Best For |
|---|---|
| CLI | Quick queries, scripting, CI/CD |
| HTTP API | Web integrations, custom tools |
| MCP Server | Claude Desktop, AI assistants |
License
Free for personal use. Commercial/enterprise use requires a license. See LICENSE for details.