add-state

add-state is a command for Claude Code from go4cas/quiver. It costs 0 tokens per session (485 once invoked), scanned A, original, MIT.

A command for creating a state module in Quiver, a JavaScript application framework. It creates a reactive store with items and methods for adding, removing, and updating them.

In plain words
What is it for?
Use it to create state for domains such as posts or cart items in a Quiver app. The generated module is placed under src/state/.
Why use it?
It gives new application data a consistent store structure and derives names from the requested domain object. It can also add an idle status when asynchronous work is likely.

Command for Claude Code

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 commands/go4cas/quiver/add-state
Clone the repo
git clone --depth 1 https://github.com/go4cas/quiver

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 add-state

README.md
[![agentmods](https://agentmods.dev/badge/commands/go4cas/quiver/add-state.svg)](https://agentmods.dev/commands/go4cas/quiver/add-state)
Your own site
<a href="https://agentmods.dev/commands/go4cas/quiver/add-state"><img src="https://agentmods.dev/badge/commands/go4cas/quiver/add-state.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 485 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.00000 $0.00485
Opus 5 $0.00000 $0.00243
Sonnet 5 $0.00000 $0.00097
Haiku 4.5 $0.00000 $0.00049

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

Security

Grade A, and why

add-state 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 3d 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/commands/add-state.md · 52 lines

What it actually says

Create a new Quiver state module for: $ARGUMENTS

The argument is either a module name (e.g. postState, cartState) or a plain noun (e.g. post, cart). Normalise to camelCase with a State suffix (e.g. postState).

Follow these steps exactly:

  1. Create src/state/<name>.js using the createStore pattern:
import { createStore } from '../framework/index.js'

export const <name> = createStore((reactive) => {
  const state = reactive({
    items: [],
  })

  return {
    get items() { return state.items },

    add(item) {
      state.items.push({ ...item, id: crypto.randomUUID() })
    },

    remove(id) {
      state.items = state.items.filter(i => i.id !== id)
    },

    update(id, changes) {
      const idx = state.items.findIndex(i => i.id === id)
      if (idx !== -1) Object.assign(state.items[idx], changes)
    },
  }
})
  • Rename items to a domain-appropriate plural noun derived from the argument (e.g. posts, cartItems)
  • Keep methods generic but rename them to match the domain where it makes the intent clearer (e.g. addPost, removePost)
  • Add status: 'idle' to state if async operations are likely
  1. Apply all Arrow.js rules — state returned from createStore is already reactive; no extra wrapping needed.

    • Annotate every method's parameters with JSDoc (e.g. /** @param {string} id */) and add a @typedef for the item shape — strict checkJs is enforced and untyped params fail npm run typecheck. See src/state/userState.js for the pattern.
  2. Verify — run and fix any failures:

npm run typecheck && npm test && npm run test:e2e
  1. Report:
    • The file created
    • The exported name to import in pages: import { <name> } from '../state/<name>.js'
    • A one-line usage example showing how to read state and call an action in a page template
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. 3d ago First seen · 52 lines · 0 tokens per session scan A 9d31eb62696e

Subscribe to this mod's changes

add-state is a command published in the GitHub repository go4cas/quiver (5 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 485 tokens. 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-31.