Built on Context Hub by Andrew Ng — Chub is a high-performance Rust rewrite that extends the original with team-first features: shared doc pinning, git-tracked annotations, context profiles, and agent config sync.
For individuals: drop-in replacement for chub with a faster binary, better search, and persistent annotations.
For teams: commit a .chub/ directory to your repo and every developer and every AI agent gets the same versioned context, automatically.
Why Chub
Coding agents hallucinate APIs and forget what they learn between sessions. Context Hub's answer — curated, versioned markdown docs served via CLI and MCP — works well. Chub keeps that foundation and adds:
| Native speed | 5x faster builds, 19x faster search, 10 MB binary — no Node.js required |
| Team pins | Lock docs to specific versions so every agent on the team uses the same reference |
| Shared annotations | Team knowledge lives in .chub/annotations/ — committed to git, surfaced automatically |
| Custom project context | Your architecture docs, API conventions, and runbooks, served alongside public docs |
| Context profiles | Scope which docs and rules each role (backend, frontend, etc.) gets |
| Agent config sync | Generate and keep CLAUDE.md, .cursorrules, AGENTS.md in sync from one source |
| Private registry | Self-host internal docs alongside the public registry — no cloud required |
| Full compatibility | Same registry format, search index, and config schema as Context Hub |
Installation
npm (recommended)
pip
Pre-built wheels for Linux (x64, ARM64), macOS (x64, Apple Silicon), and Windows (x64).
Cargo (build from source)
Homebrew (macOS / Linux)
Binary download
Download prebuilt binaries from GitHub Releases:
| Platform | Binary |
|---|---|
| Linux x64 | chub-linux-x64 |
| Linux ARM64 | chub-linux-arm64 |
| macOS x64 | chub-darwin-x64 |
| macOS ARM (Apple Silicon) | chub-darwin-arm64 |
| Windows x64 | chub-win32-x64.exe |
Verify installation
Quick Start
Search for docs
Fetch a doc
List all available docs
Initialize a project for team sharing
Usage
Search and fetch
Doc pinning
Context profiles
Team annotations
Dependency auto-detection
Agent config sync
Snapshots and freshness
Cache management
Usage analytics
MCP Integration
Chub includes a built-in MCP (Model Context Protocol) server that lets AI agents search and fetch docs directly.
Claude Code
Add to .mcp.json in your project root:
Cursor
Add to .cursor/mcp.json:
Windsurf / Other agents
Any MCP-compatible agent can use Chub. The transport is stdio — just point the agent at chub mcp.
MCP tools
| Tool | Description |
|---|---|
chub_search |
Search docs by query |
chub_get |
Fetch a doc by ID |
chub_list |
List all available docs |
chub_annotate |
Add an annotation |
chub_feedback |
Submit doc feedback |
Registry resource: chub://registry
Team Features
The .chub/ directory at the project root is committed to git and shared with the team.
my-project/
├── .chub/
│ ├── config.yaml # Project-level config
│ ├── pins.yaml # Pinned doc versions
│ ├── annotations/ # Team knowledge, git-tracked
│ ├── context/ # Custom docs: architecture, conventions
│ └── profiles/ # Role-scoped context (backend.yaml, frontend.yaml)
Three-tier config inheritance
~/.chub/config.yaml # Tier 1 — personal defaults
↓ overridden by
.chub/config.yaml # Tier 2 — project config (shared)
↓ overridden by
.chub/profiles/<name>.yaml # Tier 3 — role/task profile
Feature overview
| Feature | Status | Description |
|---|---|---|
Project init (chub init) |
Done | Create .chub/ with sensible defaults |
| Doc pinning | Done | Lock doc versions in pins.yaml |
| Team annotations | Done | Git-tracked annotations with merge |
| Context profiles | Done | Role-scoped context with inheritance |
| Project context | Done | Custom markdown docs served via MCP |
| Dep auto-detection | Done | 9 file types (npm, Cargo, pip, Go, etc.) |
| Agent config sync | Done | Generate CLAUDE.md, .cursorrules, etc. |
| Doc snapshots | Done | Point-in-time pin snapshots |
| Doc freshness | Done | Compare pinned vs installed versions |
| Usage analytics | Done | Local opt-in fetch tracking |
See docs/plan.md for the full roadmap.
Benchmarks
Measured on the production corpus (1,553 docs, 7 skills). Median of 5 runs on Windows 11, Node.js v22, Rust release build. Reproduce with ./scripts/benchmark.sh.
Performance
| Operation | Context Hub (JS) | Chub (Rust) | Speedup |
|---|---|---|---|
search "stripe payments" |
1,060 ms | 56 ms | 19x |
build --validate-only |
1,920 ms | 380 ms | 5x |
build (1,560 entries) |
3,460 ms | 1,770 ms | 2x |
get stripe/api |
148 ms | 63 ms | 2.3x |
Cold start (--help) |
131 ms | 44 ms | 3x |
Resource usage
| Metric | Context Hub (JS) | Chub (Rust) |
|---|---|---|
| Package size | ~22 MB (node_modules) |
10 MB (single binary) |
| Runtime dependency | Node.js 20+ | None |
| Peak memory (build, 1,560 entries) | ~122 MB | ~23 MB (5.3x less) |
Features
| Context Hub (JS) | Chub (Rust) | |
|---|---|---|
| CLI commands | 7 | 20 |
| MCP tools | 5 | 7 |
| Team features (pins, profiles, snapshots, etc.) | — | Yes |
| Registry format compatibility | — | Identical |
Test Suite
99 tests covering behavioral parity and team features:
| Suite | Tests | Coverage |
|---|---|---|
| Tokenizer | 6 | Stop words, punctuation, edge cases |
| BM25 search | 7 | Scoring, ranking, limits, field weights |
| Inverted index | 1 | Parity with linear scan |
| Frontmatter parser | 9 | YAML, CRLF, BOM, empty, numeric |
| Language normalization | 4 | Aliases, case, unknown |
| Build integration | 15 | Output format, validation, structure |
| Search parity | 20 | Multi-word, tags, descriptions |
| Team features | 33 | Pins, profiles, annotations, snapshots, detect, freshness, agent config, analytics |
All tests use isolated temp directories — no writes to the repo's .chub/.
Content Registry
Building from source content
Serving a local registry
Content format
content/
<author>/
docs/<entry-name>/
<lang>/DOC.md # YAML frontmatter + markdown
<lang>/<version>/DOC.md # versioned variant
skills/<entry-name>/
SKILL.md
Documentation
Full documentation at chub.nrl.ai:
- Getting Started — install and first commands
- Installation — all platforms and package managers
- Why Chub — comparison with Context Hub
- Doc Pinning — lock doc versions
- Context Profiles — role-scoped context
- Team Annotations — shared knowledge
- Project Context — custom docs
- CLI Reference — all commands and flags
- Configuration — config file format
- MCP Server — agent integration
Contributing
License
MIT