StateCore: Instructions file for Claude Code

CLAUDE.md

StateCore CLAUDE.md is an instructions file for Claude Code from yul761/StateCore. It costs 2,703 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is yul761/StateCore's own configuration. It tells Claude Code how to work on StateCore itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything StateCore configures →

Reuse

Borrowing it

Nothing to install: this file belongs to yul761/StateCore. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/yul761/StateCore/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/yul761/StateCore

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/yul761/statecore/claude-md/github.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/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 StateCore CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/yul761/statecore/claude-md"><img src="https://agentmods.dev/badge/instructions/yul761/statecore/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,703 This file is loaded in full into every session.
When invoked 2,703 The same file — it is already loaded in full.
Security scan A 1 finding. 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.02703 $0.02703
Opus 5.5 $0.01081 $0.01081
Sonnet 5.5 $0.00541 $0.00541
Haiku 4.5 $0.00270 $0.00270

Measured 1mo ago against content hash 842d6fdc003c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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 (apps/mcp: ≥22.13, it uses node:sqlite), 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:

  • main → dist 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.
  • types → src 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. 1mo ago Changed · +15 tokens per session 842d6fdc003c
  2. 2mo 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 14d ago), licensed MIT. It adds 2,703 tokens to every session, about $0.0108 per session on Opus 5.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.

Related

StateCore CLAUDE.md compared with instructions from other repositories

StateCore CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
StateCore CLAUDE.mdyul761/StateCoreInstructions file114d agoMITA2,703Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode