Expand description
VS Code storage (SQLite database) operations
Structs§
- Session
Format Info - Result of session format detection
Enums§
- 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.
- 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
- 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. - 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 or .jsonl)
- 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.
- write_
chat_ session_ index - Write the chat session index to VS Code storage
- write_
empty_ window_ session - Write an empty window session