AgentUI CLAUDE.md

A set of Claude Code instructions for developing AgentUI, an MCP server that lets a coding agent ask people for input through forms, sliders, diffs, and previews.

In plain words
What is it for?
Use it when modifying AgentUI or running its build, tests, or type checks.
Why use it?
It documents how to build, test, and type-check the project, along with security and setup details that can cause failures.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/skulitom/agentui/claude-md
Clone the repo
git clone --depth 1 https://github.com/skulitom/AgentUI
Per session 1,508 This file is loaded in full into every session.
When invoked 1,508 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01508 $0.01508
Opus 5 $0.00754 $0.00754
Sonnet 5 $0.00302 $0.00302
Haiku 4.5 $0.00151 $0.00151

Measured 2d ago against content hash 2ac385b14b00, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

AgentUI CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AgentUI

Interactive UIs for coding agents: an MCP server that lets any agent ask its human with sliders, forms, diffs and live previews instead of guessing.

  • How to use the tools: skills/agentui/SKILL.md
  • Why it is built this way: the design decisions and their evidence are in the header comments of the files they affect — particularly packages/server/src/core/{waiters,session,library}.ts, packages/server/src/web/preview.ts and packages/ui/public/agentui/preview.js.

Working on it

pnpm build     # shared -> ui -> server (vendors three.js, copies the shell into server/web)
pnpm test      # 394 tests; the server suite runs against the real built binary over stdio
pnpm typecheck

pnpm build before running anything: the server serves the built shell, and the installer registers the built dist/mcp.js by absolute path.

Examples in packages/server/examples/ are dogfood — each asks something real about this project, so building the tool and using it are the same activity.

Things that will bite you

  • Loopback is the entire security model, until it is not. There is no login anywhere in this server: 127.0.0.1 is what makes it safe. AGENT_UI_HOST=lan (or an explicit address) trades that for reachability and MUST carry the token in web/access.ts — the shell, the preview origin AND the WebSocket upgrade. Anyone who reaches a widget can read what the agent attached and answer as you. It is off by default and prints what it is giving away.
  • stdout belongs to the MCP transport. protectStdout() redirects console.* to stderr and blocks stray writes; the transport gets the only remaining handle. A single stray print corrupts every message after it.
  • The preview frame is a second origin (shell port + 1). Sandboxing on one origin gives an opaque origin, and module imports then fail the CORS check — the DevTools error blames CSP and sends you the wrong way.
  • values_interim must never wake a waiter. It is drag noise. If it wakes ui_wait, one slider drag wakes the agent hundreds of times.
  • touched is replaced, not merged. Clearing a flag is how a user says "no opinion here" after poking a control.
  • Previews animate only agent-sourced changes. update(values, meta) gets meta.source; "user" frames must track 1:1 — animating under a live drag is the forbidden failure. The shell's motion tokens (--t-* in styles/tokens-and-base.css) are hand-mirrored in packages/ui/public/agentui/motion.js; change both.
  • A visual must encode something the agent went and got. sample, compare and bind render in the SHELL, not the frame, and read local values — live at 60fps, nothing on the wire. sample.source is required on purpose: a table of invented numbers is worse than a sentence, and the field is what makes that visible instead of asking anyone to remember.
  • Closing has no message of its own. A tab learns a session ended from the relayed closed event — nothing sends a closed frame — so anything that ends a session (ui_close, the user dismissing it) reaches the browser only through store.ts's event case. Miss it and the page keeps offering controls the server has already stopped accepting.
  • A new control type is four edits, and the compiler names two of them. A schema in shared/src/spec/control-schemas.ts, a member of the Control union, an entry in CONTROLS (spec/control-registry.ts), and an entry in CONTROL_INPUTS (ui/src/components/controls/index.tsx). Both registries are mapped Records over the union, so a missing entry will not compile. Content kinds work the same way via CONTENT_BLOCKS and BLOCK_RENDERERS. This used to be ~15 sites across 8 files, two of which failed silently.
  • shared/src/vocab.js is plain JS on purpose, and it is COPIED. The preview frame is a second origin with no bundler, so anything both halves must agree on (hint regexes, SELF_SHOWN, display rounding) lives there and is synced to ui/public/agentui/vocab.js by a prebuild/predev script. The copy is checked in; vocab-sync.test.ts compares the two byte for byte.
  • One function decides whether a preview opens AND what goes in it. planPreview (shared/src/preview-plan.js, synced to the frame) returns an ordered list of panels; shouldAutoPreview is just "does any planned view draw". These used to be two implementations a test compared, and they disagreed — a "type_scale" control landed in the frame's font bucket while the gate said there was nothing to show, so the frame never opened.
  • A new preview view is two entries. PREVIEW_VIEWS in preview-plan.js (the vocabulary — label, accepted control types, and whether drawing it justifies opening a frame) and VIEW_IMPLS in preview.js (the DOM). A test asserts the key sets match: a view with draws: true and no implementation opens a frame and then renders nothing, which is worse than not having it.
  • A preview can write back, and must do it through the shell's own path. setValues in the frame posts set_values; PreviewFrame replays it through setLocalValue/commit. Going around that would lose touched, animate under the user's finger, skip the interim throttle, and ignore whether the session is still open — every invariant lives on that path.
  • MCP tool schemas are shallow on purpose. ui_ask and ui_create advertise the containers and the enumerated vocabulary, not the full spec — inlining the real schemas costs ~5,000 tokens on every request. Detail comes from ui_schema on demand. A size budget in mcp-e2e.test.ts guards it, and nothing exposed may use .default(): zod 4 emits defaulted fields as required, turning a convenience into a mandatory argument.

Read the full file on GitHub · 93 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 93 lines · 1,508 tokens per session scan A 2ac385b14b00

Subscribe to this mod's changes

AgentUI CLAUDE.md is an instructions file published in the GitHub repository skulitom/AgentUI (0 stars, last pushed 27d ago), licensed MIT. It adds 1,508 tokens to every session, about $0.0075 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens