Skip to content

Instantly share code, notes, and snippets.

@aeschylus
Created February 21, 2026 20:50
Show Gist options
  • Select an option

  • Save aeschylus/2317a4859da684fcd97bd95657480ec9 to your computer and use it in GitHub Desktop.

Select an option

Save aeschylus/2317a4859da684fcd97bd95657480ec9 to your computer and use it in GitHub Desktop.
Lobster Lifecycle State Machine (high contrast SVG)
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1020 580" width="1020" height="580">
<defs>
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto" markerUnits="strokeWidth">
<polygon points="0 0, 10 3.5, 0 7" fill="#000"/>
</marker>
<marker id="arrowhead-dash" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto" markerUnits="strokeWidth">
<polygon points="0 0, 10 3.5, 0 7" fill="#666"/>
</marker>
</defs>
<!-- White background -->
<rect width="1020" height="580" fill="#ffffff"/>
<!-- Title -->
<text x="510" y="42" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="22" font-weight="bold" fill="#111">Lobster Lifecycle State Machine</text>
<text x="510" y="66" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="13" fill="#444">Ideal design: health checks, hibernation, dispatcher pattern</text>
<!-- ════════════════ STATES ════════════════ -->
<!-- STOPPED -->
<rect x="55" y="195" width="140" height="54" rx="8" fill="#404040" stroke="#000" stroke-width="2"/>
<text x="125" y="226" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="15" font-weight="bold" fill="#fff">STOPPED</text>
<!-- STARTING -->
<rect x="280" y="195" width="140" height="54" rx="8" fill="#404040" stroke="#000" stroke-width="2"/>
<text x="350" y="226" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="15" font-weight="bold" fill="#fff">STARTING</text>
<!-- WAITING — primary state, thicker border -->
<rect x="500" y="188" width="164" height="68" rx="10" fill="#333333" stroke="#000" stroke-width="3.5"/>
<text x="582" y="226" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="17" font-weight="bold" fill="#fff">WAITING</text>
<!-- PROCESSING -->
<rect x="745" y="195" width="160" height="54" rx="8" fill="#404040" stroke="#000" stroke-width="2"/>
<text x="825" y="226" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="15" font-weight="bold" fill="#fff">PROCESSING</text>
<!-- DELEGATING -->
<rect x="745" y="400" width="160" height="54" rx="8" fill="#404040" stroke="#000" stroke-width="2"/>
<text x="825" y="431" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="15" font-weight="bold" fill="#fff">DELEGATING</text>
<!-- HIBERNATING -->
<rect x="280" y="400" width="160" height="54" rx="8" fill="#404040" stroke="#000" stroke-width="2"/>
<text x="360" y="431" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="15" font-weight="bold" fill="#fff">HIBERNATING</text>
<!-- ════════════════ TRANSITIONS ════════════════ -->
<!-- Initial state black dot → STOPPED -->
<circle cx="24" cy="222" r="9" fill="#000"/>
<line x1="33" y1="222" x2="53" y2="222" stroke="#000" stroke-width="2" marker-end="url(#arrowhead)"/>
<!-- STOPPED → STARTING -->
<line x1="195" y1="222" x2="278" y2="222" stroke="#000" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="237" y="212" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">start / health-check</text>
<!-- STARTING → WAITING -->
<line x1="420" y1="222" x2="498" y2="222" stroke="#000" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="459" y="212" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">claude ready</text>
<!-- WAITING → PROCESSING (upper path) -->
<line x1="664" y1="208" x2="743" y2="208" stroke="#000" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="703" y="199" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">message arrives</text>
<!-- PROCESSING → WAITING (lower path) -->
<line x1="745" y1="236" x2="666" y2="236" stroke="#000" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="703" y="254" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">batch complete</text>
<!-- PROCESSING → DELEGATING (down) -->
<line x1="825" y1="249" x2="825" y2="398" stroke="#000" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="860" y="330" text-anchor="start" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">substantial task</text>
<!-- DELEGATING → WAITING (curve up-left) -->
<path d="M 745 420 C 660 415, 610 360, 582 258" stroke="#000" stroke-width="2" fill="none" marker-end="url(#arrowhead)"/>
<text x="640" y="365" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">agent spawned</text>
<!-- WAITING → HIBERNATING (curve down-left) -->
<path d="M 520 256 C 505 330, 465 390, 442 418" stroke="#000" stroke-width="2" fill="none" marker-end="url(#arrowhead)"/>
<text x="455" y="325" text-anchor="start" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">timeout /</text>
<text x="455" y="339" text-anchor="start" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">context full</text>
<!-- HIBERNATING → STARTING (up) -->
<line x1="350" y1="400" x2="350" y2="251" stroke="#000" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="320" y="330" text-anchor="end" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">wake trigger</text>
<!-- Self-check loop on WAITING -->
<path d="M 560 188 C 555 130, 605 130, 600 188" stroke="#000" stroke-width="2" fill="none" marker-end="url(#arrowhead)"/>
<text x="580" y="125" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="11" fill="#000">self-check (3 min)</text>
<!-- CRASH annotation — dashed arrow into STOPPED from below -->
<line x1="125" y1="300" x2="125" y2="251" stroke="#666" stroke-width="1.5" stroke-dasharray="6,3" marker-end="url(#arrowhead-dash)"/>
<text x="125" y="318" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="11" font-style="italic" fill="#666">crash / kill</text>
<text x="125" y="333" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="9" font-style="italic" fill="#888">(from any state)</text>
<!-- ════════════════ LEGEND ════════════════ -->
<rect x="55" y="490" width="910" height="60" rx="6" fill="#f7f7f7" stroke="#ccc" stroke-width="1"/>
<text x="510" y="512" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="12" fill="#333">
Bold border = primary state • WAITING = wait_for_messages() • Health-check only restarts from STOPPED (not HIBERNATING)
</text>
<text x="510" y="532" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="12" fill="#333">
HIBERNATING writes state to disk for clean resume • Self-check runs every 3 min while WAITING • DELEGATING spawns background subagents
</text>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment