06-ink-react-terminal-ui — Claude Code prompt: Ink terminal UI
06-ink-react-terminal-ui — a Claude prompt that follows the React + Ink render path in the claude-code repo, checks the components and theme, and ends with a working terminal render test.
no license ★ 3,444 updated 2026-10-14
.claude/commands/06-ink-react-terminal-ui.mdWhat 06-ink-react-terminal-ui does
The prompt walks the agent through the Ink fork that lives in src/ink/ of the claude-code repo. It reads the chain in order: src/ink.ts, root.ts, reconciler.ts, renderer.ts, dom.ts, then writes down how the virtual DOM turns into terminal strings. The write-up lands as a short architecture note.
Then come the checks. Every component under src/ink/components/ is scanned for missing imports, ThemeProvider is inspected for outside dependencies, and 3-5 components in src/components/ get their imports traced. After that the agent writes scripts/test-ink.tsx, which mounts a tiny component and unmounts it after 500 ms.
Failures usually come from the same few spots, and the prompt names them: a missing yoga-wasm-web or yoga-layout (Ink uses Yoga for flexbox layout), a reconciler that does not fit React 19, stdout without a TTY, no chalk for colors. Paths like /workspaces/claude-code and the file names come from one specific repo, so check them against your own tree before running the command.
What it helps with
- trace how React components reach the terminal output
- spot an Ink component with a broken import
- confirm the theme layer pulls no outside resources
- build a minimal render test for the terminal
- diagnose an Ink crash caused by a missing TTY or Yoga
Example prompts for the agent
- Run
/06-ink-react-terminal-uiand find out why the Ink components never print to the terminal. - Use
/06-ink-react-terminal-uito check imports insrc/ink/components/and in the main components undersrc/components/. - Run
/06-ink-react-terminal-ui, writescripts/test-ink.tsxand prove the render works.
How to install 06-ink-react-terminal-ui
Manually: put the files in place
.claude/commands/06-ink-react-terminal-ui.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about 06-ink-react-terminal-ui
How do I install 06-ink-react-terminal-ui in Claude Code?
Drop the file at .claude/commands/06-ink-react-terminal-ui.md inside your project. Claude then exposes it as the slash command /06-ink-react-terminal-ui.
What does 06-ink-react-terminal-ui do?
It traces the React + Ink render pipeline in the claude-code repo, checks the components and the theme provider, then builds a small render test and fixes what breaks.
What can stop the render test from working?
The prompt names the usual suspects: missing yoga-wasm-web or yoga-layout, a reconciler that does not fit React 19, stdout without a TTY, and no chalk. The agent checks each and patches what it finds.