# Claude Chalk, a mod that lets Claude Code colour its own replies

> Source: <https://github.com/adamkdean/claude-chalk>
> Published: 2026-10-28 12:29:43+00:00

[Install](#install) ·
  [Examples](#examples) ·
  [Palette](#the-palette) ·
  [Syntax](#syntax) ·
  [How it works](#how-it-works)

**claude-chalk** is a Claude Code mod that lets Claude colour its own replies
in the terminal. Claude writes markup in the syntax of the
[chalk-template](https://github.com/chalk/chalk-template) npm package, and the
mod draws it in colour, without the braces.

Long replies can bury the one line that matters. With the mod loaded, Claude marks failures in red, passes in green and warnings in yellow, and it puts a question it needs answered on a coloured background. The state of things shows at a glance, and most text stays plain.

At the prompt of a Claude Code session in a terminal:

```
/plugin install chalk --marketplace adamkdean/claude-chalk
```

Answer `y` to add the marketplace, then choose a scope. The mod is active in
that session at once and, under the user scope, in every session after it.

From a shell:

```
claude plugin install chalk --marketplace adamkdean/claude-chalk
```

In the desktop app, where `/plugin` does not run: click **+** next to the
prompt box, then **Plugins**, **Add marketplace** with
`adamkdean/claude-chalk`, then **Add plugin**.

The plugin is named `chalk`, after the npm package whose syntax it uses.
Claude Code reserves plugin names that start with `claude-`.

Every screenshot below is a real Claude Code session (Sonnet 5.5) with the mod loaded. The prompts do not ask for colour: Claude chose every colour itself.

Failures stand out from passes, and the coverage gap is easy to spot.

The bug is labelled in red, and the lesser points in yellow.

The root cause is in red and the knock-on effect in yellow, ahead of the detail.

When Claude cannot go on without a decision, the question goes on its own line on a background colour: blue for an ordinary question, red when the answer allows something risky or hard to undo.

Every style the mod draws, as Claude showed it when asked for its palette.

A block is `{style text}`: an opening brace, a style, one space, the text and a
closing brace. Chain styles with dots. Blocks nest, and an inner block adds to
the styles around it.

| Kind | Styles | 
|---|---|
| Colours | `black`` red``green`` yellow``blue`` magenta``cyan`` white``gray` , and each of the first eight with`Bright` (`redBright` ) | 
| Backgrounds | `bg` and a colour:`bgRed` ,`bgBlueBright` | 
| Modifiers | `bold`` dim``italic`` underline``inverse`` strikethrough` | 
| Hex | `#ff8800` (text),`#:003366` (background),`#ffffff:cc0000` (both),`hex(#ff8800)` ,`bgHex(#003366)` | 
| RGB | `rgb(255,136,0)` ,`bgRgb(0,51,102)` , with no spaces | 

```
{green ✓ All 42 tests pass}
{red.bold Build failed} in `src/parser.ts`
{yellow Warning:} the cache is stale.
{bold Hello {red world}}
{#ff8800:001122.bold Hot}
{bgRed.whiteBright  Delete these 3 files? }
```

Inside a block, write `\{` and `\}` for literal braces. Text in braces that is
not a valid style, such as `{name}`, is left as written.

The mod has two hooks:

- `prompt.compose` adds a short section to the system prompt that teaches
Claude the syntax and when to use it. Headless runs (`claude -p` ) do not get
it, because nothing draws the colours there.
- `ui.render` on`AssistantMessage` redraws each reply block that holds markup.
A paragraph with markup is drawn as coloured text, and every other paragraph
is drawn as markdown, as before. A block without markup is left to Claude
Code.

Named colours are drawn as Claude Code draws those names. Hex and RGB colours are drawn exactly. Only the drawing changes: the transcript keeps the markup as Claude wrote it.

- Markup is drawn in prose only. Inside code spans and code blocks it is shown as written.
- A block ends at the end of its paragraph.
- In a paragraph with markup, bold, italic, inline code, headings and lists are drawn, but tables are shown as plain text.
- Where the mod is not loaded, the markup is shown as written.
- The mod API is in early access and can change between Claude Code releases. Tested with Claude Code 2.1.312.

```
claude --plugin-dir .      # start a session with the mod loaded from this folder
claude plugin validate .   # check the manifests and the hooks module
claude plugin test .       # run the tests in tests/
```

[AGENTS.md](https://github.com/adamkdean/claude-chalk/blob/master/AGENTS.md) describes the layout, the checks and the rules for
changes, including how to check drawing in a real terminal.

The screenshots are recorded from real sessions in a pseudo-terminal and
replayed into [xterm.js](https://xtermjs.org) to render them.

Released under the [MIT licence](https://github.com/adamkdean/claude-chalk/blob/master/LICENSE).

An independent project, not made by or affiliated with Anthropic or the chalk project.
