Context Hub (chub) is a CLI tool that gives coding agents curated, versioned documentation and skills to reduce hallucinations about APIs and SDKs. This tutorial covers installing the official chub CLI, understanding its docs/skills content model, using incremental fetch and layered sources, and building a companion relevance engine that adds a reranking layer on top of the baseline BM25 search. The companion repo introduces a signals.json build artifact extracting headings, reference file tokens, language metadata, and annotation overlap to improve retrieval for shorthand queries like 'rrf', 'signin', and 'pg vector'. Benchmark results show improved mode achieving 1.0 top-1 accuracy vs 0.333 for baseline on a synthetic stress set. The tutorial also explains how to connect a broad companion repo to a focused upstream PR.

12m read timeFrom freecodecamp.org
Post cover image
Table of contents
What We'll BuildPrerequisitesTable of ContentsHow to Understand Context HubHow to Understand the Official Repo, the Companion repo, and the Upstream PRHow to Install and Use the Official CLIHow to Understand Docs, Skills, and the Content LayoutHow to Use Incremental Fetch and Layered SourcesHow to Use Annotations and Feedback to Create a Memory LoopHow to See Where Relevance Still MissesHow the Companion Relevance Engine Improves RetrievalHow to Run the Companion Repo End to EndHow to Read the Benchmark HonestlyHow to Connect the Companion Repo to the Upstream PRConclusionDiagram AttributionSources

Sort: