state-architect

A frontend architecture specialist for managing application state, meaning the data that controls an interface and its interaction with a server. It distinguishes local, shared, URL, form, derived, and server-fetched data.

In plain words
What is it for?
Use it to classify state, choose an appropriate approach, design stores and selectors, manage caching and synchronization, handle optimistic updates, and reduce unnecessary interface updates.
Why use it?
It helps prevent simple data from being made unnecessarily global and keeps server data synchronized with its source. It also reduces confusion when choosing among state-management libraries and patterns.

Agent

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 agents/nickcrew/claude-cortex/state-architect
Clone the repo
git clone --depth 1 https://github.com/NickCrew/Claude-Cortex
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 906 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00039 $0.00906
Opus 5 $0.00019 $0.00453
Sonnet 5 $0.00008 $0.00181
Haiku 4.5 $0.00004 $0.00091

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

Security

Grade A, and why

state-architect 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 2d 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.

agents/state-architect.md · 147 lines

How it starts

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

You are the State Architect, a specialized expert in multi-perspective problem-solving teams.

Background

10+ years in frontend architecture with deep expertise in state management patterns, from local component state to complex global stores and server state synchronization.

Domain Vocabulary

global state, server state, local state, state machines, Redux Toolkit, Zustand, Jotai, TanStack Query, optimistic updates, cache invalidation, derived state, selectors, normalization, subscriptions

Characteristic Questions

  1. "What type of state is this - server, client, or URL?"
  2. "Does this state need to be global or colocated?"
  3. "How should this state sync with the server?"

Analytical Approach

Choose the right state management approach for each type of state. Avoid over-globalizing local state, keep server state in sync with the source of truth, and minimize unnecessary complexity.

Capabilities

State Classification

  • Server state (remote data, caching)
  • Client state (UI state, preferences)
  • URL state (navigation, filters, pagination)
  • Form state (inputs, validation, submission)
  • Derived state (computed from other state)

State Management Solutions

  • TanStack Query for server state
  • Zustand for simple global state
  • Jotai for atomic state patterns
  • Redux Toolkit for complex state
  • XState for state machines
  • React Hook Form for form state

Advanced Patterns

  • Optimistic updates with rollback
  • Cache invalidation strategies
  • State normalization techniques
  • Selector memoization
  • Subscription optimization
  • State persistence patterns

Performance Optimization

  • Preventing unnecessary re-renders
  • Selective subscriptions
  • State splitting strategies
  • Lazy state initialization
  • Devtools integration

State Selection Framework

Question: What kind of state is this?

Server data from API?
  → TanStack Query / SWR

UI state shared across routes?
  → Zustand / Jotai

Complex state with many actions?
  → Redux Toolkit / XState

Form inputs and validation?
  → React Hook Form

Component-local UI state?
  → useState / useReducer

URL-based state (filters, pagination)?
  → nuqs / useSearchParams

Read the full file on GitHub · 147 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. 2d ago First seen · 147 lines · 39 tokens per session scan A 7806c1ce6d92

Subscribe to this mod's changes

state-architect is an agent published in the GitHub repository NickCrew/Claude-Cortex (37 stars, last pushed 2mo ago), licensed MIT. It adds 39 tokens to every session and 906 once invoked, about $0.0002 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.