session-state
Skill17 starsChanged 22 days agoMITView on GitHub
Maintain SESSION-STATE.md, the durable within-session memory that survives context compaction. Use when a constraint, settled decision, existing-infrastructure (survey) finding, or open thread must persist across a long session so it is not re-derived or re-litigated. Triggers on /state, "remember this for the session", "record this constraint/decision", or after surveying what already exists. For cross-session/personal memory use .claude/memory/ on Claude or native memories on Codex; for repo-derivable facts, do not record at all.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- NickKostovny/marketing-playbookstheir own version, first seen Nov 8, 2026
- danielvm-git/bigpowerstheir own version, first seen Nov 6, 2026
- Data-Wise/crafttheir own version, first seen Oct 31, 2026
- itsmuskanagarwal/claude-packtheir own version, first seen Oct 11, 2026
- camunda/camundatheir own version, first seen Oct 8, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- camunda/camunda★ 4.4ksame name
- danielvm-git/bigpowers★ 288same name
- Data-Wise/craft★ 4same name
- itsmuskanagarwal/claude-pack★ 0same name
- NickKostovny/marketing-playbooks★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository38 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adversarial-claims-reviewerSkill
- autoresearchSkill
- browser-testing-with-devtoolsSkill
- codebase-cost-estimatorSkill
- code-review-and-qualitySkill
- content-opsSkill
- content-pipelineSkill
- conversion-opsSkill
- data-model-documentationSkill
- data-model-verificationSkill
- deployment-pipelinesSkill
- findings-ledgerSkill
- game-balancerSkill
- game-systems-designerSkill
- godot-engineerSkill
- growth-engineSkill
- iap-managerSkill
- library-investigatorSkill
- marketing-shaperSkill
- memory-extractionSkill
- outbound-engineSkill
- phaser-engineerSkill
- planning-and-task-breakdownSkill
- prompt-shaperSkill
- release-managerSkill
- revenue-intelligenceSkill
- rust-engineerSkill
- security-engineeringSkill
- securitySkill
- seo-opsSkill
- skill-library-reviewSkill
- telemetrySkill
- typescript-analyticsSkill
- typescript-data-engineeringSkill
- typescript-testing-backendSkill
- typescript-testing-frontendSkill
- web3-smart-contract-engineeringSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 59
Orchestrator mode: run init-orchestrator at session start so dispatch constraints re-inject every turn.
- Very specific: line 61
Keep entries terse. For infra, lead with the service name as the first word — e.g.
- Very specific: line 76
Keep entries terse — Constraints, Decisions, and Open threads are re-injected every turn, so bloat re-creates the token tax.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session State
SESSION-STATE.md (project root, gitignored; schema in this skill's assets/SESSION-STATE.template.md) is the harness's live external memory — NORTH_STAR Lever 3. A model's context compresses over a long session and settled facts drift; this file is the durable copy, re-surfaced by hooks:
- SessionStart injects the whole file (Claude and Codex).
- UserPromptSubmit injects a compact digest — Constraints + Decisions + Open threads — each Claude turn.
- PreCompact checkpoints before context is compressed (Claude and Codex).
How to record (never hand-edit)
Writing via a script — not by editing the file from memory — is the point: it captures the fact even when attention is full. Resolve the writer project-first, then global install fallbacks (path layout):
PROJ="${CLAUDE_PROJECT_DIR:-.}"
# 1. Repo checkout (source of truth)
SS="$PROJ/.claude/skills/session-state/scripts/session-state.sh"
# 2. Project Codex install
[ -f "$SS" ] || SS="$PROJ/.agents/skills/session-state/scripts/session-state.sh"
# 3. Global Claude Code install
[ -f "$SS" ] || SS="$HOME/.claude/skills/session-state/scripts/session-state.sh"
# 4. Global Codex install
[ -f "$SS" ] || SS="$HOME/.agents/skills/session-state/scripts/session-state.sh"| Type | Use for | Re-injected each turn? |
constraint | hard rules in force (e.g. "Rust only, no Python") | yes |
decision | settled choices, date-stamped (so they're not re-litigated) | yes |
infra | survey-before-act findings — what already exists, to reuse (writer emits [surveyed:name] from first token) | no |
thread | in-flight items / next steps | yes |
Claude Code — /state slash command
In Claude Code, use the /state command (.claude/commands/state.md), which invokes the writer above:
bash "$SS" init
bash "$SS" init-orchestrator # init + default orchestrator constraints (idempotent)
bash "$SS" show
bash "$SS" constraint "<entry text>"
bash "$SS" decision "<entry text>"
bash "$SS" infra "<entry text>"
bash "$SS" thread "<entry text>"Valid types: constraint, decision, infra, thread, init, init-orchestrator, show. If the type is empty or invalid, list the valid types — do not guess. init, init-orchestrator, and show take no text; the four entry types take the text as one quoted argument.
Codex
Ask Codex to use session-state, for example: “Use session-state to record this decision: …”. The skill runs the same writer commands; no Claude slash command is installed. Codex re-injects the full state at session start and after compaction. Use Codex's native memory feature for cross-session personal memory.
Orchestrator mode: run init-orchestrator at session start so dispatch constraints re-inject every turn.
Keep entries terse. For infra, lead with the service name as the first word — e.g. "rabbitmq broker on :5552 (docker-compose) — reuse" — the writer stores [surveyed:rabbitmq] … so survey guards suppress only when a command names that exact surveyed subject.
When to reach for it (proactively)
- You just established a hard constraint, or the user gave one → record a
constraint. - You made or were given a settled decision → record a
decision. - You surveyed and found existing infrastructure (a running service, an existing config) → record
infra, so a later step reuses it instead of rebuilding. - You are leaving a thread unfinished → record a
thread.
Activation (on by default)
The writer works as soon as the skill is installed. Supported hooks are registered by install.sh; Codex asks you to review and trust them with /hooks before they run. Hook JSON examples and security notes: references/hook-setup.md.
Discipline
Keep entries terse — Constraints, Decisions, and Open threads are re-injected every turn, so bloat re-creates the token tax. Prune stale lines. Do not duplicate .claude/memory/ (cross-session) or facts derivable from the repo.
Known limitations
- Existing-infra is SessionStart-only. Survey findings (
infra) are not in the per-turn digest — only Constraints, Decisions, and Open threads are. After mid-session compaction, infra coverage still depends on SessionStart injection (or recording a load-bearing finding as aconstraint). The survey-before-act guard covers provisioning commands only. - Token-cost tradeoff. Adding Decisions to the digest (#158) improves post-compaction decision coverage at the cost of a slightly larger always-on per-turn injection. Keep decision bullets terse; prune stale ones.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

