Get Moshi
chat

Inline visuals

When a picture explains it better, Claude Code and Codex can answer with a chart, diagram, table, or mockup that appears right inside the reply.

updated yesterday4 min readpage 29 / 45

Some answers are hard to read as text on a phone: a latency breakdown, a dependency graph, a before-and-after comparison, a rough UI layout. Inline visuals let the agent draw that answer as a small HTML page and show it in the middle of its reply in Chat View, next to the explanation it supports.

You don't have to ask for a special format. The agent decides when a visual makes the answer clearer, the same way it decides when to use a table or a code block. You can also ask for one directly — "chart the test times by package", "draw the request flow as a diagram".

How it works

moshi-hook installs a small skill called moshi-visuals that teaches the agent how to answer with a visual:

  1. The agent writes a self-contained HTML page to ~/.moshi/visuals/ on your host.
  2. It puts one line in its reply that names that file.
  3. Chat View reads the page from your host and shows it inline where that line sits, sized to fit.

In the terminal the same reply shows the line as plain text, so nothing changes in the agent's TUI.

Supported agents

  • Claude Code
  • Codex

The skill is installed for each of them wherever their global hooks are installed. A project-only install (moshi-hook install --local) never adds it.

Requirements

  • moshi-hook 0.4.35 or later, with Claude Code or Codex hooks installed globally. See Hooks.
  • Moshi 4.1.1 or later, or Moshi Desktop from the same moshi-hook release.
  • A working Chat View for the session. Visuals appear only in Chat View, not in the terminal.

Turn it on or off

Inline visuals are on by default. Turning them off removes the skill, so the agents stop drawing visuals; turning them back on puts it back. Either change applies at once, with no daemon restart.

From the host:

on the host
$moshi-hook set inline-visuals off
# turn it back on
$moshi-hook set inline-visuals on

From the app, open Hooks on the Home screen, choose the host, and use the Inline visuals switch under Options. In Moshi Desktop, the same switch is in the host's Options tab.

If the skill goes missing or out of date while the setting is on, the Hooks sheet shows that agent as needing an update; tap Update to fix it. A moshi-visuals skill folder that you created yourself is never overwritten or removed.

View a visual

In Moshi on your phone:

  • The visual appears inside the reply, sized to its content. Scrolling up and down still scrolls the chat.
  • A sideways drag that starts on the visual stays with it, so you can rotate a 3D chart or pan a wide diagram without opening the sidebar.
  • Tap Full screen to give the page the whole screen, in any orientation, with every gesture going to the page. Drag the title bar down to close it.

In Moshi Desktop:

  • The visual fits the chat column and stops at most of the chat's height; a taller page scrolls inside its card.
  • The Full screen button at the card's top right opens it in a larger view.

Everywhere:

  • Visuals use Moshi's colors and follow its light or dark theme.
  • A link inside a visual opens only when you tap or click it. A page cannot open links on its own.

Privacy

local

The page stays on your host until Chat View shows it. The app reads it through the same encrypted SSH-forwarded host gateway that carries the Chat View transcript, so the visual never passes through the Moshi API.

  • The page runs in a sandbox. It can report its own height and the links you tap, and nothing else reaches the app or the host.
  • It cannot make network requests. The only things it may load are chart libraries and fonts from a few public CDNs (jsDelivr, unpkg, cdnjs, esm.sh, and Google Fonts), which your device fetches directly when the page uses them.
  • Visual files accumulate in ~/.moshi/visuals/. Delete them over SSH whenever you like; an older reply whose file is gone just shows its name instead of the page.

Troubleshooting

  • The agent never draws a visual. Check that moshi-hook set lists inline-visuals as on, and that Claude Code or Codex hooks are installed globally rather than with --local. Start a new agent session so it picks up the skill.
  • A reply shows a name with a diamond instead of the page. The page could not be read. The line says why, for example that the file is larger than 512 KB or no longer exists. Ask the agent to redraw it.
  • The terminal shows a line starting with ::moshi-visual. That is the marker Chat View turns into a visual. Open the session in Chat View to see it.
  • Chat View — the conversation surface visuals appear in.
  • Hook settings — every moshi-hook set option.
  • Hooks — install the daemon and agent hooks.