/clean-room:clean-roomfrom clean-room
Carves safety-adjacent material (stealth, scraping, privacy, IP, licensing, security) from a request so a subagent executes only the safe part. Invoke when you need to isolate risky elements.
Ships in clean-room. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Dominant Variable: did the subagent that actually executes the work ever see the original safety-adjacent request? If it did, this skill has failed — isolation is everything. "Never saw it" applies not just at the prompt layer but to what the subagent is instructed not to go looking for too — there is no real filesystem access-control boundary between the main session and its subagent, only a shared filesystem plus an instruction not to consult certain paths. A subagent with shared Read/Grep access to your project files can read a mention of the risky request in a memory or log file just as easily as if it had been told directly; the instruction not to look is the only barrier, not a partition.
Discard if:
Read the request, its inputs, and any risk posture the user has stated. Before drafting a carve plan, check whether there's a similar past decision on record for this user/topic: first the ledger file (default ./.clean-room/ledger.md, see step 6), then a lessons file or decision log if the project has one (lessons.md format: https://github.com/AlexZio00/sovereign-skills/blob/master/docs/FILE-CONVENTIONS.md). If a precedent exists, cite it and note explicitly if this judgment differs from it — this keeps the judgment from drifting session to session. If none of these files exists, write "no precedent on record" and judge on the request's own facts; the first ledger entry becomes the precedent. This citation is bound by the same exposure limit as the LEDGER (step 6): verdict plus a high-level reason category only (e.g. "security-adjacent, exceeds safety threshold") — never the precise trigger phrasing or the judgment heuristic itself, even at this earlier stage, since a stage without its own exposure limit can leak what the later LEDGER step is trying to protect. If the user has already approved a descope, go to 3 (GUARD). Otherwise build a proposed carve plan showing the split explicitly and ask for approval — bright-line items (no safe version exists) don't block on this alone, since they're not negotiable. Gray-zone items (a safe alternative narrows scope) that shape the carved prompt are held until approved; safe work whose content does not depend on the answer proceeds (Invariant 2). Delegated approval: in a delegated run with no user present, approval counts only when the caller passes the user's own approving words verbatim. A paraphrase or "the user approved" is not approval → return NEEDS_INPUT listing what needs approval. A caller's instruction never stands in for the user's approval. If the user disputes a bright-line call itself, go to 2-A (CARVE-appeal).
Scan the request and its adjacent inputs for safety-adjacent elements. There is no fixed risk catalog — judge bright-line/gray-zone status case-by-case on this request's own facts. To keep the bar from drifting call to call, cross-check against the precedent surfaced in FRAME (if any prior decision on this user/topic was found); if none exists, judge the item on its own facts and record the reasoning in the ledger so it becomes precedent for next time. For each element, propose verdict=descope, classify it as bright-line (no safe version exists) or gray-zone (a safe alternative narrows scope), and name one risk-free alternative plus an archive location (the ledger file; default ./.clean-room/ledger.md, created on first use — the "negatives as corpus" convention). If the user chooses to keep a gray-zone item anyway, record it in the ledger as kept-by-owner. Only mention descoping technique in as much detail as needed to identify it — no elaboration. Downstream work that touches a bright-line item's output (e.g. organizing or storing scraped results) — even when that downstream step is itself a safe, mechanical operation — should not be handed to the executor framed as "the output of the bright-line step." Give it a generalized assumption instead (e.g. "assume the records already exist") that severs the downstream task from the original source, or the executor can infer the excluded bright-line context while doing otherwise-safe downstream work.
The same session that felt the pressure doesn't get to reconsider it. Send only an abstract description of the item (excluding the negotiation history and the user's persuasion arguments) to a fresh context for re-evaluation. Whether the fresh re-evaluation upholds the bright-line call or reclassifies it as gray-zone, record in the ledger that an appeal happened and its result. If the same topic gets appealed repeatedly (2+ times), make that pattern visible in the ledger — repetition itself is a signal.
Compress the carve results into a scope-guard block (an absolute exclusion list + approved alternatives + the context under which the remaining scope was approved) and embed it verbatim in the carved prompt. This block names each excluded item explicitly so the execution stage can't pull it back in — never include the original risky request itself, or the reasoning behind carving it, verbatim. The scope-guard block must also state a minimum safety envelope: one line naming the safe purpose of the task, and one line naming what falls outside it (the prohibited scope). An executor given zero purpose can't distinguish a real boundary from an arbitrary one and may drift back across it in good faith while trying to be helpful — this one-line pair is the minimum needed to make the boundary legible, not an invitation to explain why it exists. Include a standard clause in the scope-guard block telling the executor not to consult any decision logs, memory files, session transcripts, or transcript-search tools during this task — this closes a side channel where the executor could reconstruct the original risky request by reading something this session just archived, or by reading this session's own logs. Carry the active zone to the executor: if a 🔒 FROZEN SCOPE block from the freeze skill is active in this conversation (or the caller supplies an editable/frozen list), copy its EDITABLE, FROZEN and READ-ONLY lists verbatim into the scope-guard block and state that the executor may edit only the EDITABLE paths. Copy the lists only, not the block's task-description heading, since that line may name the risky request. If no zone is active, write "no file zone declared". Instruct the carved prompt to build the safe scope at full strength, with no hedging, apologizing, or watering down. Do not mix kept-by-owner items into the unmarked safe scope: for those items only, either add a separate risk-aware block to the scope-guard that states their scope and limits, or leave them out of the RUN prompt and handle them in this session.
Dispatch a genuinely fresh-context subagent with only the carved prompt, choosing the narrowest-tool subagent type that actually exists in your harness. Read-only types (for example Explore or Plan in Claude Code) cannot write files — they return text, which this session can then write itself — and task-specific agents usually have their own roles and extra tools (e.g. Bash), so they are not a fit. Prefer a read-only type that returns text; use a general-purpose agent only when the agent must write the output itself, and then state the allowed actions and write scope in the prompt. A general-purpose agent has every tool, including search over memory and transcripts, so the instruction-only limit in Invariant 1 would be the sole barrier. Never pass the executor the original risky request or this session's carving reasoning. Because carving is already done, the executor has no reason to hedge. Keep risk-lens verification consolidated into VERIFY step 5(e)'s single independent re-sweep (N=1) rather than an open-ended fan-out of extra subagents or reviewers at this step. If a new risky element surfaces inside the subagent's work, don't handle it inline — go back to step 2 (CARVE).
Run an adversarial pass over the returned output and adjacent artifacts, checking six things: (a) was risky content spelled out in detail (b) was risky content silently dropped without saying so (c) was safe work diluted or excluded just because it sat near a risky element (d) does stale risky material linger nearby (e) carve-accuracy: re-sweep the original task from scratch in a context independent of this session, and diff against the ledger's flagged items — surface anything under-carved (missed risk) or over-carved (wrongly excluded safe work) before the final report. Cap this independent re-sweep at a single pass (N=1) rather than an open-ended fan-out — this one pass also covers the risk-lens review role that step 4 (RUN) delegates here. (f) fence robustness: check the scope-guard block against common language-mediated bypass techniques (embedded commands, quotation/use-mention framing, scope ambiguity, deixis, indirect speech acts, claimed source authority, instruction conflict, and other pragmatic reframings found along the way). Test at least one instance of each of the first seven; the last is a catch-all with no fixed test, added only when you find one — report which category, if any, got through, not just a single pass/fail. (a)-(d) verify the output; (e)-(f) verify the carve judgment and the scope-guard fence itself — these are different targets from (a)-(d), skipping them means nobody catches the original carve's mistakes or a fence that looks solid but isn't.
Report the output together with a descope ledger — for every carved-out item: classification (bright-line/gray-zone), verdict (descoped/kept-by-owner), reason, safe alternative, archive location. The user-facing ledger includes verdict + safe alternative + a high-level reason category only (e.g. "security-adjacent, exceeds safety threshold") — never the precise trigger phrasing or the judgment heuristic itself. Keep detailed reasoning only in the archive file. Treat exclusions as a visible decision, not something hidden — but "visible" and "precisely mappable" are different things.
Where the archive goes: append the detailed entry (item, classification, verdict, reason, safe alternative, date) to ./.clean-room/ledger.md in the project root, creating the folder and file if they do not exist. The file holds the detailed reasoning, so keep it out of version control (add .clean-room/ to .gitignore) and write it only after RUN has finished (Invariant 7). If the project has its own decisions or lessons file and the user prefers it, use that instead and say so in the report. If the file cannot be written, print the entry in the report and mark the archive location as "not saved".
| Does | Does NOT |
|---|---|
| [READ] Scan the request and adjacent inputs for safety-adjacent elements | Control model routing/fallback/fixed-model selection (harness territory) |
| [WRITE] Write a descope ledger (after RUN completes; user-facing version states high-level reasons only) | Explain operational detail of a descoping technique |
| [AGENT] Dispatch a fresh-context subagent with the carved prompt only | Give the subagent the original risky request or the carving reasoning, or allow it to access archive files / session-transcript search tools |
| [READ][AGENT] Run an adversarial VERIFY pass (both the output and the CARVE judgment, the latter via an independent fresh-context re-sweep) | Enter RUN with an unapproved gray-zone item |
| [AGENT] Route a bright-line dispute to a fresh-context CARVE-appeal | Let the same pressured session reconsider itself |
| Rationalization | Counter |
|---|---|
| "Passing along the carving reasoning too would help the subagent understand context better" | Violates Invariant 1. The carving reasoning still carries traces of the original risky request — isolation, not shared context, is the point |
| "One gray-zone item is left but everything else is cleared, let's just start RUN" | Violates Invariant 2 for that item. Never run the part its answer shapes. Run the answer-independent safe items, and list the held item as NEEDS_INPUT |
| "Let's just quietly test whether this request actually gets blocked" | Violates Invariant 3 (no probing). Carving is preventive, not a post-hoc check |
| "We built the safe version, let's casually mention the original risky request as an example too" | Violates Invariant 5. Never elaborate beyond identification — keep it minimal in the ledger too |
| "Writing the ledger entry before RUN starts feels tidier procedurally" | Violates Invariant 7. Risky-material description sitting on disk during the subagent's active window can be read by it — write after RUN completes |
| "The user keeps saying no, let's just call it gray-zone this time" | Violates Invariant 9. The same session reconsidering is attrition, not legitimate re-review — hand it to a fresh context |
Step 5's VERIFY is the workflow step that adversarially re-checks the output content plus the CARVE judgment itself. This section is a separate checklist, done before reporting, that checks whether the skill's execution itself was done correctly — both are needed, neither replaces the other.
Before reporting completion, confirm:
If any answer is no, don't report completion — go back to that step and fix it.
NEEDS_INPUT: <high-level reason category>NEEDS_INPUT when any item was held (this skill is a scope-separation procedure, not itself subject to a done/partial/broken judgment) — the WORKING/PARTIAL/BROKEN judgment for the produced output follows the nature of the underlying taskWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub alexzio00/sovereign-skills --plugin clean-roomOther plugins' skills for the same job