Skip to content

Claude Diff

A claude-like edit: numbered rows in a frame, added and removed lines tinted, the changed words marked, and +N lines past the fold.

On this page

Examples

The shared grammar with the look fixed: the same as <CliDiff preset="claude-like" />, so it reads as the claude-like look on its own or inside a session. Every part in all eight looks is on Agent CLI.

Installation

npx knowns-ui@latest add agent-cli-claude
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

path
string
The file.
before / after
string
The file's text before and after.
patch
string
A unified patch instead.
maxRows
number
Default14
Rows before +N lines.

When to use

When to use

  • Showing the change a tool call made, inline in the transcript.

When not to use

  • Reviewing a whole file's change side by side: use Inline Diff.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Claude Diff to my app and wire it to my own data.
  • I need showing the change a tool call made, inline in the transcript. Set that up with the Knowns UI Claude Diff.
  • Which Claude Diff props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "claude-diff" }) and search_docs({ query: "claude diff" }).

Need help?

Stuck on Claude Diff, or found something off? We read every message.