Expand description
VS Code storage (SQLite database) operations
Structs§
- Session
Format Info - Result of session format detection
- Session
Issue - A single issue detected during workspace session diagnostics
- Workspace
Diagnosis - Summary of issues found in a single workspace
Enums§
- Session
Issue Kind - Categories of session issues that can be detected and auto-fixed
- Session
Schema Version - Session schema version - tracks the internal structure version
- VsCode
Session Format - VS Code session format version - helps identify which parsing strategy to use
Functions§
- add_
session_ to_ index - Add a session to the VS Code index
- backup_
workspace_ sessions - Backup workspace sessions to a timestamped directory
- close_
vscode_ and_ wait - Close VS Code gracefully and wait for it to exit. Returns the list of workspace folders that were open (for reopening).
- compact_
session_ jsonl - Compact a JSONL session file by replaying all operations into a single kind:0 snapshot. This works at the raw JSON level, preserving all fields VS Code expects. Returns the path to the compacted file.
- convert_
skeleton_ json_ to_ jsonl - Convert a skeleton .json file to a valid minimal .jsonl file.
Preserves title and timestamp from the index entry if available.
The original .json file is renamed to
.json.corrupt(non-destructive). Returns the path to the new .jsonl file, or None if conversion was skipped. - count_
empty_ window_ sessions - Count empty window sessions
- delete_
empty_ window_ session - Delete an empty window session
- detect_
session_ format - Detect session format and version from content
- diagnose_
workspace_ sessions - Diagnose a workspace for session issues without modifying anything. Returns a structured report of all detected problems.
- ensure_
vscode_ compat_ fields - Ensure a JSONL
kind:0snapshot’svobject has all fields required by VS Code’s latest session format (1.109.0+ / version 3). Missing fields are injected with sensible defaults so sessions load reliably after recovery, conversion, or compaction. - fix_
cancelled_ model_ state - Fix cancelled
modelStatevalues in a compacted (single-line) JSONL session file. - get_
empty_ window_ session - Get a specific empty window session by ID
- get_
workspace_ storage_ db - Get the path to the workspace storage database
- is_
session_ file_ extension - Check if a file extension indicates a session file (.json, .jsonl, or .backup)
- is_
skeleton_ json - Detect whether a legacy .json file is a “skeleton” — corrupted to contain only structural characters ({}, [], commas, colons, whitespace) with all actual data stripped. These files parse as valid JSON but contain no useful session content.
- is_
vscode_ running - Check if VS Code is currently running
- parse_
session_ auto - Parse session content with automatic format detection
- parse_
session_ file - Parse a session file, automatically detecting format from content (not just extension)
- parse_
session_ json - Try to parse JSON, sanitizing invalid Unicode if needed
- parse_
session_ jsonl - Parse a JSONL (JSON Lines) session file (VS Code 1.109.0+ format) Each line is a JSON object with ‘kind’ field indicating the type:
- read_
chat_ session_ index - Read the chat session index from VS Code storage
- read_
empty_ window_ sessions - Read all empty window chat sessions (not tied to any workspace) These appear in VS Code’s “ALL SESSIONS” panel
- register_
all_ sessions_ from_ directory - Register all sessions from a directory into the VS Code index
- remove_
session_ from_ index - Remove a session from the VS Code index
- reopen_
vscode - Reopen VS Code, optionally at a specific path.
- repair_
workspace_ sessions - Repair workspace sessions: compact large JSONL files and fix the index. Returns (compacted_count, index_fixed_count).
- split_
concatenated_ jsonl - Split concatenated JSON objects in JSONL content that lack newline separators.
- sync_
session_ index - Sync the VS Code index with sessions on disk (remove stale entries, add missing ones) When both .json and .jsonl exist for the same session ID, prefers .jsonl.
- trim_
session_ jsonl - Trim a session JSONL file by keeping only the last
keeprequests. - write_
chat_ session_ index - Write the chat session index to VS Code storage
- write_
empty_ window_ session - Write an empty window session