Recipe

Claude Code with Stable Baseline.

Add Stable Baseline to Claude Code in one command, sign in from the browser, and run sb-setup to document a repository. Stable Baseline's prompts then show up as commands.

1. Add the server

In your repository, run:

bash
claude mcp add --transport http sb https://api.stablebaseline.io/functions/v1/cloud-serve/mcp

Then type /mcp in Claude Code, choose sb, and authenticate. Your browser opens to sign in to Stable Baseline and choose what Claude Code may reach. From a shell, claude mcp login sb does the same.

Who it is for

ScopeWho gets itWhere it is kept
local (the default)You, in this projectYour own Claude Code settings
projectEveryone working on the repository.mcp.json, committed with the repository
userYou, in every projectYour own Claude Code settings

Add --scope project or --scope user to the command to choose.

Or use an API key

For a script or a machine with no browser, use an API key. Create one under Organisation settings, Developers, API keys. See Setup. To share the server with your team in .mcp.json, refer to the key through an environment variable, so each person uses their own:

.mcp.jsonjson
{
  "mcpServers": {
    "sb": {
      "type": "http",
      "url": "https://api.stablebaseline.io/functions/v1/cloud-serve/mcp",
      "headers": {
        "Authorization": "Bearer ${STABLE_BASELINE_API_KEY}"
      }
    }
  }
}

Keep the key out of your files

Put your API key in the STABLE_BASELINE_API_KEY environment variable or your tool's secret store, and refer to it from the config as shown. Never paste the key itself into a file you commit or share. Signing in with OAuth avoids keys altogether.

2. Document the repository

Claude Code lists Stable Baseline's prompts as commands, such as /sb:sb-setup (MCP). Type /sb:sb-setup (or /mcp__sb__sb-setup) and say what you want, for example “architecture docs for new engineers”. It then:

  1. Checks the connection

    It confirms it can reach Stable Baseline with your key or sign-in.
  2. Finds your workspace and project

    It never creates them: if it cannot find the ones you mean, it asks you to create them in the app first.
  3. Remembers them

    It writes their ids to .sb/config.json, and keeps .sb/ out of git.
  4. Checks for existing docs

    If the project already has documentation, it asks whether to add to it, replace it, or stop.
  5. Reads the repository

    It works through the code to understand what is there.
  6. Designs a structure

    Folders and documents that fit this repository, not a fixed template.
  7. Writes it

    Folders, documents, and the diagrams each document needs.
  8. Updates AGENTS.md

    It adds a Stable Baseline section with rules for keeping the docs current, and keeps everything else in the file.
  9. Sums up

    It tells you what it created.

If your repository has a CLAUDE.md

Claude Code reads CLAUDE.md. sb-setup writes its rules to AGENTS.md, so add the line @AGENTS.md to your CLAUDE.md to load them in every session.

Other commands

Every Stable Baseline prompt appears the same way: /sb:sb-update records what you decided in this conversation, /sb:sb-create-doc starts a document, /sb:sb-whiteboard-design builds a board, and so on. See the full list.

3. Try it

  • “What changed in the checkout service this week? Update its document.”
  • “Add a sequence diagram of the sign-in flow to the authentication document.”
  • “Create a plan for the database migration with three phases.”
  • “Log a risk in the work register: the payment provider's rate limits.”

Press Esc to stop Claude Code mid-task.