StateCore CLAUDE.md

StateCore CLAUDE.md is an instructions file for coding agents from yul761/StateCore. It costs 2,688 tokens per session, scanned A, original, MIT.

Project guidance for StateCore, an AI memory system that stores events, builds longer-term memory, and provides an API for saving and recalling it. It covers the TypeScript monorepo, local services, and development commands.

In plain words
What is it for?
Installing dependencies, running the API and background workers, checking types, testing the core package, building the monorepo, and preparing release notes with Changesets.
Why use it?
It gives an agent the context needed to understand the system and start the right API, worker, tests, or build commands. This avoids guessing how the separate applications and packages fit together.

Instructions file

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 instructions/yul761/statecore/claude-md
Clone the repo
git clone --depth 1 https://github.com/yul761/StateCore

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 StateCore CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/yul761/statecore/claude-md.svg)](https://agentmods.dev/instructions/yul761/statecore/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/yul761/statecore/claude-md"><img src="https://agentmods.dev/badge/instructions/yul761/statecore/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,688 This file is loaded in full into every session.
When invoked 2,688 The same file — it is already loaded in full.
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.02688 $0.02688
Opus 5 $0.01344 $0.01344
Sonnet 5 $0.00538 $0.00538
Haiku 4.5 $0.00269 $0.00269

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

Security

Grade A, and why

StateCore CLAUDE.md 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 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.

Makes network callslowCapability

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

curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:3002/v1/health # want 200
CLAUDE.md · 207 lines

How it starts

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

StateCore — Claude Context

What this is

StateCore is an AI memory management system. It stores memory events, runs digest workers to build stable state, and serves a REST API for ingestion and recall.

It is the Layer 1 engine of the StateCore-App stack (see ../CLAUDE.md): open-source (MIT), self-hostable, and fronted by ../statecore-cloud (managed gateway) which ../assistant-backend uses as its memory store. Tech: pnpm + Turbo monorepo (apps/*, packages/*), TypeScript, Node ≥20, NestJS, Prisma/Postgres+pgvector, BullMQ/Redis, Zod, Vitest, Changesets.

Commands

pnpm install
pnpm dev:api          # API only (port 3002)
pnpm dev:worker       # background workers (digest, working memory, reminders)
pnpm dev:lite         # = dev:api
pnpm test:core        # Vitest suite for @statecore/core
pnpm lint             # tsc --noEmit across apps + packages
pnpm build            # build all apps + packages
pnpm changeset        # add a changeset (releases via Changesets)
pnpm benchmark        # synthetic memory-quality benchmark suite

changeset version needs a token for its changelog generator: GITHUB_TOKEN="$(gh auth token)" pnpm exec changeset version. Releases are manual — version, commit, tag with apps/api's version, gh release create. Every package is private: true except apps/mcp (statecore-mcp), the one package that publishes to npm — see apps/mcp/README.md.

Module resolution — read before touching package.json or tsconfig

The four library packages point main at dist/index.js and types at src/index.ts. That split is deliberate and load-bearing:

  • maindist because node dist/main.js cannot load a .ts entry. The Dockerfile used to rewrite these four package.json files at image build time, which meant the image was the only place a built app could start.
  • typessrc so type-checking and building need no prior build. Do not "fix" this with tsconfig paths — mapping these names to real paths puts the files under the importing package's rootDir and fails every build with TS6059. Resolution through the node_modules symlink is exempt from that check.
  • Vitest reads main, so vitest.shared.ts aliases the names back to source. A package that runs tests needs a vitest.config.ts importing it, or its suite silently runs against stale dist.
  • tsx reads main too, so pnpm dev:* and the tsx-run scripts pass --tsconfig ../../tsconfig.dev.json, which carries the paths tsc cannot.

Read the full file on GitHub · 207 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. 3d ago First seen · 207 lines · 2,688 tokens per session scan A fa6abad6b325

Subscribe to this mod's changes

StateCore CLAUDE.md is an instructions file published in the GitHub repository yul761/StateCore (1 stars, last pushed 4d ago), licensed MIT. It adds 2,688 tokens to every session, about $0.0134 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-31.