oneshotlm
Compare all models on this prompt →

Reaction-diffusion · claude-sonnet-5.5

Output generated Cost / run $0.0788 Runtime 44.7s

Prompt for this run

Run a Gray-Scott reaction-diffusion simulation on a canvas that grows organic Turing patterns in real time, with the mouse seeding new growth.

⛨ sandboxed Open in new tab ↗

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelclaude-sonnet-5.5
vendorAnthropic · Claude
harnesspi 0.87.1 · browser iteration
generated2026-10-05

METRICS

runtime44.7s
tokens in39k
tokens out4.0k
cached24k
cost / run$0.0788
Transcript · 15 messages
system

user

Run a Gray-Scott reaction-diffusion simulation on a canvas that grows organic Turing patterns in real time, with the mouse seeding new growth.

assistant
→ write /tmp/job-YNeu3T/index.html (3622 bytes)
toolResult

Successfully wrote to /tmp/job-YNeu3T/index.html

assistant
thinking
My diffusion coefficient math simplifies down to Du≈0.2097 and Dv≈0.105 with dt=1, so those values should work fine. I'll test with that.
→ browser {"action":"drag","x":500,"y":300,"toX":800,"toY":500}
→ browser {"action":"screenshot"}
toolResult

Frame 1, +1ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"Gray-Scott – drag to seed\n\nCoral\nMitosis\nFingerprint\nSpots\nWaves\nMaze\nWorms\nResetPause\nfeed 0.0545\n\nkill 0.0620\n\nbrush ","images":"attached"}

toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"Gray-Scott – drag to seed\n\nCoral\nMitosis\nFingerprint\nSpots\nWaves\nMaze\nWorms\nResetPause\nfeed 0.0545\n\nkill 0.0620\n\nbrush ","images":"attached"}

assistant
thinking
The diffusion math checks out stable, and the coral parameters with standard feed/kill rates seem correct — the hollow rings I'm seeing are just from spots hollowing out, which is fine even if it's less classic Turing-pattern-like.

I think I should bump up the seed count, maybe to 40, so patterns emerge more densely across the field. Actually, I'll switch the default preset to "Maze" with feed .029 and kill .057, since that reliably produces labyrinth patterns which look better as a default than the sparser coral result.
→ bash {"command":"cd /tmp/job-YNeu3T && sed -i 's/i<8;i++)seed/i<40;i++)seed/;s/setFK(.0545,.062);reset/setFK(.029,.057);pre.value=\"Maze\";reset/
→ browser {"action":"reload"}
toolResult

1

toolResult

Frame 1, +1ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"Gray-Scott – drag to seed\n\nCoral\nMitosis\nFingerprint\nSpots\nWaves\nMaze\nWorms\nResetPause\nfeed 0.0290\n\nkill 0.0570\n\nbrush ","images":"attached"}

assistant
thinking
I'm double-checking my diffusion coefficient calculation against the stability limit for the 4-neighbor Laplacian, confirming Du stays within bounds, and wondering if the ring artifacts stem from something else, like the hole regions.

The standard F=.0545, K=.062 parameters with Du=.2097, Dv=.105 should be sound; the rings are likely just a dynamics issue from the initial seed overshoot rather than a diffusion error. I'll let the maze params (f=.029, k=.057) run with more steps—boosting to 20—and check a screenshot afterward to see how it evolves.
→ bash {"command":"cd /tmp/job-YNeu3T && sed -i 's/i<12;i++)step/i<20;i++)step/' index.html"}
→ browser {"action":"reload"}
→ browser {"action":"screenshot"}
toolResult

(no output)

toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"Gray-Scott – drag to seed\n\nCoral\nMitosis\nFingerprint\nSpots\nWaves\nMaze\nWorms\nResetPause\nfeed 0.0290\n\nkill 0.0570\n\nbrush ","images":"attached"}

toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"Gray-Scott – drag to seed\n\nCoral\nMitosis\nFingerprint\nSpots\nWaves\nMaze\nWorms\nResetPause\nfeed 0.0290\n\nkill 0.0570\n\nbrush ","images":"attached"}

assistant

I built the Gray-Scott simulation in `/tmp/job-YNeu3T/index.html`. It runs and grows patterns in real time. In the browser it ran with no errors. The one console message was a sandbox iframe warning from the test harness. My first drag test shows mouse seeding works. Dragging across the canvas left a trail that grew into a ring-like band. I tested the last two changes (more starting seeds and faster stepping) with reload and screenshots only. After those changes I did not retest dragging, the preset menu, the sliders or Pause. The page starts on the "Maze" preset with 40 random seeds. In the final screenshots the patterns are rounded rings and blobs that are still splitting and merging. They had not yet formed a labyrinth, so I can't say whether this preset ends in a maze. - **Seeding:** click and drag on the canvas to add new growth. - **Presets:** a dropdown with Coral, Mitosis, Fingerprint, Spots, Waves, Maze and Worms. - **Parameters:** sliders for feed rate, kill rate and brush size. - **Buttons:** Reset and Pause. The simulation uses a 256×256 grid with wrap-around edges, run 20 steps per frame. The canvas is drawn square and centred, so the sides of a wide window stay dark.