sam3

sam3 is a skill for Claude Code from graph-robots/open-robot-skills. It costs 60 tokens per session (998 once invoked), scanned A, original, Apache-2.0.

A computer-vision tool that finds objects in images from text, points, or boxes and creates pixel-level masks around them. It can also follow one selected object through a video stream while preserving its identity.

In plain words
What is it for?
Use it to segment objects such as “the person” or “the car” in an image, refine detections within a box, or track one target across video frames.
Why use it?
It removes the need to draw every object boundary by hand. The masks and tracking state provide object shapes and positions for later visual processing or control tasks.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the open-robot-skills plugin — 15 skills shipped together

Good fit Use it to segment objects such as “the person” or “the car” in an image, refine detections within a box, or track one target across video frames.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/graph-robots/open-robot-skills/sam3
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add graph-robots/open-robot-skills --skill sam3
Clone the repo
git clone --depth 1 https://github.com/graph-robots/open-robot-skills

Made for: Claude Code.

Or install open-robot-skills, the plugin that ships this one along with the rest of its 15 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sam3

README.md
[![agentmods](https://agentmods.dev/badge/skills/graph-robots/open-robot-skills/sam3.svg)](https://agentmods.dev/skills/graph-robots/open-robot-skills/sam3)
Your own site
<a href="https://agentmods.dev/skills/graph-robots/open-robot-skills/sam3"><img src="https://agentmods.dev/badge/skills/graph-robots/open-robot-skills/sam3.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 998 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.00998
Opus 5 $0.00030 $0.00499
Sonnet 5 $0.00012 $0.00200
Haiku 4.5 $0.00006 $0.00100

Measured 7d ago against content hash 08e1d9f1a0e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

sam3 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (_streaming.py, tools.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

tools/sam3/SKILL.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

sam3

The SAM3 image servicer + video-tracker servicer as in-process tools. Images are RGB uint8 [H, W, 3] numpy arrays; masks come back as gap Mask (uint8 [H, W], 0 background / 255 foreground), score-sorted best-first.

When to use

  • segment_text for open-vocabulary "find the X" masks (one mask per instance; check scores[0] — callers typically reject below ~0.3).
  • segment_box after a detector (e.g. grounding-dino.detect) for a pixel-accurate mask inside the detection box; add the point prompt (use_point=True) when a pointing model supplies one.
  • tracker_init / tracker_update / tracker_close to follow a single target across an observation stream (e.g. for visual servoing).

Install

uv sync --extra sam3       # torch + torchvision + the upstream sam3 package
# (pip: pip install -e ".[sam3]")

Model weights download on first model build. Device is taken from GAP_SAM3_DEVICE (default cuda); the image model also runs on cpu (slow), the video tracker is CUDA-only in practice.

Gotchas (carried over from the servicers)

  • Lazy singletons: the image model and the video predictor each load on first call and stay resident; importing the bundle never imports torch.
  • segment_text caps results at max_results=5 by default — cluttered scenes emit 100+ instances (~1 MB/mask at 720p) and downstream consumes only the top mask. Pass max_results<=0 for everything.
  • The video tracker JIT-compiles Triton NMS kernels via the CC env var; a stale CC (e.g. a Ray env pointing at a non-existent gcc-13) surfaces as FileNotFoundError inside tracker_init. The bundle forces CC to a real compiler before tracker use (_ensure_cc_compiler).
  • Tracker prompt precedence is box > point > text; a point prompt is converted to a small (10% of image) box because the predictor's box path is more reliable for init than a single point.
  • The tracker is built with apply_temporal_disambiguation=False — the default hotstart heuristics silently delete the masklet around frame 3 in streaming mode (no fresh text re-detection per frame).
  • Drift handling in tracker_update: a mask-area jump >1.5x the running median or confidence <0.30 keeps the LAST GOOD mask and reports confidence=0.0 with object_present=True (skip this frame); after 5 consecutive drift hits object_present=False — re-init the tracker.
  • Sessions idle longer than 120 s are evicted lazily on the next tracker call; an evicted/unknown tracker_id raises ToolError.
  • tracker_init returns object_present=False with an empty tracker_id (no exception) when the initial detection finds nothing.

Read the full file on GitHub · 77 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 77 lines · 60 tokens per session scan A 08e1d9f1a0e9

Subscribe to this mod's changes

sam3 is a skill published in the GitHub repository graph-robots/open-robot-skills (39 stars, last pushed yesterday), licensed Apache-2.0. It adds 60 tokens to every session and 998 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

mjlab-to-mjswan

Port an mjlab task to mjswan: turn a local or remote GitHub repo that registers mjlab tasks into a browser app. Use when the user wants to run, visualize, or deploy an mjlab task (theirs or a third party's) in the browser with mjswan.

ttktjmt/mjswan · 0 tokens

gap

Program robots with GaP (graph-as-policy) — compile natural-language tasks into typed, verified robot skill graphs and run them on simulators or real robots. Use when the user mentions GaP or graph-as-policy, robot manipulation, robot skills, robot tools or capabilities, skill registries, open-robot-skills, LIBERO or…

graph-robots/graph-as-policy · 195 tokens

habitat-gs-train

Train and evaluate a navigation policy in the habitat-gs simulator. Covers the full generate-episodes → train → evaluate flow for PointNav / ImageNav / ObjectNav (Habitat-Lab + DDPPO reinforcement learning) and for Vision-and-Language Navigation (StreamVLN, Uni-NaVid). Use when the user wants to train, fine-tune…

zju3dv/habitat-gs · 114 tokens

authoring-pipelines

Use when the user wants a bagel data pipeline — reducing a log to windows around events ("keep 30s around every hard brake"), recurring snippets/GIFs/exports, or any tasks-and-gates automation over robot data.

Extelligence-ai/bagel · 52 tokens

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens