Documentation
How CodeScope AI traces JavaScript execution — the editor, timeline, inspector panels, execution graph, AI explanations, sessions, and more.
Quick start
- 1Open the playground and write a program in the editor, or pick one from the example gallery.
- 2Press Run (or load an example) to execute the code against the interpreter.
- 3Step forward and backward through the immutable snapshot timeline.
- 4Watch variables, heap, call stack, and console update on every step.
- 5Ask the AI to explain any snapshot, or export the workspace as a shareable session.
The editor
Write or paste a program
The editor is a full Monaco instance with JavaScript syntax highlighting. The current execution line is highlighted as you step, and you can click the gutter to toggle breakpoints. Code runs only in the sandboxed interpreter — never through eval or the VM.
Timeline & playback
Immutable snapshots
Every executed statement produces one immutable snapshot: the state after that step. You can scrub anywhere in the trace without re-running, because nothing is mutated — each step is a full, independent view.
Use the playback controls to play, pause, step, or jump. The speed selector controls auto-playback pace, the timeline search jumps to statements containing a query, and the mini-map gives an overview of the whole run. Diffing marks exactly what changed between consecutive steps.
Inspector panels
Variables
Every binding in scope, with values formatted to their runtime type. Changed bindings are highlighted on the step that modified them; newly added ones are marked too.
Heap
Objects and arrays live here so reference semantics and aliasing become visible. New allocations and mutations are flagged on the relevant step.
Call stack
Frames push as functions are called and pop when they return. Each frame shows its parameters and locals; the active frame is highlighted.
Console & watch
console.log output appears in the terminal-styled console. The watch panel tracks expressions of your choice across the entire run.
Execution graph
Control-flow at a glance
The graph view renders the run as a navigable control-flow graph: branch nodes for conditionals, back-edges for loops, and call/return edges for functions. The path taken so far is highlighted, and you can click any node to jump to that snapshot. Use the filters to hide or show specific node kinds.
Breakpoints & bookmarks
Pause where it matters
Click the editor gutter to toggle a breakpoint on a line. Playback stops at enabled breakpoints so you can step manually. Timeline nodes can also be bookmarked for quick reference during a long run.
AI explanations
Explain any snapshot
Select a snapshot and ask for an explanation. The AI returns a summary of what just happened, the concept behind it, and what happens next — streamed in real time when the provider supports streaming. Confidence is reported per explanation.
Providers
Three providers are supported:
- Local (offline) — default. Deterministic explanations generated in-process from the snapshot. No network, no API key.
- OpenAI — set
OPENAI_API_KEYserver-side. - Google Gemini — set
GEMINI_API_KEYserver-side.
Keys are resolved on the server and never exposed to the browser. Choose a provider and model in the AI settings dialog. With no key configured, CodeScope falls back to the local provider automatically.
Example gallery
Start from a curated program
The gallery ships pre-verified examples across categories and difficulty levels. Filter by category, difficulty, or tag; favorite and revisit examples; and load any of them straight into the playground, ready to step through.
Sessions & sharing
Workspace, serialized
Your workspace — code, breakpoints, watches, view, speed, and preferences — can be exported as a .codescope file or a compressed share link, then restored anywhere. Auto-save keeps the last session so you can pick up where you left off. Invalid or foreign files are rejected on import.
Safety & privacy
Your code stays local
Execution happens entirely in the browser. No code, breakpoints, or UI state is sent anywhere. The only network calls are the ones you opt into by configuring an AI provider, and the explanation prompts contain only minimal execution context — never your full source code.