> ## Documentation Index
> Fetch the complete documentation index at: https://sambanova-systems.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code integration guide

Claude Code is a command-line tool that lets you delegate coding tasks directly to Claude from your terminal. It understands your project's codebase and can help you analyze, plan, write, and edit code.

## Prerequisites

Before getting started, ensure you have:

* **Python ≥ 3.11** on PATH – on 3.10, the install hook fails silently
* **`opencode`** (`curl -fsSL https://opencode.ai/install | bash`)
* **SambaNova API key** exported as `SAMBANOVA_API_KEY` before launching Claude Code
* Access to [Claude Code CLI](https://code.claude.com/docs/en/quickstart) and their models

Sanity check:

```bash theme={null}
python3 --version && { opencode --version; } && [ -n "$SAMBANOVA_API_KEY" ] && echo OK
```

## Setup

1. Install the plugin in Claude Code:
   ```text theme={null}
   /plugin marketplace add https://github.com/sambanova/sambanova-plugin-cc
   /plugin install sambanova-plugin-cc
   ```
2. **Restart Claude Code** (or run `/reload-plugins`).
3. Verify the install:
   ```text theme={null}
   /list-models
   ```
   The plugin may ship with an outdated default model. Run `/update-model MiniMax-M2.7` in the next step to use the current recommended model.
4. Register the current model:
   ```text theme={null}
   /model-info                  # browse the SambaNova platform catalogue
   /update-model MiniMax-M2.7   # add it to your local registry
   /list-models                 # confirm
   ```
   For `MiniMax-M2.7`, accept the suggested sampling params (`temperature=1.0`, `top_p=0.95`).

<Warning>
  Always pass the **bare** model id to `/code` (`MiniMax-M2.7`), never `sambanova/MiniMax-M2.7`.
</Warning>

## Running sub-agents with Claude and SambaNova

The [SambaNova plugin](https://github.com/sambanova/sambanova-plugin-cc) maintains its own local SQLite database that stores all model configurations. When you use it, the plugin generates isolated, runtime-only configurations for the sub-agent, ensuring a clean separation from your existing IDE setups.

### What it does

Lets Claude Code **delegate** coding tasks to `opencode` running against a SambaNova-hosted model (e.g. `MiniMax-M2.7`). Useful for cheap bulk work, or for splitting planning (Claude) from execution (SambaNova).

Five slash commands: **`/code`** is the one you'll use most; `/list-models`, `/model-info`, `/update-model`, `/reset-model-db` manage the local model registry.

The following shows three real demos – including one that uses an MCP server for live library docs.

***

### Demo 1 – SambaNova end-to-end

A pet-friendly "hello world" landing page, built and verified entirely by `MiniMax-M2.7` – `/code` delegates the whole task to the cheap, fast executor.

```bash theme={null}
mkdir -p ~/sambanova-demo && cd ~/sambanova-demo
```

Delegate the build:

```text theme={null}
/code MiniMax-M2.7 ~/sambanova-demo "Create a minimalist, pet-friendly 'hello world' landing page in this directory. One index.html, one style.css, no JS frameworks. Soft pastel palette, a friendly paw-print emoji, a short tagline ('Hello, friend'), and a single call-to-action button. Keep it under 80 lines of HTML+CSS combined. Open index.html when done so I can preview it."
```

Verify in the browser:

```bash theme={null}
open ~/sambanova-demo/index.html
```

That's the **SambaNova-only** baseline. One fast executor, no frontier model in the loop.

***

### Demo 2 – Claude plans, SambaNova executes

The architect/builder split: **Claude** (current session) writes a precise plan; **SambaNova** executes it. `PLAN.md` is the artifact that crosses the boundary – reproducible, swappable, reviewable.

**Step 1 – Ask Claude to write `PLAN.md`** (in this Claude Code session, not via `/code`):

> Read `index.html` and `style.css` in `~/sambanova-demo`. Write `PLAN.md` describing how to extend this landing page into a "pet adoption finder" demo:
>
> * A gallery of 6 placeholder pet cards (name, species, one-line bio) in CSS grid
> * A search input that filters cards by name (vanilla JS, no frameworks)
> * A dark-mode toggle that persists in `localStorage`
>
> Include exact file layout, the JS event handlers needed, and a verification checklist a human can run in the browser. Don't modify any code yet.

Review the plan Claude produces before handing off – edit it freely; that's the point of materializing the plan.

> **Want SambaNova to plan too?** Register the planner once – `/update-model gemma-4-31B-it` – then, instead of writing the plan in this session, delegate the write-up: `/code gemma-4-31B-it ~/sambanova-demo "<sample_plan_as_above>"` Step 2 (execution on `MiniMax-M2.7`) is unchanged – now both sides run on SambaNova.

**Step 2 – Hand `PLAN.md` to SambaNova:**

```text theme={null}
/code MiniMax-M2.7 ~/sambanova-demo "Read PLAN.md and execute every step. After each step, list which acceptance criteria from the plan are now satisfied. Open index.html at the end so I can verify in the browser."
```

**Step 3 – Verify:**

```bash theme={null}
open ~/sambanova-demo/index.html
```

You should see the gallery, working search, and a working dark-mode toggle.

The executor never sees your Claude conversation – `PLAN.md` is its entire spec. Tweak `PLAN.md` and re-run the same `/code` call, or swap the executor model without rewriting the plan.

***

### Demo 3 – MCP-fed planning with live library docs

Demo 2, plus an MCP server. Claude uses [**Context7**](https://github.com/upstash/context7) to fetch *current* docs for a library, bakes them into `PLAN.md`, and SambaNova executes. Solves the stale-docs problem without writing any custom retrieval.

#### Install Context7 (one command)

```bash theme={null}
npx ctx7 setup --claude
```

Walks you through OAuth, generates a free API key, and registers the MCP server for Claude Code. **Restart Claude Code** so it picks up the new tools.

Verify in Claude Code:

```text theme={null}
/mcp
```

You should see `context7` listed with `resolve-library-id` and `query-docs`.

<Tip>
  Prefer no OAuth? Add it manually: `claude mcp add context7 -- npx -y @upstash/context7-mcp`. Free tier works without a key; you'll just hit lower rate limits.
</Tip>

#### The task

Stamp each pet card from Demo 2 with a human-readable "Added *X* days ago" label, computed at page load with [date-fns](https://date-fns.org/) (`formatDistanceToNow`). date-fns is a good Context7 target: its v2→v3 rewrite changed how it's imported, and v4 added time-zone support – so models routinely emit stale import patterns that don't run.

#### Step 1 – Claude uses Context7 to plan

In this Claude Code session, ask:

> Use the Context7 MCP server to look up *current* docs for the `date-fns` library – specifically `formatDistanceToNow` with the `addSuffix` option, and how to load date-fns in a plain browser page via its UMD CDN build (the `dateFns` global). Then update `~/sambanova-demo/PLAN.md` with a "Phase 2: relative date labels" section describing how to give each pet card in the existing finder a fixed `data-added` ISO date and render an "Added *X* days ago" label computed from it on load. Use the up-to-date API from Context7 – not what you remember. Quote the exact `<script>` CDN tag, the global function call, and `addSuffix` usage verbatim from the docs, and include a verification step a human can run in the browser.

Claude will call `resolve-library-id` → `query-docs`, get today's API, and write a plan grounded in current docs.

> **Want SambaNova to plan too?** The catch here: the `/code` sub-agent has **no MCP access**, so `gemma-4-31B-it` can't call Context7 itself. Let Claude do the `resolve-library-id` → `query-docs` fetch above, then delegate only the write-up – pasting the resolved API into the prompt: `/code continue gemma-4-31B-it ~/sambanova-demo "<same_plan_as_above>"` (Register it first with `/update-model gemma-4-31B-it`.) Claude stays the MCP gateway; `gemma-4-31B-it` writes the plan.

#### Step 2 – Hand to SambaNova

```text theme={null}
/code MiniMax-M2.7 ~/sambanova-demo "Read PLAN.md 'Phase 2' and execute it. After loading, open index.html so I can confirm each card shows an 'Added X days ago' label."
```

The executor doesn't need MCP access – `PLAN.md` already contains the resolved API.

#### Step 3 – Verify

```bash theme={null}
open ~/sambanova-demo/index.html
```

Each of the 6 cards should show an "Added *X* days ago" label (e.g. "Added 3 days ago").

***

### Composing with MCP servers

The plugin and MCP servers sit on opposite sides of the delegation boundary, making them complementary:

| Surface                            | Tools available                                                                             |
| ---------------------------------- | ------------------------------------------------------------------------------------------- |
| **Claude (current session)**       | MCP tools (GitHub, Atlassian, Linear, Slack, Confluence, …) + shell + Claude Code built-ins |
| `/code `**sub-agent** (`opencode`) | Filesystem + shell. **No MCP.**                                                             |

Three patterns fall out:

**1. MCP-fed planning.** Pull external context, bake it into `PLAN.md`, hand off.

> *Example:* Claude reads Jira ticket `PROJ-1234` via the Atlassian MCP server, grabs the linked Confluence design doc, and writes a self-contained `PLAN.md`. Then `/code  MiniMax-M2.7 …` executes it. The SambaNova executor never touches Jira credentials.

**2. MCP-driven handoff.** After `/code` finishes, Claude publishes results via MCP.

> *Example:* `/code` writes `/tmp/exec-summary.md`. Claude reads it, opens a PR through the GitHub MCP server, comments on the Jira ticket, and posts to a Slack channel – all from the current session.

**3. Shell-CLI tools inside the sub-agent.** The sub-agent has no MCP, but it does have `--auto` shell access. Any CLI on PATH (`gh`, `git`, `linear`, `aws`, …) is fair game.

> *Example:* `/code MiniMax-M2.7 ~/project "Implement PLAN.md, run tests, then run 'gh pr create --fill' to open a draft PR."`

***

### Tips

* **Absolute paths for `cwd`** – `~` expansion is unreliable across the shell boundary.
* **Tell the sub-agent to verify** ("open `index.html` and confirm…") or it will edit files and stop.
* **Don't pre-resolve `git diff` / `grep`** in your prompt – let the sub-agent run them.
* **Bare model id**, not `sambanova/<id>`.
* **`open` is macOS** – on Linux use `xdg-open`, on Windows use `start`.

### Common gotchas

**Python \< 3.11.** The plugin builds its venv automatically on session start, using whatever `python3` is first on PATH. On 3.10, the install fails silently – and the broken venv won't rebuild on its own, since a 3.10 interpreter still counts as "present." Fix with `pyenv install 3.11.9 && pyenv global 3.11.9`, then delete the plugin's cached `.env` directory and restart Claude Code to force a rebuild.

**API key not found during setup.** `SAMBANOVA_API_KEY` must be in the env of the Claude Code process. Export it in `~/.zshrc`, then launch Claude Code from a fresh shell.

**"Model not found in database."** `/model-info` shows the *platform* catalogue; `/list-models` shows your *local* registry. `/code` reads the local one. Add the missing model with `/update-model`.

### References

* Plugin source – [sambanova-plugin-cc](https://github.com/sambanova/sambanova-plugin-cc)
* SambaNova Cloud – [cloud.sambanova.ai](https://cloud.sambanova.ai/)
* OpenCode docs – [opencode.ai/docs](https://opencode.ai/docs)
* Claude Code plugins – [docs.claude.com](https://docs.claude.com/en/docs/claude-code/plugins)
* Model Context Protocol – [modelcontextprotocol.io](https://modelcontextprotocol.io/)
