On November 25, 2026, OpenCode announced that it had separated the engine behind its Code Mode into a standalone project called Psychoscript. The JavaScript package embeds in Node or Bun and can pause a running script, save its state as bytes, and pick it up later. The package was already on npm before the announcement; what OpenCode revealed was how it relates to Code Mode and where the team wants to take it next.
Code Mode gives an agent a way to write a small program that calls tools, instead of going back to the model for every step. That helps when the work is predictable: collect ten results, filter them, then summarize the remainder. But as soon as the program needs to wait, you have to decide what state to keep and whether it’s safe to do any part of the job again.
The script remembers where it stopped
A workflow that restarts from the top can avoid repeating earlier tool calls by saving their results and replaying the control flow. Psychoscript takes a different approach. Its virtual machine stores the script’s execution state, so the script can continue from a checkpoint rather than rebuilding that state by rerunning the preceding JavaScript.
In the project’s pause-and-resume example, a short loop saves a snapshot of about 5.4 KB. That figure describes the example, not a general storage budget. Larger working state costs more to keep, and a snapshot can only be resumed using a compatible build and the expected tools. Updating the runtime while jobs are still paused is therefore something an app has to plan for.

The world outside the script keeps moving
Imagine a script has requested a price quote. Repeating the read may be harmless. If it was submitting a purchase instead, the first request might have succeeded before its response arrived. Restoring the script cannot reverse that purchase or tell you on its own whether the original request went through.
The project’s documentation says an in-flight asynchronous call can be retried on resume if the host marks it as safe to repeat. If the call isn’t marked that way, the runtime rejects the attempt to suspend during that call and allows execution to continue. It also documents a separate mechanism for external work that should keep running while the script is paused.
That distinction matters more than whether a demo resumes cleanly. An app still needs to decide which actions require approval, which can be retried, and which need their own record of completion. Otherwise a saved checkpoint risks giving the person using the app a false impression that everything paused together.
The first version has a deliberately small surface
The project site lists Node 24 or later and Bun 1.4 or later. The engine supports a subset of JavaScript. Scripts don’t get built-in filesystem, network or browser access; the app decides which external functions to provide. That makes the boundary easier to see, but the limits of an actual deployment depend on what the app exposes.
OpenCode says a Rust implementation is in development for native apps. That’s a direction, not a shipping mobile feature. The useful change today is narrower: developers outside OpenCode can evaluate the same pause-and-resume approach without adopting the whole coding agent. The part worth testing first is how it handles a slow read and an interrupted write, not how many lines of JavaScript it can run.
P.S. If a workflow can place an order, saving a checkpoint and recording whether the order was placed should be two separate decisions.
Frequently Asked Questions
Q: What did OpenCode announce?
A: It announced that Psychoscript, the engine behind its Code Mode, had been separated into a standalone project. The npm package was already available.
Q: Does Psychoscript run a complete Node.js application?
A: No. It embeds inside Node or Bun and runs a subset of JavaScript. The host app supplies any permitted access to files, the network or other external tools.
Q: What gets saved when a script pauses?
A: The virtual machine saves the script’s execution state. It does not take a snapshot of a browser, a database or the other services the script has called.
Q: Does resuming guarantee an outside action only runs once?
A: No. The app is responsible for protecting actions from duplicate execution. The runtime can retry a call that the app has explicitly marked as safe to repeat.
Q: Has the Rust version shipped?
A: OpenCode said it was in development. The announcement did not give a release date for it.
