explaingit

andrewyng/context-hub

13,242JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A command-line tool that supplies AI coding agents with curated, version-tracked documentation so they write real, working code instead of inventing interfaces that don't exist.

Mindmap

mindmap
  root((repo))
    What It Does
      Feeds docs to agents
      Prevents hallucinations
      Version-tracked docs
    Core Commands
      Search docs
      Fetch document
      Add annotation
      Send feedback
    How It Works
      Agent runs chub
      Reads markdown docs
      Saves local notes
    Audience
      AI coding agents
      Developers
      Cursor Copilot users
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Tell your AI coding assistant to run chub search before writing any library code so it reads real docs first.

USE CASE 2

Let your AI agent attach a local annotation to a doc when it finds a quirk, so the lesson is saved for next time.

USE CASE 3

Contribute a new documentation page for a missing library so all agents using context-hub benefit.

USE CASE 4

Use the incremental fetch command to pull only the specific doc files your agent needs instead of everything at once.

Tech stack

JavaScriptNode.jsMarkdown

Getting it running

Difficulty · easy Time to first run · 5min

Requires a recent version of Node.js, install globally via npm.

MIT, use freely for any purpose, including commercial, as long as you keep the copyright notice.

In plain English

Context Hub is a tool aimed at AI coding assistants, the kind that write code on your behalf inside a terminal. The README starts with the problem it tries to solve: these assistants often make up programming interfaces that do not exist, and they forget what they figured out in an earlier session. Context Hub gives them a supply of curated, version-tracked documentation to read so they are more likely to write code that actually works. An important point the README stresses is that the tool is meant for the AI agent to use, not the person. You install a command-line program called chub, then tell your assistant to run it. The basic loop is simple: the agent searches for a topic, fetches the relevant document in the right programming language, reads it, and writes its code. The documents are kept as plain markdown files in this same repository, so you can see exactly what your agent is reading and suggest changes. Beyond fetching docs, Context Hub is built around the idea of agents that improve over time. When an assistant hits a gap or a quirk, it can attach a local note, called an annotation, to a document. That note comes back automatically the next time the document is fetched, so the lesson is not lost. Separately, agents can send up or down feedback to the people who write the docs, which is meant to help the documentation get better for everyone. The README lists the available commands for searching, fetching, annotating, and giving feedback, and mentions an incremental fetch feature that lets an agent pull only the specific files it needs instead of everything at once. Anyone can contribute new documentation through pull requests using a defined markdown format. The project is published on the npm package registry, requires a recent version of Node.js, and is released under the MIT license. It is associated with Andrew Ng, a well-known figure in the AI field.

Copy-paste prompts

Prompt 1
I'm using context-hub. Write me a system prompt telling my AI agent to always run chub search before writing any library code.
Prompt 2
Using context-hub, show me how to add documentation for a custom internal library so my AI agent can use it.
Prompt 3
I want my Cursor agent to annotate context-hub docs when it finds a bug or quirk. How do I set that up?
Prompt 4
Help me write a chub-compatible markdown doc page for the Stripe Node SDK so context-hub agents get accurate Stripe code.
Open on GitHub → Explain another repo

← andrewyng on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.