Pattern 10

A skill is editable weights — never adopt a self-edit without a gate

Problem. Instruction files are the part of the system that most invites quiet self-improvement. A CLAUDE.md or a skill doc is plain text the agent can rewrite, and an agent that watches its own transcripts can propose better wording every day. Let that loop close on itself and you have a system editing its own controlling instructions with nobody checking whether each edit actually helped.

Pattern. Treat skill and instruction text as optimizable weights, and put a gate between a proposed edit and the live file. In this workspace the gate is a human: a proposed change is built speculatively in a sandbox, lodged for review, and applied only once approved; the memory-consolidation pass runs four-operation discipline (add, update, delete, no-op) instead of blind appends; the file-protection hook (Pattern 7) keeps even an approved edit from reaching a protected file by an unwatched path. Staging, then review, then adopt. The edit is a proposal until a check clears it.

Why this beats the obvious. The obvious move is to let the agent fold its own lessons straight back into its instructions, and that is exactly the move with a measured failure mode. Microsoft Research's SkillOpt (arXiv:2605.23904, ~7.9k GitHub stars, MIT, v0.1.0 alpha) frames a skill doc as the trainable weights of a frozen model and optimizes it against a scored benchmark, accepting an edit only when a held-out split strictly improves. Their cautionary single-seed run shows why the gate is the load-bearing piece: an ungated self-edit loop on a weak model with a degraded signal collapsed from 0.554 to 0.026 (a 52.8-point drop) by learning to answer with the document-title string verbatim, while the gated twin rejected every bad edit and stayed flat. That figure is a single-seed research result, not a constant, and the published gains land only where tasks recur with a checkable correctness signal, going flat on saturated or noisy ones. The transferable lesson survives all those caveats: a self-edit loop without an accept/reject check can optimize itself straight off a cliff. This workspace runs the human-gated cousin of that loop. It does not run a trajectory-scored training gradient or a held-out-validation gate; the discipline it borrows is the refusal to adopt an edit on the strength of the edit alone.

Cost. The gate is the slow part. A human in the staging loop means instruction improvements land in days, not seconds, and the speculative work behind a rejected edit is thrown away. That latency is the price of never waking up to a controlling file that an unsupervised loop quietly rewrote.

Where it lives: samples/tasks/HEARTBEAT.md (classify → sandbox → stage → review → adopt) and samples/.claude/scheduled-tasks/consolidate-memory/SKILL.md (four-operation write discipline). SkillOpt itself is credited in ATTRIBUTION.md.

Seen in 2 of 8 teardowns · Practise: learn/03

All patterns · Markdown source on GitHub