Sandbox — LSD is in active testing. All systems operational·payments are test-mode (no real charges).
Overview Use Cases News Docs Tool Store Support Community Get LSD
All docs
Docs/ API Reference/ Context/ scratch_dir
Context· property

StepContext.scratch_dir

a private per-run temporary directory, created lazily

Python
scratch_dir: str

Returns str — a private temporary directory for this step

Example#

Python
tmp = os.path.join(ctx.scratch_dir, "chunk.bin")

Notes#

Created lazily on first access — under output_dir/_scratch when a workspace exists, otherwise a system tempdir. It is not persisted with the project; use output_dir for durable artifacts.

See also#

API: output_dir · StepContext

Guides: Parameters vs ports

By LSD Team · Last updated Jul 17, 2026 Ask on Discord View as Markdown