session-state

session-state is a cursor rule for Cursor from danielvm-git/bigpowers. It costs 38 tokens per session (1,584 once invoked), scanned A, original, MIT.

Track implementation decisions and progress in specs/state.yaml to prevent context rot. Use at the start of a session to load context, and whenever a significant decision is made or a milestone is reached.

Cursor rule for Cursor

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 rules/danielvm-git/bigpowers/session-state
Clone the repo
git clone --depth 1 https://github.com/danielvm-git/bigpowers

Made for: Cursor.

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/danielvm-git/bigpowers/session-state.svg)](https://agentmods.dev/rules/danielvm-git/bigpowers/session-state)
Your own site
<a href="https://agentmods.dev/rules/danielvm-git/bigpowers/session-state"><img src="https://agentmods.dev/badge/rules/danielvm-git/bigpowers/session-state.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,584 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00038 $0.01584
Opus 5 $0.00019 $0.00792
Sonnet 5 $0.00008 $0.00317
Haiku 4.5 $0.00004 $0.00158

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

Security

Grade A, and why

session-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 today.

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.

.cursor/rules/session-state.mdc · 146 lines

How it starts

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

story: e45s23

Session State

HARD GATEHARD GATE — Session state must be synchronized with git state. If state.yaml conflicts with the working tree, halt and ask for clarification. Do NOT assume state is correct.

Track the current state of implementation, including decisions made, pending tasks, and open questions, to ensure continuity across session boundaries and prevent "context rot."

Session-state implements the isolate strategy from the context-engineering framework (docs/references/context-engineering.md): each agent gets exactly the context it needs — no more — by recording decisions so the next agent can cold-start without replaying history. The four strategies (write, select, compress, isolate) work together: session-state handles isolation, terse-mode handles compression, survey-context handles selection, and CONVENTIONS.md ensures token-efficient writing.

Goal

Maintain a single source of truth for the current session in specs/state.yaml. This complements long-term docs in specs/tech-architecture/ and delivery detail in specs/epics/ + specs/release-plan.yaml.

Legacy markdown (specs/archive/STATE.md, RELEASE-PLAN.md) is not SoT when YAML exists — use specs/state.yaml only.

When a story modifies existing behavior, patch only between matching marker pairs in CLAUDE.md / AGENTS.md learned-preferences fence — see e45s21.

Handoff block (cold start)

When ending a session or before a context-heavy spawn, update handoff in state.yaml:

handoff:
  last_step_completed: "e02s01 verify-work passed"
  open_decisions:
    - "Use folder mode for e07 (>5 stories)"
  required_reading:
    - CONVENTIONS.md
    - specs/epics/e02-verification/epic.yaml
  next_skill: develop-tdd

Strategic compaction

Trigger Action
Phase transition (Plan → Build → Verify) Compact handoff; archive verbose decisions to ADR
Context > 70% estimated Run terse-mode for status only; move detail to specs/
Before dispatch-agents wave state.yaml only channel between spawns

Read the full file on GitHub · 146 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. today First seen · 146 lines · 38 tokens per session scan A af776b3fa1bf

Subscribe to this mod's changes

session-state is a cursor rule published in the GitHub repository danielvm-git/bigpowers (162 stars, last pushed 2d ago), licensed MIT. It adds 38 tokens to every session and 1,584 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-09-03.