VS Code Extensions
S

Save Debug Variable to File

by FelipeMaza

Save the full value of a debug variable to a file from the Variables view context menu. Dumps numpy arrays, xarray datasets and pandas objects without truncation, one value per line.

Downloads

48

Rating

— (0)

Version

0.1.1

Last updated

Jul 09, 2026

Adds "Save Value to File..." and "Copy Full Value to Clipboard" options to the context menu of the debugger's Variables view.

Usage

  1. Start a debug session and stop at a breakpoint.
  2. In Run and Debug → Variables, right-click a variable.
  3. Choose Save Value to File... (pick where to save it) or Copy Full Value to Clipboard (same content, ready to paste, e.g. as a column in Excel).

How the value is obtained

  • Python sessions (debugpy): serialization runs inside the debugged process, which writes the file directly. Nothing is truncated:
    • numpy.ndarray → one value per line (flattened in C order), ready to paste as a column in Excel
    • xarray DataArray → values only, one per line; Dataset → one section per coordinate/variable, one value per line
    • pandas → to_string()
    • anything else → repr()
  • Other languages: a "Copy Value"-style evaluation (context: 'clipboard'); falls back to the value shown in the view.

Notes

  • Arrays with millions of elements produce huge text files and take a while; that is the cost of the text format.
  • With remote debugging, the Python process writes on its machine: the chosen path must exist there.

Credits

Code developed by Claude Fable (Anthropic's AI model).

Related extensions