← Patterns

Graceful Self-Extension

Core Concept

Systems that grow by encountering what they can’t handle are more adaptive than systems pre-designed for anticipated needs. When a system hits something unknown, it shouldn’t crash or silently fail — it should surface the gap and propose filling it.

Named after Smalltalk’s doesNotUnderstand: mechanism: when an object received a message it couldn’t handle, instead of throwing an error, it received a callback that could intercept the unknown message and handle it dynamically — delegate to another object, log it, or even define the missing method on the fly. The system grew its own capabilities through use.


The Pattern in Practice

Pre-designed systems try to anticipate all needs upfront:

Self-extending systems grow from what they encounter:

The critical mechanism: the system must surface the gap, not hide it. Smalltalk’s doesNotUnderstand: didn’t silently drop the message — it called back with “I don’t know how to handle this; what should we do?” That callback is the growth mechanism.


Where I’ve Seen It


Anti-Pattern: Over-Specification

The opposite of graceful self-extension is over-specification — trying to design all the types, workflows, and conventions before the system has been used. This leads to:

The OS’s CLAUDE.md instruction captures this: “We add structure when we need it, not before.”


The Mechanism

For a system to self-extend gracefully, it needs:

  1. Detection: The system notices when it can’t handle something (Smalltalk: doesNotUnderstand: fires)
  2. Surfacing: The gap is presented to the user/operator, not hidden (the callback)
  3. Proposal: The system suggests how to fill the gap (propose new entity type, new convention, new ritual)
  4. Incorporation: Once approved, the extension becomes a permanent part of the system (new method defined, new convention in CLAUDE.md)
  5. Generalization: The extension handles future similar cases automatically (new entity type handles all instances, not just the first one)


Cross-References