nextjs-ssr

nextjs-ssr is a skill for Claude Code, Codex from asmyshlyaev177/state-in-url. It costs 104 tokens per session (3,124 once invoked), scanned A, original, MIT.

A guide for keeping URL-based state correct during server rendering in Next.js App Router. It explains how to pass search parameters from a server page so the first page output matches the URL.

In plain words
What is it for?
Use it for filters, tabs, search settings, or other state stored in the URL in a Next.js App Router application.
Why use it?
Without this setup, the page can first show default values, then change after the browser loads, causing a visible flash or a React hydration warning.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for filters, tabs, search settings, or other state stored in the URL in a Next.js App Router application.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/asmyshlyaev177/state-in-url/nextjs-ssr
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 asmyshlyaev177/state-in-url --skill nextjs-ssr
Clone the repo
git clone --depth 1 https://github.com/asmyshlyaev177/state-in-url

Made for: Claude Code, Codex.

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 nextjs-ssr

README.md
[![agentmods](https://agentmods.dev/badge/skills/asmyshlyaev177/state-in-url/nextjs-ssr/github.svg)](https://agentmods.dev/skills/asmyshlyaev177/state-in-url/nextjs-ssr)
Your own site
<a href="https://agentmods.dev/skills/asmyshlyaev177/state-in-url/nextjs-ssr"><img src="https://agentmods.dev/badge/skills/asmyshlyaev177/state-in-url/nextjs-ssr/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 nextjs-ssr

Your own site · 80×15
<a href="https://agentmods.dev/skills/asmyshlyaev177/state-in-url/nextjs-ssr"><img src="https://agentmods.dev/badge/skills/asmyshlyaev177/state-in-url/nextjs-ssr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,124 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.00104 $0.03124
Opus 5.5 $0.00042 $0.01250
Sonnet 5.5 $0.00021 $0.00625
Haiku 4.5 $0.00010 $0.00312

Measured 1mo ago against content hash 2bf54c1d6889, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nextjs-ssr 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 1mo 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/nextjs-ssr/SKILL.md · 342 lines

How it starts

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

This skill builds on state-in-url/feature-state-hook. Read it first for the module-scoped default-state rule.

state-in-url — Next.js App Router SSR

Without searchParams, the first render of a useUrlState component has no URL knowledge. It renders defaults, then a client useEffect re-syncs from the URL → visible flash and a React hydration warning. The fix is to feed the URL into the hook on the server (via searchParams prop or a Proxy header) so the very first render is correct.

App Router only. Pages Router uses next/router, which state-in-url/next does not support — there are no plans to add it.

Setup

Server page forwarding searchParams (recommended)

// app/jobs/page.tsx  (Server Component)
import { JobsList } from './JobsList';

export default async function Page({
  searchParams,
}: {
  searchParams: Promise<Record<string, string | string[] | undefined>>;
}) {
  const sp = await searchParams; // Next.js 15+: searchParams is a Promise
  return <JobsList searchParams={sp} />;
}
// app/jobs/JobsList.tsx
'use client';
import { useUrlState } from 'state-in-url/next';
import { JOBS_STATE } from 'features/jobs/jobsState';

export function JobsList({ searchParams }: { searchParams: object }) {
  const { urlState, setUrl } = useUrlState(JOBS_STATE, { searchParams });
  return <pre>{JSON.stringify(urlState)}</pre>;
}

Fallback: useSearchParams when the prop cannot reach the component

Use this only when a client component genuinely cannot receive searchParams from a server parent. It is not the default and not an equivalent alternative: on a statically rendered route useSearchParams() needs a <Suspense> boundary — next build fails without one — and everything inside that boundary is client-rendered, so it shows the fallback until hydration. On an already-dynamic route it costs nothing extra, but it still buys nothing the server prop does not — on the client the hook already reads window.location.search for itself.

Read the full file on GitHub · 342 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. 1mo ago Changed 2bf54c1d6889
  2. 1mo ago Changed 3d4dfa819489
  3. 2mo ago First seen · 342 lines · 104 tokens per session scan A 2e1684de3f73

Subscribe to this mod's changes

nextjs-ssr is a skill published in the GitHub repository asmyshlyaev177/state-in-url (419 stars, last pushed 1mo ago), licensed MIT. It adds 104 tokens to every session and 3,124 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-09-22.

Related

nextjs-ssr compared with skills from other repositories

nextjs-ssr next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nextjs-ssrasmyshlyaev177/state-in-urlSkill4191mo agoMITA104Claude Code, Codex
reskinCopilotKit/CopilotKitSkill39ktodayMITA154Claude Code
copilotkit-channelsCopilotKit/CopilotKitSkill39ktodayMITA112Claude Code
setup-slack-channelCopilotKit/CopilotKitSkill39ktodayMITA206Claude Code
a2ui-catalogCopilotKit/CopilotKitSkill39ktodayMITA190Claude Code
copilotkit-cliCopilotKit/CopilotKitSkill39ktodayMITA87Claude Code
a2ui-coreCopilotKit/CopilotKitSkill39ktodayMITA18Claude Code