TraceSee what your Python code actually does. Trace is a Visual Studio Code extension that records a Python program's real execution and lets you explore it beside your editor. Move through the run, inspect variables and function scopes, watch supported data structures change, and investigate runtime errors or unexpected output—all locally on your machine.
What you can do
Trace is an execution-exploration companion, not an automatic code fixer, AI assistant, notebook, or replacement for the native VS Code debugger. Your normal editing workflow stays in VS Code. Supported visualizations
Recognition is intentionally conservative. Slot-only node classes, general trees, adjacency matrices, weighted-edge formats, NetworkX objects, and arbitrary custom graph classes are not automatically visualized. Unrecognized values remain available in the normal variable and history inspectors where they can be serialized. Requirements
InstallOnce Trace is published, search for Trace in the Visual Studio Code Extensions view and select Install. To install a locally built VSIX instead:
Use Trace
Drag the dividers between Code and the right-side panels, between Visualizations and Runtime State, or above Console to resize those areas. Trace remembers the layout across runs. Use the reset-layout control in the Trace header to restore the default proportions. Focus a divider and use the arrow keys for keyboard resizing. To compare output against a known result, run Trace: Run with Test Case. Enter standard input and expected standard output when prompted. Use the two-character sequence Trace runs the saved version of the file. Save your changes before starting a run, or choose the save-and-run option when prompted. SettingsSearch for Trace in VS Code Settings, or add these values to your
Trace starts Python directly in the target file's directory, preserving ordinary relative-import behavior. It captures standard output and standard error, each up to 1,000,000 characters or 1 MB of JSON-encoded text, whichever comes first (output containing many newlines or quotes reaches the byte limit sooner). Each trace has a 16 MiB JSON size budget; object changes are stored as compact deltas, and recording stops with the available history saved when the budget is reached. Runs also stop when the event-count or execution-time limit is reached; Trace preserves the latest recoverable partial history instead of continuing without recording. When standard output is truncated, output comparison is skipped to avoid reporting a false pass. Up to 25 recent trace files are retained; files older than 30 days are removed when a new run starts. Security and privacyTrace executes your Python program as a separate child process, using your current operating-system account and permissions. This is not a security sandbox. A program may access files, environment variables, processes, and network resources available to your account. Do not use Trace to run untrusted code on a machine containing sensitive information. Use an isolated operating-system account, container, or virtual machine when necessary. Execution traces can contain variable values, credentials, tokens, file paths, personal information, or proprietary data. Treat trace files and screenshots as sensitive. Trace stores trace files in VS Code extension storage and does not send your source code or traces to a remote service. For additional security information, see SECURITY.md. Build from sourceRequirements for development: Node.js 20 or newer, npm, Python 3.10 or newer, and VS Code.
To launch the Extension Development Host, open the project in VS Code and press F5. To create an installable package, install the VS Code packaging CLI and run:
The generated VSIX can be installed using Install from VSIX…. Automated tests cover the Python tracer and the JavaScript history, output-comparison, structure-recognition, visualization-cache, trace-retention, styling, process-tree, and resizable-layout modules. AcknowledgementsI would like to express my sincere gratitude to Kuhu Vilecha for her valuable guidance, mentorship, and support throughout the development of Trace. Her insights, encouragement, and feedback played an important role in shaping this project and bringing it to completion. Thank you for your continuous support and guidance. About MeHi, I'm Aditya, a Computer Science student specializing in Artificial Intelligence and Machine Learning. I'm passionate about exploring technology, building practical software projects and developing tools that make complex concepts easier to understand. I built Trace with the goal of helping developers and students understand how programs execute through interactive visualizations, making debugging and learning algorithms more intuitive. Connect with me: Reopening and rerunningReopening a trace: After closing a Trace panel, use the editor-title Play button on the same Python file to reopen its last execution. To create a fresh execution even when a saved trace exists, use Trace: Run Current Python File (New Execution) from the Command Palette or the editor context menu. |