Skip to main content
This article shows you how to extend Claude Code with the SambaNova plugin, enabling you to delegate coding tasks to SambaNova-hosted models as sub-agents — splitting planning (Claude) from execution (SambaNova) for faster, more cost-efficient workflows.

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. See API keys and URLs
  • Access to the Claude Code CLI and its models

Verify your environment

This one-liner checks Python, an executor CLI (cn or opencode), and your API key:

Setup

  1. Install the plugin in Claude Code:
  2. Restart Claude Code (or run /reload-plugins).
  3. Verify the install:
    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:
    For MiniMax-M2.7, accept the suggested sampling params (temperature=1.0, top_p=0.95).
Always pass the bare model id to /code (MiniMax-M2.7), never sambanova/MiniMax-M2.7.
Pick an executor that supports function calling. A /code sub-agent writes files and runs commands, which it drives through tool calls, so the model behind it has to support them. MiniMax-M2.7 is listed under Function calling; gemma-4-31B-it is not, so confirm it can complete a delegated write before relying on it as the planner shown in Demo 2 and Demo 3. See SambaCloud models for the current catalogue.

Running sub-agents with Claude and SambaNova

The SambaNova plugin 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.
Delegate the build:
Verify in the browser:
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:
Step 3 – Verify:
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 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)

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:
You should see context7 listed with resolve-library-id and query-docs.
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.

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 (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-idquery-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-idquery-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

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

Step 3 – Verify

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: 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