knowledge-interaction-surfaces-terminal-ui

knowledge-interaction-surfaces-terminal-ui is a skill for Claude Code, Codex from echoVic/blade-code. It costs 150 tokens per session (2,189 once invoked), scanned A, original, MIT.

A codebase guide for the interactive terminal interface, including keyboard input, message display, confirmations, questions, session switching, and streamed output.

In plain words
What is it for?
Use it for terminal keyboard and paste behavior, Ctrl+C, approval prompts, streamed messages, session restoration, and slash commands.
Why use it?
It helps developers change terminal behavior while keeping input handling, approvals, session recovery, and cleanup consistent.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for terminal keyboard and paste behavior, Ctrl+C, approval prompts, streamed…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echovic/blade-code/terminal-ui
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 echoVic/blade-code --skill terminal-ui
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

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 knowledge-interaction-surfaces-terminal-ui

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/terminal-ui.svg)](https://agentmods.dev/skills/echovic/blade-code/terminal-ui)
Your own site
<a href="https://agentmods.dev/skills/echovic/blade-code/terminal-ui"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/terminal-ui.svg" alt="Measured on agentmods" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,189 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.00150 $0.02189
Opus 5 $0.00075 $0.01094
Sonnet 5 $0.00030 $0.00438
Haiku 4.5 $0.00015 $0.00219

Measured 3d ago against content hash 9a1893d7429e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

knowledge-interaction-surfaces-terminal-ui 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 3d 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.

.trae/knowledges/interaction-surfaces/terminal-ui/SKILL.md · 70 lines

How it starts

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

Module Structure

TUI 以单个 vanilla Zustand Store 投影当前 Session,React Hook 只持有活动 Agent/Runtime 和输入交互生命周期;durable 消息、权限模式与恢复数据仍由 Session 服务管理。

Directory Layout

  • packages/cli/src/ui/App.tsx — 版本提示、Workspace Trust、资源与 Hook 初始化
  • packages/cli/src/ui/components/BladeInterface.tsx — 主界面、阻塞弹窗与 Session 启动路由
  • packages/cli/src/ui/components/MessageArea.tsx — 单 Static 根、流式块和 raw tail 渲染
  • packages/cli/src/ui/components/ — 输入、确认、问答、状态和工具展示组件
  • packages/cli/src/ui/hooks/ — Agent、命令、输入、确认、Ctrl+C 与缓冲生命周期
  • packages/cli/src/ui/input/terminalInput.ts — bracketed paste 与终端控制序列解析
  • packages/cli/src/ui/utils/ — LoopEvent 投影、Session 激活、Markdown 和工具格式化
  • packages/cli/src/store/ — React 与非 React 代码共享的当前进程状态
  • packages/cli/src/slash-commands/ — TUI 内置与自定义命令路由

Key Entry Points

  • AppWrapper in packages/cli/src/ui/App.tsx — 完成信任判断后挂载主界面
  • BladeInterface in packages/cli/src/ui/components/BladeInterface.tsx — 组合输入、弹窗、消息与状态区
  • useCommandHandler() in packages/cli/src/ui/hooks/useCommandHandler.ts — 单轮命令、取消和恢复编排
  • useAgent() in packages/cli/src/ui/hooks/useAgent.ts — Agent/SessionRuntime 的唯一 React 所有者
  • createLoopEventHandler() in packages/cli/src/ui/utils/loopEventHandler.ts — LoopEvent 到 TUI Store 的投影

Gotchas

  • 取消顺序不可交换:先 dismissAll() 释放阻塞审批,再排空流式缓冲,再 abort,最后 finalize;先 abort 会把审批拒绝误判为普通 permission denial,晚到 stream_end 还可能重复提交 (packages/cli/src/ui/hooks/useCommandHandler.ts, packages/cli/src/ui/hooks/useConfirmation.ts)
  • createAbortController() 会主动中止并替换已有 controller;命令下层必须复用外层 controller,否则 finally 的所有权检查失败并让 isProcessing 永久卡住 (packages/cli/src/ui/hooks/useCommandHandler.ts, packages/cli/src/store/slices/commandSlice.ts)
  • MessageArea 只能有一个 Ink Static 根;条件挂载第二个 Static 曾让 Ink 保留已释放 Yoga 节点并在后续 commit 崩溃 (packages/cli/src/ui/components/MessageArea.tsx, docs/testing/tui-single-static-root-ownership-evidence.md, git:c68977b7)
  • 高频 Markdown tail 绕过 React 直接写 stdout;在 Static 增长、finalize、清屏、resize 或历史展开前必须先清理 raw renderer,否则终端会残留或错位 (packages/cli/src/ui/components/MessageArea.tsx, packages/cli/src/ui/utils/rawStreamRenderer.ts)
  • clearCount 是 Static 的唯一强制重挂边界,finalize 时还必须先 eraseScreen + cursorTo(0,0);仅清屏不归位会在顶部留下大段空白 (packages/cli/src/ui/components/MessageArea.tsx)
  • 一次 stdin 回调可能是完整 IME 文本或批量自动化输入,不能逐字符假设;bracketed paste marker 还可能被 Ink 去掉 ESC 或跨 chunk 到达 (packages/cli/src/ui/input/terminalInput.ts, docs/reference/tui-terminal-input.md)
  • 未闭合 paste 会留在 parser buffer,超过消息字符预算后一直丢弃到 end marker;不要把半段 paste 当普通输入提交 (packages/cli/src/ui/input/terminalInput.ts)
  • 第一次 Ctrl+C 在执行中只取消任务并显示二次退出提示,3 秒内第二次才走 GracefulShutdown;直接恢复 Ink 的默认 exitOnCtrlC 会跳过资源释放 (packages/cli/src/ui/hooks/useCtrlCHandler.ts, packages/cli/src/blade.tsx)
  • Session 激活必须先完成 fork/load 和 UI-safe 转换,再 cleanupAgent(),最后一次性恢复新 Store;清理失败时不能提前切换界面身份 (packages/cli/src/ui/utils/sessionActivation.ts)
  • fork 提示是 UI-only assistant message,不进入恢复的 model context;把 visible messages 重建为上下文会污染后续模型输入 (packages/cli/src/ui/utils/sessionActivation.ts, packages/cli/src/ui/utils/sessionContext.ts)
  • 阻塞弹窗通过 display="none" 隐藏主界面而不卸载,目的是保留 Static 和输入状态;改成条件卸载会重复打印历史并丢失输入组件状态 (packages/cli/src/ui/components/BladeInterface.tsx)

Read the full file on GitHub · 70 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. 3d ago First seen · 70 lines · 150 tokens per session scan A 9a1893d7429e

Subscribe to this mod's changes

knowledge-interaction-surfaces-terminal-ui is a skill published in the GitHub repository echoVic/blade-code (178 stars, last pushed today), licensed MIT. It adds 150 tokens to every session and 2,189 once invoked, about $0.0007 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-09-03.

Related

Other skills, from other repositories

Code Execution

Run Python, Node.js, AND arbitrary shell commands in a secure E2B cloud sandbox that PERSISTS across calls within a conversation. Clone repos, install packages, run CLI tools (git, psql, ffmpeg, duckdb), and build up state turn over turn.

winsenlabs/platos · 60 tokens

flashcard-generator

Generate educational flashcards from topics, documents, notes, or study materials. Produces structured JSON data and can create polished Tailwind CSS HTML flashcard review pages with interactive card flipping, progress, tags, and difficulty labels.

mingchen666/Reviva · 49 tokens

tg-moderator

Telegram chat moderator/companion mode. No tools, conversational only.

StarryCod/cogitum · 19 tokens

slack-gif-creator

Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like "make me a GIF for Slack of X doing Y".

alleneee/skill-agent · 57 tokens

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

alleneee/skill-agent · 35 tokens

artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

alleneee/skill-agent · 63 tokens