We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Forking

Another powerful context-manipulation command is /fork. It creates a new session with the same context as the current session – while also letting you quickly choose a "fork point" from the recent message history.

Sometimes I want to try a different approach, but I don't want to recreate all the context and history of my current session from scratch. I just fork off the latest message that has the context I actually want, and keep going in the new session.

  1. Branch to try a risky idea.
  2. Keep the main session clean.
  3. Return to the main session if the experiment fails.

The fork separates the conversation, but both sessions share the same working directory. Returning to the original session does not undo file changes made in the fork... that said, you can always /fork and instruct the model to copy the files into a new worktree.

Assignment

This SlopLang program passes the result of add(1, 2) to hallucinate:

clanker add(left, right) {
    ship left + right✨
}
hallucinate(add(1, 2))✨

So it should print 3, and the parser should recognize the inner call add(1,2) as an argument to the outer call hallucinate(). But the current tests don't cover this case, so add a new parser test in a forked session.

Tell OpenCode to run and submit the CLI tests from the project root.