ratatui

ratatui is a skill for Claude Code, Codex from vinsonconsulting/claude-skill-foundry. It costs 244 tokens per session (3,939 once invoked), scanned A, original, Apache-2.0.

A coding guide for building and maintaining Rust terminal interfaces with the Ratatui library or crossterm. It covers the screen-drawing loop, terminal setup, widgets, testing, and related changes.

In plain words
What is it for?
Use it to create, debug, fix, test, extend, or migrate a Ratatui-based text interface.
Why use it?
It helps avoid outdated Ratatui code patterns and common problems such as leaving the terminal in a broken state after a crash.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md.

Good fit Use it to create, debug, fix, test, extend, or migrate a Ratatui-based text interface.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vinsonconsulting/claude-skill-foundry/ratatui
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.

Any agent
npx skills add vinsonconsulting/claude-skill-foundry --skill ratatui
Clone the repo
git clone --depth 1 https://github.com/vinsonconsulting/claude-skill-foundry

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ratatui

README.md
[![agentmods](https://agentmods.dev/badge/skills/vinsonconsulting/claude-skill-foundry/ratatui/github.svg)](https://agentmods.dev/skills/vinsonconsulting/claude-skill-foundry/ratatui)
Your own site
<a href="https://agentmods.dev/skills/vinsonconsulting/claude-skill-foundry/ratatui"><img src="https://agentmods.dev/badge/skills/vinsonconsulting/claude-skill-foundry/ratatui/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ratatui

Your own site · 80×15
<a href="https://agentmods.dev/skills/vinsonconsulting/claude-skill-foundry/ratatui"><img src="https://agentmods.dev/badge/skills/vinsonconsulting/claude-skill-foundry/ratatui.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 244 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,939 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00244 $0.03939
Opus 5.5 $0.00098 $0.01576
Sonnet 5.5 $0.00049 $0.00788
Haiku 4.5 $0.00024 $0.00394

Measured 3mo ago against content hash 62c88a312984, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ratatui 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 3mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (evals/functional/graders.py, evals/functional/run_grader.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/tui/ratatui/SKILL.md · 323 lines

How it starts

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

Ratatui

Write current, compiling Ratatui code (pinned to 0.30.x, Rust 2024) and refuse the stale tui-rs patterns the model remembers from training. The body is the load-bearing 20%: one mental model and one verified example per concept. Everything enumerable — the full widget catalog, every constraint, the streaming model, testing, migration — lives in references/. Open the matching reference before writing nontrivial code in that area.

Mental model

Ratatui is immediate mode: there are no retained widget objects. Every frame you build the whole UI from your own application state and throw it away. A render loop runs terminal.draw(|frame| …); inside, you slice the area into rectangles and draw widgets into them. Ratatui keeps two Buffers and diffs them, writing only the changed cells to the terminal — so redrawing the entire screen every frame is cheap and correct. You own the loop: read an event, update state, draw, repeat.

Four nouns carry everything:

  • Terminal — owns the backend (crossterm by default) and the double buffers; gives you a Frame.
  • Frame — one frame's drawing surface; frame.area() is the full Rect, frame.render_widget(w, rect) draws.
  • Buffer — the grid of styled cells widgets write into. Dimensions are u16 (max 65,535 per side).
  • Rect — an x/y/width/height region in u16. Layout is just splitting one Rect into more Rects.

Lifecycle: never hand-roll the terminal

Ratatui sets up raw mode, the alternate screen, and a panic hook for you. Do not call enable_raw_mode, EnterAlternateScreen, or any manual teardown — if you do, a panic or early return leaves the user's terminal wrecked.

fn main() -> color_eyre::Result<()> {
    color_eyre::install()?;            // BEFORE init(): ratatui's panic hook must be outermost,
    let terminal = ratatui::init();    // so it restores the screen before color-eyre prints.
    let result = App::default().run(terminal);
    ratatui::restore();                // always runs; restore BEFORE surfacing the error
    result
}

Read the full file on GitHub · 323 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. 3mo ago First seen · 323 lines · 244 tokens per session scan A 62c88a312984

Subscribe to this mod's changes

ratatui is a skill published in the GitHub repository vinsonconsulting/claude-skill-foundry (1 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 244 tokens to every session and 3,939 once invoked, about $0.0010 per session on Opus 5.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

ratatui compared with skills from other repositories

ratatui next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ratatuivinsonconsulting/claude-skill-foundrySkill14mo agoApache-2.0A244Claude Code, Codex
rust-patternsaffaan-m/ECCSkill314kyesterdayMITA28Claude Code, Kiro
canister-auditaeonfun/aeonSkill800yesterdayMITA127Claude Code, Codex
rust-string-enumsBerriAI/litellmSkill64ktodaynoneA41Claude Code, Codex
rust-python-boundaryBerriAI/litellmSkill64ktodaynoneA83Claude Code, Codex
rust-tracingBerriAI/litellmSkill64ktodaynoneA28Claude Code, Codex
rust-errorBerriAI/litellmSkill64ktodaynoneA72Claude Code, Codex