Marimo Screenshot
Capture a marimo notebook's rendered output (charts, tables, markdown) as a PNG screenshot that Claude can view and analyze.
Usage
When the user wants you to see notebook output, or when you need to analyze charts/visualizations in a marimo notebook.
Workflow
- •
Start the notebook in run mode (executes cells, serves rendered output):
bashuv run marimo run notebooks/<notebook>.py --port 2719 --headless &
- •
Wait for server to start:
bashsleep 10
- •
Take screenshot with JS render time (Altair/Vega charts need ~15s):
bashnpx playwright screenshot --wait-for-timeout 15000 --full-page \ "http://localhost:2719" /tmp/marimo_output.png
- •
Read the screenshot using the Read tool:
codeRead /tmp/marimo_output.png
- •
Kill the server when done:
bashpkill -f "marimo run.*2719"
Key Details
- •Use
marimo run(notedit) - this executes cells and renders output - •
--headlessruns server-only without opening a browser - •
--wait-for-timeout 15000gives charts time to render via JavaScript - •
--full-pagecaptures the entire scrollable notebook - •Port 2719 avoids conflict with the user's edit server on 2718
Troubleshooting
Charts not appearing:
- •Cells must return their output (e.g.,
mo.vstack([chart])as the last expression) - •If inside if/else, ensure all branches return a value
Blank screenshot:
- •Increase
--wait-for-timeoutto 20000 or more - •Check that the notebook runs without errors:
uv run marimo run notebook.py
Port in use:
- •Kill existing process:
pkill -f "marimo run.*2719" - •Or use a different port