Use Canvas for Code: Edit in Place, Run in Your Editor
What it is
Why it works
Iterating on code in chat produces a graveyard of near-identical blocks where it's easy to grab the wrong version. Canvas holds one evolving file, so changes are targeted and the 'current' state is unambiguous. It's not a runtime — you still run the code in your own environment — but it fixes the version-tracking mess.
When to use it
Iterating on a single file — a component, a script, a module — across several rounds of changes where you keep refining the same code.
When not to use it
Multi-file changes or anything needing to actually execute against your dependencies — Canvas doesn't run your project, so real testing happens in your editor.
Prompt
Put <this file> in Canvas. We'll iterate on it there — make targeted edits as I ask, keep it as one file, and I'll run it in my editor between changes. Start by <first change>.Example
Refining a data-parsing script over six edits in Canvas leaves you with one clean file to copy out, instead of scrolling back through six chat blocks to find the latest.
Common mistakes
- Treating Canvas as a runtime and assuming the code was executed.
- Bouncing between chat blocks and Canvas so the source of truth blurs.
- Doing multi-file work in a single Canvas and losing the structure.