sanity-form-component-suspense

sanity-form-component-suspense is a skill for Claude Code from sanity-io/agent-toolkit. It costs 149 tokens per session (1,276 once invoked), scanned A, original, MIT.

A repair guide for Sanity Studio custom form components. Sanity Studio is a web interface for editing structured content, and Suspense is a React feature that shows a fallback while part of a page loads.

In plain words
What is it for?
It is for adding an appropriately sized loading fallback around a Sanity input, field or array-item component that suspends.
Why use it?
It fixes loading warnings, blank forms and layout shifts when a custom field or item needs to wait for code or data before it can render.

Skill for Claude Code

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

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

Good fit It is for adding an appropriately sized loading fallback around a Sanity input, field or array-item component that suspends.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sanity-io/agent-toolkit/sanity-form-component-suspense
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-form-component-suspense
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 10 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-form-component-suspense

README.md
[![agentmods](https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-form-component-suspense/github.svg)](https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-form-component-suspense)
Your own site
<a href="https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-form-component-suspense"><img src="https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-form-component-suspense/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-form-component-suspense

Your own site · 80×15
<a href="https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-form-component-suspense"><img src="https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-form-component-suspense.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 149 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,276 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.00149 $0.01276
Opus 5.5 $0.00060 $0.00510
Sonnet 5.5 $0.00030 $0.00255
Haiku 4.5 $0.00015 $0.00128

Measured today against content hash 7e7e3c3b406f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sanity-form-component-suspense 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 today.

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-form-component-suspense/SKILL.md · 88 lines

How it starts

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

Custom form components that suspend

Studio puts a fallback boundary around every field and every array item, so one suspending component cannot blank the form. That fallback is a generic skeleton: it does not know the size of what it replaces, so the form shifts when the component loads, and Studio warns about it in the console. The fix always lives in your code: declare a Suspense around the part that suspends, with a fallback that takes the same space as what it stands in for. Any boundary you declare is closer to what suspends than Studio's, so it always wins and nothing warns. That includes a boundary in a custom field around props.renderDefault(props), which also covers the field's input: use it when one fallback should cover both, for example a lazy input that also fetches.

Workflow

  1. Find the component. The warning names the custom components declared for that field or item (components.field, .input or .item), the path, the document type and the schema type, and logs the components themselves; click one in the browser console to open its source. Production builds minify the names, so use the path and document type there. When the schema type declares none, the warning starts with "A form component" and the culprit is usually a plugin's form.components. React DevTools' Suspense tab shows which component actually suspended.
  2. Find what suspends. Usually one of: React.lazy, use(promise), an App SDK hook (useDocumentProjection, useDocument, useQuery, useDocuments), or a library in suspense mode (useSuspenseQuery).
  3. Move it into its own component if it is not already, and wrap only that component in <Suspense> inside the custom component. Keep props.renderDefault(props) outside the boundary, so the built-in input, field or item never unmounts (and never loses focus while someone types) when the async part suspends again.
  4. Reserve the space. The fallback must have the size of the loaded UI:
    • Additive UI (warnings, previews, counts): render it after renderDefault so it never pushes the rest down, and give the fallback the height of one loaded row.
    • A whole component that loads lazily: a skeleton with the component's height, not null.
    • Array items: the list is virtualized and measures each row, so an item fallback that is shorter or taller than the loaded row makes the rows below it jump. Match the row height.
  5. Do not suspend on a document that does not exist yet. A new document only exists once the first edit creates it, and SDK hooks that read the current document wait for it forever. Gate on useFormValue(['_createdAt']): it is unset until the document exists.
  6. Keep promises stable. A promise created during render, in useState or in useMemo is thrown away while the component suspends on mount, so use() gets a new one every retry and never settles. Use the SDK hooks, a module-scope cache keyed by the inputs, or a data library.
  7. Verify. Open a new document of the type and an existing one: the warning is gone, the rest of the form is editable right away, and nothing moves when the async part lands.

Read the full file on GitHub · 88 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. today First seen · 88 lines · 149 tokens per session scan A 7e7e3c3b406f

Subscribe to this mod's changes

sanity-form-component-suspense is a skill published in the GitHub repository sanity-io/agent-toolkit (192 stars, last pushed today), licensed MIT. It adds 149 tokens to every session and 1,276 once invoked, about $0.0006 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-23.

Related

Other skills, from other repositories

troubleshooting-assistant

Diagnoses and resolves MCP server registration failures, GPU detection, BigQuery authentication, index build failures, import errors, search quality issues, and performance problems.

RobThePCGuy/Claude-Patent-Creator · 37 tokens

opik-diagnose

Surface the Opik traces worth a developer's attention, ranked by signal — Diagnostics issues first, then errors, failed tool calls, latency, regressions, and low online-eval scores. With the Opik MCP connected it lists the project's agentinsightsissue entities, offers to turn Diagnostics on when the project has it…

comet-ml/opik-claude-code-plugin · 187 tokens

doctor

Health probe across the worker, embedder, summarizer, queue, vector index, schema, cross-AI wiring and plugin install (cache and live versions). Use when the user types /captain-memo:doctor or when something seems wrong.

kalinbogatzevski/captain-memo · 52 tokens

inventory

Codebase inventory skill — scans the repo for a named pattern (inline SQL, fetch calls, feature flags, debug leftovers, deprecated APIs, etc.) defined by a YAML "recipe pack" and emits a structured Markdown inventory cross-referenced with framework metadata (routes, handlers). The engine is language-agnostic and…

ggemba/squad-mcp · 0 tokens

debug

Read-only bug investigation skill. Takes a bug description + optional stack trace + optional repro steps; orients via code-explorer (Haiku grep/excerpt), then dispatches the debugger persona to emit N ranked hypotheses (1/3/5 on --quick/--normal/--deep) with file:line evidence, verification steps, and confidence…

ggemba/squad-mcp · 0 tokens

react-performance

React and Next.js performance optimization patterns adapted from Vercel Engineering's React Best Practices (https://github.com/vercel-labs/agent-skills). Organizes 70+ rules across 8 priority categories — waterfalls, bundle size, server-side, client fetching, re-render, rendering, JS micro-perf, advanced. Use when…

JunMystery/Agent-Guidance-Python · 86 tokens