Skip to content

Chub vs Context Hub

Chub is a Rust rewrite of Context Hub (JS). Fully format-compatible — same registry, same search index, same config schema. Content works in both directions without modification.

Performance

Measured on the production corpus (1,553 docs, 8 skills). Median of 5 runs.

OperationContext Hub (JS)Chub (Rust)Speedup
search "stripe payments"1,060 ms56 ms19x
build --validate-only1,920 ms380 ms5x
build (1,560 entries)3,460 ms1,770 ms2x
get stripe/api148 ms63 ms2.3x
Cold start (--help)131 ms44 ms3x
MetricContext Hub (JS)Chub (Rust)
Package size~22 MB (node_modules)10 MB (single binary)
Peak memory (build)~122 MB~23 MB (5.3x less)
Runtime dependencyNode.js 20+None

Search is the largest improvement (19x) because Chub uses a BM25 inverted index that only scores documents containing query terms, while Context Hub does a linear scan over all entries.

Features only in Chub

FeatureCommandDescription
Doc pinningchub pinLock doc versions for team consistency
Context profileschub profileRole-scoped context with inheritance
Team annotationschub annotate --teamGit-tracked annotations in .chub/annotations/
Org annotationschub annotate --orgServer-hosted annotations with local cache
Structured kinds--kind issue/fix/practiceCategorize what agents learn
Project contextchub contextCustom markdown docs via MCP
Dep auto-detectionchub detectScan all major package managers
Agent config syncchub agent-configGenerate rules for 10 agent targets
Doc snapshotschub snapshotPoint-in-time pin captures
Freshness checkschub checkCompare pinned vs installed versions
Usage analyticschub statsLocal opt-in fetch tracking
HTTP servingchub serveServe a content directory
Doc bundleschub bundleShareable doc collections
AI usage trackingchub trackSessions, tokens, costs, dashboard
Usage telemetrychub telemetryView and manage local telemetry data

MCP tools

ToolContext HubChub
chub_searchYesYes
chub_getYesYes
chub_listYesYes
chub_annotateYesYes
chub_feedbackYesYes
chub_contextYes (pins, annotations, profiles, project context)
chub_pinsYes (manage pinned docs)
chub_trackYes (query AI usage tracking data)

Total: 5 tools (JS) vs 8 tools (Rust)

CLI commands

7 commands (JS) vs 22 commands (Rust)

Chub adds: init, pin, profile, detect, agent-config, check, context, stats, serve, bundle, snapshot, mcp, list, track, telemetry.

Format Compatibility

Chub produces byte-compatible output with Context Hub:

  • registry.json — identical fields and structure, all camelCase
  • search-index.json — identical BM25 parameters and inverted index format
  • ~/.chub/config.yaml — same config schema
  • Annotation files — same JSON format (Chub adds optional kind/severity fields, ignored by JS)

Content authored for Context Hub works in Chub without changes and vice versa.

Search algorithm

Both use BM25 scoring (k1=1.5, b=0.75) with lexical boost (Levenshtein distance, prefix/contains matching).

AspectContext HubChub
ScoringBM25BM25 (identical parameters)
Index typeLinear scanInverted index
Tokenizer56 stop words56 stop words (identical)
Lexical boostLevenshtein + prefix/containsLevenshtein + prefix/contains (identical)

The inverted index is the key performance difference — Chub only scores documents that contain at least one query term.