

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: What Is Context?
incomplete
2: Context As RAM
incomplete
3: New Sessions
incomplete
4: Token Economics
incomplete
5: Ignoring Files
incomplete
6: File Watcher
incomplete
7: Lost in the Middle
incomplete
8: Compaction
incomplete
9: Configure Compaction
incomplete
10: Undo and Redo
incomplete
11: Forking
incomplete
12: Secrets in Context
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
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.
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.
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.