Skip to content

Files and schemas

~/Library/Application Support/molt/
File Owner Format Created when
config.toml Rust configuration layer TOML First configuration load when missing, or Settings save
notebooks.json React persistence hook through Rust file commands Compact JSON First persistable notebook change after load

The code falls back to a relative working-directory path only if the operating system configuration directory cannot be resolved.

A representative file is:

notebooks.json
{
"version": 1,
"tabs": [
{
"tabIndex": 0,
"cells": [
{
"id": "0f4a9e9a-72de-4b04-a180-56e0c44fbf05",
"type": "code",
"source": "value = 21\nvalue * 2"
}
]
},
{
"tabIndex": 1,
"cells": [
{
"id": "1ec4e25e-81e4-4b44-8429-07ff095e8052",
"type": "code",
"source": ""
}
]
},
{
"tabIndex": 2,
"cells": [
{
"id": "97f8ef11-6248-4cd8-bc4f-e1386ec69cc0",
"type": "code",
"source": ""
}
]
},
{
"tabIndex": 3,
"cells": [
{
"id": "9b87faef-1524-4f13-b64d-8a0cf4701303",
"type": "code",
"source": ""
}
]
}
]
}
Field Type Meaning Validation on load
version Number Persistence format marker; writer emits 1 Must equal 1
tabs Array Persisted tab entries Must be an array
tabIndex Number Matches frontend notebook index Unique integer from 0 through 3
cells Array Ordered cell records Empty array is replaced with one fresh code cell
id String Stable cell identity, normally a browser-generated UUID Nonempty and unique across all tabs
type code or markdown Reserved cell kind Restored, but UI still renders a Python editor
source String Raw Python source Restored verbatim

The writer strips:

  • executionCount
  • outputs
  • state
  • Notebook kernelState
  • Notebook executionCounter
  • Global activeTab
  • Focus and command-mode state
  1. Rust returns the file contents as a JSON string or null when missing.
  2. The React hook parses the string.
  3. The frontend validates the version, tabs, indices, cells, IDs, types, and sources.
  4. Valid matching tabs replace their cell arrays.
  5. Each restored cell receives executionCount: null, outputs: [], and state: "idle".
  6. Existing notebook kernel and execution-counter defaults remain.
  7. The just-loaded persistable snapshot is remembered to prevent an immediate no-op rewrite.

If reading or validation fails, Molt shows a warning and disables autosave so the existing file is not overwritten with defaults.

  • The JSON is serialized compactly with JSON.stringify.
  • Writes occur after a 1.5-second debounce.
  • Identical persistable snapshots are skipped.
  • Saves are serialized so older writes cannot finish after newer ones.
  • Rust creates the directory if necessary and atomically replaces the file through a temporary file.
  • A pending write is attempted during frontend unmount but cannot be awaited there.

There is no cross-process file lock, backup rotation, or built-in history. Avoid concurrent manual edits.