All answers

How do I give Claude Code docs for our internal SDK that isn't on the public internet?

Dennis PilarinosDennis Pilarinos·Dec 2, 2026·Context Engine · Engineering Insights

Commit a short docs index and CLAUDE.md pointer, keep the full reference in a project skill that loads on demand, and add an MCP server for what lives outside the repo. With Unblocked, one `claude mcp add` connects Claude Code to the SDK's code, pull requests, docs and Slack threads, and returns cited answers.

For a Claude Code internal SDK setup, put the docs where Claude Code already looks, in three layers. Commit a short index file and point to it from CLAUDE.md. Keep the full reference in a project skill, which loads only when a task needs it, and add an MCP server for everything that lives outside the repo. With Unblocked, that last layer is one claude mcp add command. Claude Code then calls context_research, which reads the SDK's code, its pull requests, your Notion or Confluence pages and the Slack threads where people asked how to use it, and returns one answer with citations. Internal SDK context is everything an agent needs to call your private library correctly: the API reference, the usage rules, and the decisions behind them. Say, as a hypothetical, your team limited the SDK client to one retry after an incident: asked why, Unblocked cites the PR and the incident thread where that was decided.

Start with a CLAUDE.md pointer and a docs index#

CLAUDE.md loads into every Claude Code session, so it is the right place for a pointer and the wrong place for the whole manual. The docs say to "target under 200 lines per CLAUDE.md file," because longer files "consume more context and reduce adherence" (Claude Code memory docs).

Write a short index instead, listing each SDK module with one line on what it does and a path to its full page. This is the llms.txt pattern, and the Claude Code documentation uses it itself: each page opens by pointing to a complete index at code.claude.com/docs/llms.txt. Then add an @docs/sdk/INDEX.md line to CLAUDE.md. Imported files can nest imports of their own, up to "four hops."

Two details matter:

  • Imports still cost context. The same page says imports help organize a long file "but don't reduce its context cost," so keep the index short.
  • Scope rules to the files that call the SDK. A rule in .claude/rules/ with a paths: field loads only when Claude reads or edits a matching file.

If the docs live in a different repo, --add-dir gives Claude access to that folder, but its CLAUDE.md files only load when CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 is set. Our post on fixing a bloated CLAUDE.md covers what to cut.

Put the full reference in a project skill#

A project skill is a folder in .claude/skills/ with a SKILL.md file that Claude Code loads when a task matches its description. It is the right home for the full API reference. Claude Code's docs say "a skill's body loads only when it's used, so long reference material costs almost nothing until you need it" (Claude Code skills docs). Create .claude/skills/payments-sdk/SKILL.md with a description such as "Use when writing code that calls the internal payments SDK." Put reference.md and examples.md beside it. The docs list "large reference docs, API specifications, or example collections" as files that should load only when needed. Commit the folder, so the whole team gets it.

Generate reference.md from the SDK source, from its docstrings or OpenAPI spec, in the SDK's own CI.

Drift is the real risk, as an April 2026 study shows. It tested 11 models on 270 real API changes across eight Python libraries. Without thorough documentation, only 42.55% of the generated code examples ran in the target environment (Ashik et al., arXiv). With a private SDK the model has seen nothing at all, which is how Claude Code ends up inventing functions.

Serve the docs over MCP when they don't fit in the repo#

An MCP server is a service that Claude Code calls as a tool to fetch context it does not hold locally. Use one when the docs sit in Confluence or Notion, or when several repos call the same SDK. Claude Code adds a remote server with claude mcp add --transport http <name> <url>, and --header "Authorization: Bearer ..." for a token. With --scope project, the config lands in a .mcp.json file, and the docs say to check it "into version control so everyone on your team gets the same MCP tools" (Claude Code MCP docs).

A docs index is one option. Context7 accepts private GitHub, GitLab, Bitbucket and other Git repos, plus Confluence, Notion, OpenAPI specs and uploaded files. "You must have a Pro or Enterprise plan to add private sources," and private GitHub libraries can refresh "on a schedule or after every push." Uploaded files cannot be refreshed (Context7 private sources). Our answer on a Context7 for internal code and docs compares the options.

Add the history the docs leave out#

Reference docs rarely say why the API looks as it does, which version is safe, or which method the team dropped last quarter. That knowledge sits in pull requests and Slack. In the 2026 Stack Overflow Developer Survey, 56.5% of developers named outdated information as a barrier to getting context (Stack Overflow, 2026).

Unblocked covers that half: connect the SDK repo, doc space and Slack, and run claude mcp add -s user --transport http unblocked https://getunblocked.com/api/mcpsse (Unblocked install guide). Log in through /mcp. context_research runs "multi-source research across code, PRs, docs, issues, and messaging" and returns "a synthesized answer with citations" (Unblocked MCP docs).

Three setup notes:

  • SSO docs sites. Unblocked's website source takes "only publicly accessible pages," so connect the repo or wiki behind the site instead (external websites docs).
  • Permissions. With Data Shield on, answers respect each source's permissions (Data Shield docs).
  • Team tokens. A headless team token reaches every document in its selected sources, so pick few.

Justin McCraw, Software Engineer, The Information: "My setup tells the agent: before you implement anything, go check Unblocked. It has everything — our repos, Notion, Slack, coding standards — and it surfaces things I wouldn't have thought to look for. GitHub Copilot doesn't have any of that organizational context. I'd rate the impact an eight or nine out of ten, and it's only gotten better."

Add one CLAUDE.md line: before writing code against the SDK, ask Unblocked how it is used and what changed recently.

Which layer to add first#

Pick by the mistake Claude Code keeps making.

MistakeLayer to addWhere it livesWhen it loads
Calls SDK methods that don't existDocs index plus project skillThe repoIndex every session, skill on demand
Right in one repo, wrong in othersDocs MCP serverContext7 or your own serverWhen Claude calls the tool
Correct code the team already ruled outContext engineUnblocked over MCPWhen Claude calls the tool

For the last row, how to stop agents using stale documentation covers how to rank sources that disagree. Methodology and fact check: every Claude Code, Context7 and Unblocked fact here comes from the vendor's own docs, as read on November 30, 2026.