sanity-singletons

sanity-singletons is a skill for Claude Code from sanity-io/agent-toolkit. It costs 90 tokens per session (4,056 once invoked), scanned A, original, MIT.

Guidance for configuring a Sanity Studio document that exists once under a fixed ID, such as site settings, navigation, or footer content.

In plain words
What is it for?
Use it to register, display, hide, or migrate singleton documents in Sanity Studio, including Structure Tool integration.
Why use it?
It prevents users from creating duplicates or treating a single settings document like a normal list of content. It also covers migration from older custom or third-party approaches.

Skill for Claude Code

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

Part of the sanity plugin — 9 skills, 4 commands, 1 MCP server shipped together

Good fit Use it to register, display, hide, or migrate singleton documents in Sanity Studio, including Structure Tool integration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sanity-io/agent-toolkit/sanity-singletons
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 sanity-io/agent-toolkit --skill sanity-singletons
Clone the repo
git clone --depth 1 https://github.com/sanity-io/agent-toolkit

Made for: Claude Code.

Or install sanity, the plugin that ships this one along with the rest of its 9 skills, 4 commands, 1 MCP server.

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 sanity-singletons

README.md
[![agentmods](https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-singletons/github.svg)](https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-singletons)
Your own site
<a href="https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-singletons"><img src="https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-singletons/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sanity-singletons

Your own site · 80×15
<a href="https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-singletons"><img src="https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-singletons.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,056 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.00090 $0.04056
Opus 5.5 $0.00036 $0.01622
Sonnet 5.5 $0.00018 $0.00811
Haiku 4.5 $0.00009 $0.00406

Measured 3d ago against content hash 1234349f082c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sanity-singletons 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 3d ago.

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.

skills/sanity-singletons/SKILL.md · 200 lines

How it starts

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

Sanity Singletons

A "singleton" is a document with a fixed id that can be created exactly once. Common examples: site settings, navigation, footer content. Studio supports singletons as a first-class primitive via the document.singletons configuration registry plus a small set of Structure Tool helpers.

Requires sanity 6.17.0 or later. Check the installed version in the lockfile before using this API. On older Studios, either upgrade first or use the userland pattern (fixed documentId in a custom structure, plus manual newDocumentOptions and duplicate filtering) described in sanity-best-practices → studio-structure.

When to use this skill

  • A developer asks how to create a "settings document" or "singleton".
  • A studio configuration needs a document.singletons registry entry.
  • Structure Tool needs to render a singleton as a list item or document pane.
  • You're migrating an existing userland singleton implementation to the first-class API.
  • You're migrating from a third-party singleton plugin such as sanity-plugin-singleton-management (or its predecessor sanity-plugin-singleton-tools).

Registering a singleton

Singletons are registered in configuration, not on the schema type. A singleton definition binds a definition id to a document id and a schema type:

import {defineConfig, defineSingleton} from 'sanity'

export default defineConfig({
  schema: {
    types: [/* siteSettings and campaign are ordinary document types */],
  },
  document: {
    singletons: [
      // String shorthand — expands to
      // {id: 'siteSettings', documentId: 'siteSettings', schemaType: 'siteSettings'}
      'siteSettings',

      // Definition object. `defineSingleton` is an optional typed identity
      // helper; a plain object literal works too. `id` is omitted here, so it
      // inherits each `documentId`.
      defineSingleton({
        documentId: 'springCampaign',
        schemaType: 'campaign',
        title: 'Spring campaign', // optional display metadata
        initialValue: {season: 'spring'}, // optional per-singleton initial value
      }),
      defineSingleton({
        documentId: 'summerCampaign',
        schemaType: 'campaign',
        title: 'Summer campaign',
        initialValue: {season: 'summer'},
      }),
    ],
  },
})

Read the full file on GitHub · 200 lines

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. 3d ago First seen · 200 lines · 90 tokens per session scan A 1234349f082c

Subscribe to this mod's changes

sanity-singletons is a skill published in the GitHub repository sanity-io/agent-toolkit (190 stars, last pushed yesterday), licensed MIT. It adds 90 tokens to every session and 4,056 once invoked, about $0.0004 per session on Opus 5.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-10-13.

Related

Other skills, from other repositories

webhooks

Webhook subscriptions for the Ayrshare MCP server: register, unregister, and list HTTPS push notifications so an agent or app is notified on events instead of polling. Use whenever someone wants event push: "notify me when a post publishes", "let me know when a scheduled post goes out", "set up a webhook for new…

ayrshare/ayrshare-social-media-api-claude-plugin · 205 tokens

api-lifecycle

Provides API design and lifecycle management guidance including versioning, deprecation, rate limiting, and documentation standards. Triggers on api design, rest api, graphql, api versioning, deprecation, breaking changes, rate limiting, api lifecycle, api documentation, openapi.

doancan/mags · 58 tokens

n8n-subworkflows

Build reusable, composable n8n sub-workflows. Use when extracting shared logic, building anything multi-step or reused across workflows, or any workflow over 10 nodes — and whenever the user mentions sub-workflows, Execute Workflow, reuse, shared/common logic, modular workflows, "Define Below" inputs…

czlonkowski/n8n-mcp · 121 tokens

add-cloud-flow

Integrates Power Automate cloud flows into a Power Pages site. Lists available flows, suggests relevant ones based on intent, identifies scenarios and web roles, creates metadata files, and generates client-side code to call flows. Handles both new flow registration and adding already-registered flows to additional…

microsoft/power-platform-skills · 91 tokens

tidewave-integration

Tidewave MCP runtime tools — debugging, smoke testing, live state inspection, SQL queries, hex docs. Use when evaluating code in a running Phoenix app.

oliver-kriska/claude-elixir-phoenix · 38 tokens

video-perception

Use when the user mentions a video file (.mp4, .mov, .avi, .mkv, .webm), a YouTube URL, asks to watch/analyze/review a video, or references video content in conversation.

jordanrendric/claude-video-vision · 51 tokens