Skill v1.0.0
currentAutomated scan100/100version: "1.0.0" name: constraint-ledger description: Track mid-session constraints and corrections from the user so they never get dropped as context grows. Use whenever the user corrects course, restricts scope, or states a preference mid-task ("just X, nothing else", "keep it simple", "don't touch that", "remove that", "keep it to..."), and re-check the ledger before every deliverable in that session.
constraint-ledger
Born from an audit of ~90 real Claude Code sessions: constraints stated once kept evaporating mid-session. A user said "capture the essence via words, not the image" and had to teach it twice. A scope restriction ("just these two as reference, nothing else") needed explicit re-restriction an hour later. Hard-coded defaults silently overrode the user's own UI settings. A constraint that lives only in chat history dies at the next context compaction or long tool run.
The fix is boring and it works: write constraints to a file, and re-read the file before every deliverable.
Protocol
- Capture on arrival. The moment the user states a constraint, correction, or scope cut, append one line to a session ledger file:
- Path: a
constraints.mdin the session's scratch or working directory - Format:
- [HH:MM] CONSTRAINT: <verbatim or near-verbatim> | applies to: <surface/task> - Include reversals: if a constraint is lifted, mark the line
LIFTEDrather than deleting it. The history of what was constrained and released is itself context.
- Re-read before every deliverable. Before presenting work, deploying, generating, or summarizing: read the ledger and check each ACTIVE line against what you are about to deliver. A violated line means fix first, deliver second.
- Surface violations honestly. If a constraint could not be satisfied, name it explicitly in the reply. Silence is how constraints die.
- Graduate the durable ones. At session end, any constraint that is clearly a standing preference (a style rule, a workflow rule) belongs in persistent memory (CLAUDE.md, a memory file, or your notes system). Session-only constraints stay in the ledger and die with the session. That is correct behavior, not a leak.
Special cases
- User controls are authoritative. If the user sets a control in a UI you built (a toggle, a removed element, a spacing choice), that setting must flow through to the output. A hard-coded default that overrides user state is a constraint violation even though nobody typed a sentence about it.
- Verbatim input stays verbatim. When the user hands you copy or text to be split, formatted, or placed, preserve their exact words. Restructuring is allowed; rewriting is a violation unless they asked for rewriting.
- Sub-agents inherit the ledger. When spawning agents or handing work to another tool mid-session, paste the ACTIVE constraints into their prompt. Agents cannot read your chat history, and a constraint you honor but your sub-agent ignores still ships the violation.
Why a file and not memory
Context windows compact. Long tool outputs push early messages out of the model's working attention. A one-line file read costs almost nothing and survives everything short of deleting the file. The discipline is the re-read step: capturing constraints and never checking them is the same as losing them, just with extra steps.