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.
npx agentmods add rules/danielvm-git/bigpowers/session-stategit clone --depth 1 https://github.com/danielvm-git/bigpowersWrote 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.
[](https://agentmods.dev/rules/danielvm-git/bigpowers/session-state)<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>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.
| Model | Per session | Once 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 |
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.
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 GATE — HARD 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 |
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.
- today First seen · 146 lines · 38 tokens per session scan A af776b3fa1bf
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.
Other cursor rules, from other repositories
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
app-router-patterns
Next.js 14+ App Router patterns — Server Components, Client Components, Route Handlers, Server Actions, and metadata API.
context-os
ContextOS rules for context-os.
database
Database architecture, schema design, Prisma, Drizzle ORM, indexing strategies, migrations, and N+1 query resolution.
vue
Rules for Vue (2 and 3) single-file components.
nextjs
ContextOS rules for nextjs.