shared-state-no-url

shared-state-no-url is a skill for Claude Code, Codex from asmyshlyaev177/state-in-url. It costs 106 tokens per session (1,591 once invoked), scanned A, original, MIT.

A guide for sharing state between React components without putting that state in the URL. It uses a shared default object instead of a provider such as React Context or a separate state store.

In plain words
What is it for?
Use it for local application state such as a cart, modal status, or other data that should not be synchronized to the URL.
Why use it?
It keeps temporary, sensitive, or large state out of the address bar while allowing unrelated components to access the same values.

Skill for Claude CodeCodex

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

Good fit Use it for local application state such as a cart, modal status, or other data that should not be synchronized to the URL.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/asmyshlyaev177/state-in-url/shared-state-no-url
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 shared-state-no-url
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 shared-state-no-url

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/asmyshlyaev177/state-in-url/shared-state-no-url"><img src="https://agentmods.dev/badge/skills/asmyshlyaev177/state-in-url/shared-state-no-url.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,591 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.00106 $0.01591
Opus 5.5 $0.00042 $0.00636
Sonnet 5.5 $0.00021 $0.00318
Haiku 4.5 $0.00011 $0.00159

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

Security

Grade A, and why

shared-state-no-url 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 23d 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/shared-state-no-url/SKILL.md · 181 lines

How it starts

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

state-in-url — Shared state without URL sync

useSharedState is state-in-url's lightweight cross-component state primitive — no Context provider, no Redux, no Zustand store. State is shared between any components that pass the same module-scoped default-state object (identity, not deep equality). It is framework-agnostic and has no URL involvement.

Decision: use useUrlState (see state-in-url/feature-state-hook) by default. Reach for useSharedState only when the user explicitly opts out of URL sync, or when the state is sensitive / ephemeral / too large for a URL.

Setup

// features/cart/cartState.ts
export type CartState = {
  items: { id: string; qty: number }[];
  isOpen: boolean;
};

export const CART_STATE: CartState = {
  items: [],
  isOpen: false,
};
// any component
'use client';
import { useSharedState } from 'state-in-url'; // NB: top-level subpath

import { CART_STATE } from 'features/cart/cartState';

export function CartButton() {
  const { state, setState } = useSharedState(CART_STATE);

  return (
    <button onClick={() => setState((curr) => ({ ...curr, isOpen: !curr.isOpen }))}>
      Cart ({state.items.length})
    </button>
  );
}

Any other component calling useSharedState(CART_STATE) reads and writes the same store.

Core Patterns

Functional update

setState((curr) => ({ ...curr, items: curr.items.concat(newItem) }));

Read-only getState (avoid rerender)

const { getState } = useSharedState(CART_STATE);

const onSubmit = () => {
  const { items } = getState(); // doesn't subscribe to changes
  api.checkout(items);
};

SSR initial state

const { state } = useSharedState(CART_STATE, () => readFromCookie());

The second-argument function runs once for the initial value (useful for cookie-driven SSR hydration).

Common Mistakes

MEDIUM Reaching for useSharedState when URL sync is wanted

Wrong:

// Filters that the user wants to share via copy/paste link
const { state, setState } = useSharedState(FILTERS_STATE);
// Page refresh loses everything. Link sharing impossible.

Read the full file on GitHub · 181 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. 23d ago First seen · 181 lines · 106 tokens per session scan A 21584fb9806e

Subscribe to this mod's changes

shared-state-no-url is a skill published in the GitHub repository asmyshlyaev177/state-in-url (418 stars, last pushed 21d ago), licensed MIT. It adds 106 tokens to every session and 1,591 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

Other skills, from other repositories

reskin

Author a NEW skin for the reskinnable-demo app. A skin is a self-contained domain plugin under src/skins/ / that implements the frozen Skin contract (src/shell/skin-contract.ts) to swap the app's entire experience — brand, theme, layout, pages, tools, data, and agent — as a live sales demo. Use when the user says "add…

CopilotKit/CopilotKit · 154 tokens

setup-slack-channel

Use for the PROVIDER half of getting a locally running CopilotKit Channels agent to answer in Slack, when no Slack app exists yet — setting up a Channels bot in Slack for the first time, creating the Slack app and its tokens, attaching it to a managed Intelligence Channel, or when a Channel reports setuprequired, sits…

CopilotKit/CopilotKit · 206 tokens

copilotkit-channels

Use for the CODE half of a managed Intelligence Channel with Slack or Microsoft Teams: customising the Channel a CLI-scaffolded project already ships, or — for a project the CLI did not generate — writing the Channel declaration, the long-running host, and the awaited activation call. Teams provider setup is in scope…

CopilotKit/CopilotKit · 112 tokens

copilotkit-cli

Use for the CopilotKit CLI — npx copilotkit@latest. Covers proving a project's wiring with verify before debugging anything by hand, scaffolding with create, signing in and selecting a hosted Intelligence project, agent-assisted onboarding of an existing app, generating type-safe agent ids, and importing thread…

CopilotKit/CopilotKit · 87 tokens

channels-setup

Use when a developer wants to build their first CopilotKit Channels agent and get it answering in Slack or Microsoft Teams: "set up a channel", "connect my agent to Slack", "get my agent into Teams", or starting from nothing and wanting a working channel end to end. Covers the whole path: inspecting or scaffolding the…

CopilotKit/CopilotKit · 141 tokens

inspector-workbench

Runs Inspector UI work on the standalone Threads state lab so the agent can see the overlay. Use when a CopilotKit employee asks an agent to fix, polish, add, or debug Inspector UI, chrome, panes, overlay actions, launcher, Home, Threads, Playground, Memory, or any visual behavior in @copilotkit/web-inspector. Don't…

CopilotKit/CopilotKit · 112 tokens