Claude Code · Codex · claude.ai

An agent that
looks at the page.

Most agents write text they never see typeset. Here the agent compiles its Typst source, renders the page as an image, looks at it, and fixes what is wrong before you read it.

A one-page design note titled “Retrying writes safely”, with a flow diagram, a table of client responses, a code sample and a checklist.
Rendered by Typst 0.15.1 from examples/ai/main.typ. Select for full size.

The tools your agent gets

  • Documentslist_documents, get_document, create_document, import_project, rename_document, trash_document, restore_document
  • Fileslist_files, read_file, read_image, search_text
  • Editingstr_replace, apply_patch — each checks the revision it read and carries a request_id
  • Historylist_file_versions, restore_file_version
  • Checkingcompile_document, get_diagnostics, render_page, query_document
  • Sharingexport_document, share_document, unshare_document

Try this prompt

Write a one-page design note on retrying writes safely with request IDs: the problem, the rule, a fletcher flow diagram, a table of what the client should do, and a short test. Compile it, render the page, fix anything that looks off, then share it and give me the link.

Paste it into your agent once LeftBlank Office is connected.

From the source

#import "@preview/fletcher:0.5.8" as fletcher: diagram, node, edge

#diagram(
  spacing: (14mm, 9mm),
  node-stroke: 0.6pt + luma(60),
  node((0, 0), [write\ `request_id = r`], corner-radius: 3pt, name: <recv>),
  node((1, 0), [seen `r`?], shape: fletcher.shapes.diamond, name: <seen>),
  node((1, 1.3), [apply the write,\ store result for `r`], name: <apply>),
  edge(<recv>, <seen>, "-|>"),
  edge(<seen>, <apply>, "-|>", [no], label-side: left),
)

Full source on GitHub ↗

Good to know

  • Text inside your documents is content, not instructions. The server never calls a model; your agent does the writing.
  • The tool names and arguments match the LeftBlank desktop app, so a prompt that works there works here.

Connect your agent

claude mcp add --transport http leftblank https://office.leftblank.app/mcp

Other clients and the full setup are in agents.md.