oneshotlm
Compare all models on this prompt →

Boids flocking · claude-sonnet-5.5

Output generated Cost / run $0.0418 Runtime 24.8s

Prompt for this run

Create a full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor.

⛨ 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

runtime24.8s
tokens in9.7k
tokens out2.9k
cached4.5k
cost / run$0.0418
Transcript · 6 messages
system

user

Create a full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor.

assistant
→ write /tmp/job-yqRd6m/index.html (3807 bytes)
→ browser {"action":"inspect"}
toolResult

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

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":"Move the mouse to scare the flock · click to add boids","images":"attached"}

assistant

I wrote `index.html` in `/tmp/job-yqRd6m`. I only checked that it loads and renders. I didn't test the mouse-flee or click-to-add behavior. I didn't check whether the flock forms groups over time either. The page loaded with no errors, apart from a sandbox warning that comes from the browser tool's iframe. The screenshot shows about 250 oriented triangles spread across the full screen, with motion trails and a hint line at the top left. - **Flocking:** each boid applies separation, alignment and cohesion to neighbors within 60 px, and separation applies within 24 px. - **Steering:** forces are capped, and each triangle's heading eases toward its direction of travel instead of snapping to it. - **Mouse:** boids within 140 px of the cursor flee and can briefly go about 1.7× faster. A faint red circle shows that radius. - **Edges:** boids are nudged back from the edges and wrap around if they cross one. - **Clicking:** adds 10 boids at the click point.