dev-span / rules
Cursor rule1 starsChanged 2 months agoMITView on GitHub
How to distill a long work session into DevSpan so a fresh session can resume cleanly. Invoke when the user asks to distill/hand off/checkpoint the session, when context is getting bloated and work is unfinished, or before deliberately starting a new session on the same task.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,263 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/devspan-router.mdcCursor rule
The file
We split this session-distill.mdc into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
When a work session runs long or context gets bloated mid-task, compress it into DevSpan so the next session resumes without re-deriving …
- Very specific: line 15
If no task: entity exists yet, create one (create_task) before capturing.
- Distinctive: line 26
If a fact fails the durable test (e.g.
- Very specific: line 31
Before writing "done"/"fixed"/"passing", verify against ground truth — git log, the test run, the Jira ticket — and cite file:line, commit …
- Very specific: line 70
Add cross-links ([[task:...]], link_task) to related work.
- Very specific: line 74
Start cold with get_task_pack(task_slug="<slug>").
≈ “Common” is an estimate: at least 1 in 5 of the 7,111 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: How to distill a long work session into DevSpan so a fresh session can resume cleanly. Invoke when the user asks to distill/hand off/checkpoint the session, when context is getting bloated and work is unfinished, or before deliberately starting a new session on the same task. globs: alwaysApply: false --- # Session distiller When a work session runs long or context gets bloated mid-task, compress it into DevSpan 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 cite `file: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: ```markdown **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>` ``` ## 5. Append the durable distillation (never overwrite) - Decision trail / rationale → `append_context(ref="task:<slug>/journal", content=...)`, prefixed with the date. This is the "how decisions were met" record. - Gotchas, workaround-vs-shipped splits → the appropriate durable subtopic (`task:<slug>/notes`, `task:<slug>/implementation-notes`, or the relevant repo/component). - Add cross-links (`[[task:...]]`, `link_task`) to related work. - Omit session chatter and dead-ends here — those live in the seed only. ## 6. Resuming a fresh session Start cold with `get_task_pack(task_slug="<slug>")`. Read `session-state` first, verify it against the repo/Jira, then continue from **Next step**. The `journal` gives the rationale if a past decision is unclear. ## Current limitation `session-state` is meant to be transient but currently lands in the searchable corpus like any subtopic, so it can show up in FTS and inflate packs. Until exclusion is wired into pack assembly, keep it short and overwrite-only. Do not put durable facts there — they would be lost on the next overwrite.
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.

