cache-components

cache-components is a skill for Claude Code, Codex from sangrokjung/claude-forge. It costs 183 tokens per session (3,431 once invoked), scanned A, original, MIT.

Guidance for Next.js Cache Components and Partial Prerendering, which combines a quickly served static page shell with dynamic content that loads separately. It activates when a Next.js project enables `cacheComponents`.

In plain words
What is it for?
For writing or reviewing Next.js server components, data fetching, server actions, and performance-related code in projects using Cache Components.
Why use it?
It helps keep reusable or stable content cached while allowing changing data to load dynamically, without treating the whole page as only static or only dynamic.

Skill for Claude CodeCodex

Part of the claude-forge plugin — 33 skills, 39 commands, 17 agents shipped together

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.

agentmods
npx agentmods add skills/sangrokjung/claude-forge/cache-components
Any agent
npx skills add sangrokjung/claude-forge --skill cache-components
Clone the repo
git clone --depth 1 https://github.com/sangrokjung/claude-forge

Made for: Claude Code, Codex.

Or install claude-forge, the plugin that ships this one along with the rest of its 33 skills, 39 commands, 17 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/sangrokjung/claude-forge/cache-components.svg)](https://agentmods.dev/skills/sangrokjung/claude-forge/cache-components)
Your own site
<a href="https://agentmods.dev/skills/sangrokjung/claude-forge/cache-components"><img src="https://agentmods.dev/badge/skills/sangrokjung/claude-forge/cache-components.svg" alt="Measured on agentmods" height="20"></a>
Per session 183 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,431 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00183 $0.03431
Opus 5 $0.00092 $0.01716
Sonnet 5 $0.00037 $0.00686
Haiku 4.5 $0.00018 $0.00343

Measured 5d ago against content hash 067eaa1d9377, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cache-components scanned grade A with 1 finding 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 5d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

return fetch(url).then((r) => r.json())
skills/cache-components/SKILL.md · 468 lines

How it starts

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

Next.js Cache Components

Auto-activation: This skill activates automatically in projects with cacheComponents: true in next.config.

Project Detection

When starting work in a Next.js project, check if Cache Components are enabled:

# Check next.config.ts or next.config.js for cacheComponents
grep -r "cacheComponents" next.config.* 2>/dev/null

If cacheComponents: true is found, apply this skill's patterns proactively when:

  • Writing React Server Components
  • Implementing data fetching
  • Creating Server Actions with mutations
  • Optimizing page performance
  • Reviewing existing component code

Cache Components enable Partial Prerendering (PPR) - mixing static HTML shells with dynamic streaming content for optimal performance.

Philosophy: Code Over Configuration

Cache Components represents a shift from segment configuration to compositional code:

Before (Deprecated) After (Cache Components)
export const revalidate = 3600 cacheLife('hours') inside 'use cache'
export const dynamic = 'force-static' Use 'use cache' and Suspense boundaries
All-or-nothing static/dynamic Granular: static shell + cached + dynamic

Key Principle: Components co-locate their caching, not just their data. Next.js provides build-time feedback to guide you toward optimal patterns.

Core Concept

┌─────────────────────────────────────────────────────┐
│                   Static Shell                       │
│  (Sent immediately to browser)                       │
│                                                      │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  │
│  │   Header    │  │  Cached     │  │  Suspense   │  │
│  │  (static)   │  │  Content    │  │  Fallback   │  │
│  └─────────────┘  └─────────────┘  └──────┬──────┘  │
│                                           │         │
│                                    ┌──────▼──────┐  │
│                                    │  Dynamic    │  │
│                                    │  (streams)  │  │
│                                    └─────────────┘  │
└─────────────────────────────────────────────────────┘

Read the full file on GitHub · 468 lines

Files

What ships with it

3 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. 5d ago First seen · 468 lines · 183 tokens per session scan A 067eaa1d9377

Subscribe to this mod's changes

cache-components is a skill published in the GitHub repository sangrokjung/claude-forge (825 stars, last pushed 2d ago), licensed MIT. It adds 183 tokens to every session and 3,431 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.