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/srmackey/context-forge/session-distillgit clone --depth 1 https://github.com/srmackey/context-forgeWhat 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.00059 | $0.00891 |
| Opus 5 | $0.00030 | $0.00445 |
| Sonnet 5 | $0.00012 | $0.00178 |
| Haiku 4.5 | $0.00006 | $0.00089 |
Grade A, and why
session-distill 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 yesterday.
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 — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Session distiller
When a work session runs long or context gets bloated mid-task, compress it into ContextForge so the next session resumes without re-deriving anything. This rule tells you how to capture; it does not hold the knowledge.
1. Identify the task
Resolve the task slug (e.g. proj-1234). If unsure, ask or infer from the session.
If no task: entity exists yet, create one (create_task) before capturing.
2. Two outputs, two filters — do not cross-contaminate
The hard rule. Each piece of the session goes to exactly one of:
- Session seed — "what do I need to resume tomorrow without losing momentum?" Transient. Includes things the durable corpus must NOT have (dead-ends, half-formed plans, current hypothesis).
- Durable distillation — "would a cold agent on a future, unrelated task want this?" Permanent. Decisions + rationale, gotchas, cross-links.
If a fact fails the durable test (e.g. a path you tried and ruled out), it belongs in the seed only — never the corpus.
3. Be faithful and verify
- Record only what actually happened this session. Never invent state. Flag uncertainty.
- Before writing "done"/"fixed"/"passing", verify against ground truth —
git log, the test run, the Jira ticket — and citefile:line, commit SHA, or PR. Code and Jira outrank prose; the next session must be able to confirm, not just trust. - The human's decisions and overrides are binding. Record them so the next session does not relitigate settled calls.
4. Write the session seed (overwrite each time)
upsert_context(ref="task:<slug>/session-state", content=...) — overwrite, it's the
current head, not history. Keep it short. Structure:
**Status:** branch `<branch>`, last commit `<sha>`; <one line on overall state>
## Where I am
- Done this session: ...
- Half-done / in progress: ...
## Next step (do this first)
1. <the single most concrete next action>
## Open loops
- Decisions not yet made; things waiting on someone/something.
## Dead-ends (do NOT re-explore)
- <path tried> — ruled out because <why>.
## Working hypothesis
- The mental model you'd lose on restart.
## Verify state yourself
- `git log --oneline -5`
- `<test / build / run command>`
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.
- yesterday First seen · 83 lines · 59 tokens per session scan A 9522de36dc42
session-distill is a cursor rule published in the GitHub repository srmackey/context-forge (1 stars, last pushed 23d ago), licensed MIT. It adds 59 tokens to every session and 891 once invoked, about $0.0003 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-08-31.
Other cursor rules, from other repositories
cursor
You are working on the checkout service. Preserve transaction integrity and auditability.
java-springboot-jpa-cursorrules-prompt-file
description: "Cursor rules for Java development with Springboot and JPA integration." globs: / alwaysApply: false.
002-verify-before-act
Requires Claude to read before writing, verify before installing, and confirm before destructive operations.
swift-development
Swift development: SwiftUI, Combine, async/await, iOS patterns, and Apple platform conventions.
design-patterns
Design patterns (GoF) and file size conventions for sweagent TypeScript codebase.
database
Cursor rule "database" from ItamarZand88/awesome-agent-conventions, covering database best practices, prisma setup, prisma models, prisma queries and supabase setup.