sanity-live-cache-components

sanity-live-cache-components is a skill for Claude Code from robotostudio/turbo-start-sanity. It costs 110 tokens per session (2,563 once invoked), scanned A, original, MIT.

A setup guide for Sanity Live, which updates content while it changes, with Next.js Cache Components, which controls how page data is cached. It also covers draft previews and visual editing.

In plain words
What is it for?
Use it when configuring or migrating a Next.js 16.2 or newer app that uses next-sanity, Sanity content previews, Visual Editing, Presentation Tool, or Cache Components.
Why use it?
It explains how live content updates, caching, and draft mode fit together in a Next.js app. This helps developers configure previews and refresh cached pages without losing the intended cache behavior.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

Good fit Use it when configuring or migrating a Next.js 16.2 or newer app that uses next-sanity, Sanity content previews, Visual Editing, Presentation Tool, or Cache Components.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/robotostudio/turbo-start-sanity/sanity-live-cache-components
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 robotostudio/turbo-start-sanity --skill sanity-live-cache-components
Clone the repo
git clone --depth 1 https://github.com/robotostudio/turbo-start-sanity

Made for: Claude Code.

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-live-cache-components

README.md
[![agentmods](https://agentmods.dev/badge/skills/robotostudio/turbo-start-sanity/sanity-live-cache-components/github.svg)](https://agentmods.dev/skills/robotostudio/turbo-start-sanity/sanity-live-cache-components)
Your own site
<a href="https://agentmods.dev/skills/robotostudio/turbo-start-sanity/sanity-live-cache-components"><img src="https://agentmods.dev/badge/skills/robotostudio/turbo-start-sanity/sanity-live-cache-components/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-live-cache-components

Your own site · 80×15
<a href="https://agentmods.dev/skills/robotostudio/turbo-start-sanity/sanity-live-cache-components"><img src="https://agentmods.dev/badge/skills/robotostudio/turbo-start-sanity/sanity-live-cache-components.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,563 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 26
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 93
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
How audits are shown
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.00110 $0.02563
Opus 5 $0.00055 $0.01282
Sonnet 5 $0.00022 $0.00513
Haiku 4.5 $0.00011 $0.00256

Measured 11d ago against content hash 67d3f03e72b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

sanity-live-cache-components 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 11d 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.

.claude/skills/sanity-live-cache-components/SKILL.md · 169 lines

How it starts

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

Sanity Live + Cache Components

Wires next-sanity into a Next.js 16+ app with cacheComponents: true. Data is fetched with sanityFetch (which calls cacheTag/cacheLife internally), and <SanityLive> in the root layout revalidates cached content over an EventSource connection to Sanity Content Lake. Visual Editing and Presentation Tool are fully supported when draft mode is enabled.

Read the relevant guide in node_modules/next/dist/docs/ (when available) before writing code. If a guide conflicts with this skill, follow this skill.

This skill assumes familiarity with the next-cache-components skill — it covers 'use cache', cacheLife, cacheTag, and the cookies/headers/params rule. The only Sanity-relevant exception: await draftMode() is allowed inside 'use cache' (Next.js bypasses caching when draft mode is enabled — see the use cache reference).

Prerequisites

  • Next.js 16.2+ installed in the project (check package.json or run pnpm list next / npm ls next — don't use pnpm view next version, that reports the registry's latest, not what's installed).
  • AGENTS.md exists, or follow the guide.
  • These environment variables are set:
    • NEXT_PUBLIC_SANITY_PROJECT_ID
    • NEXT_PUBLIC_SANITY_DATASET
    • SANITY_API_READ_TOKEN
  • Embedded Sanity Studio configuration (sanity.config.ts, sanity.cli.ts, anything under sanity/) needs no changes — this skill only touches the Next.js app surface.

Reference files

File When to read
reference/live-helpers.md Full client.ts / live.ts, sanityFetch* and getDynamicFetchOptions details
reference/three-layer-pattern.md The Page → Dynamic → Cached pattern for page.tsx, including the searchParams variant
reference/layouts.md Non-blocking data fetching inside layout.tsx with a shared 'use cache' helper
reference/dynamic-segments.md High-performance [slug] routes: loading.tsx + partial generateStaticParams, or non-blocking dynamic params in a layout

Read the full file on GitHub · 169 lines

Files

What ships with it

4 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. 11d ago First seen · 169 lines · 110 tokens per session scan A 67d3f03e72b1

Subscribe to this mod's changes

sanity-live-cache-components is a skill published in the GitHub repository robotostudio/turbo-start-sanity (176 stars, last pushed today), licensed MIT. It adds 110 tokens to every session and 2,563 once invoked, about $0.0006 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

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit calls, or resolve the link-prefetch-partial and instant-shell-url-data…

sanity-io/next-sanity · 92 tokens

sanity-live-cache-components

Integrates Sanity Live with Next.js Cache Components in next-sanity v13+ apps. Sets up sanityFetch, a shared cachedSanity 'use cache' boundary, , Visual Editing, Presentation Tool, draft mode handling, and the three-layer (Page/Dynamic/Cached) component pattern with explicit perspective/stega prop-drilling. Sequences…

sanity-io/next-sanity · 155 tokens

pnpm

Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces, or managing dependencies with catalogs, patches, or overrides.

sanity-io/next-sanity · 35 tokens

gcss-v3-site-framework

Initialize, adapt, audit, upgrade, or downgrade projects built from gcss-v3-site-framework. Use for A1/A2/B/C delivery profiles, static-brand/cms-brand/retail setup, Astro and Sanity page models, the C Retail Catalog & Content Foundation with read-only Shopify catalog mapping, Cloudflare Worker routes, project…

ZUnfurl/zunfurl · 88 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

sanity-io/next-sanity · 95 tokens

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…

sanity-io/next-sanity · 67 tokens