Scratchpad

pragma-cli scratchpad create — publish a managed MDX document for the user.

pragma-cli scratchpad create --title <TITLE> <MDX_FILE|->

The only command in the group, and the only supported way to create a scratchpad. It:

  1. Reads MDX from the file, or from stdin with -.
  2. Writes a managed document under the current worktree's .pragma/scratchpads/, creating the managed frontmatter (id, title, created timestamp, and the agent tab attachment from PRAGMA_TAB_ID).
  3. Opens a scratchpad tab in the app so the user sees it immediately.
# publish a report the user can read, edit, and comment on
pragma-cli scratchpad create --title "Refactor plan" plan.mdx

# stream a document from another command
generate-notes | pragma-cli scratchpad create --title "Release notes" -

Why not write the file directly?

A scratchpad is a contract, not a text file: the managed frontmatter is what lets the app list it, attach an agent, promote it in a fanout pick, and route comment threads. Files written by hand are ignored by design.

Requirements: the current tab must be a registered agent tab and the app must be connected. Reading and commenting on scratchpads programmatically is the SDK's job — see @pragma-sh/scratchpad-contract for the file format.