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 messages, session restoration, and slash commands.

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

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.5 $0.00060 $0.00876
Sonnet 5.5 $0.00030 $0.00438
Haiku 4.5 $0.00015 $0.00219

Measured 1mo ago against content hash 9a1893d7429e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-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 1mo 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. 1mo 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 (180 stars, last pushed 19d ago), licensed MIT. It adds 150 tokens to every session and 2,189 once invoked, about $0.0006 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-09-03.

Related

Other skills, from other repositories

delegation

Delegates independent work to worker agents through the Task tool, choosing between the explore scout and the ml, biology, physics, chemistry and data specialists, writing a self-contained brief for a worker that cannot see the conversation, setting boundaries on files and compute, using two independent annotators…

synthetic-sciences/openscience · 118 tokens

bun

Read before a js eval cell that spawns a process, server or PTY, installs a package, or starts a long run, and before any bun -e, script, server, CLI, test, typecheck, format, bundle, or package-management work: this session's eval js kernel runs Bun 1.4+. Bun 1.4.x builtins replace 20+ npm deps and dev tools — check…

code-yeongyu/senpi · 237 tokens

email

Manage emails via Himalaya CLI. Use when the user wants to read, send, search, or organize emails. Triggers on "email", "inbox", "send email", "check mail", "reply to", "forward", or mentions of Gmail, Outlook, iCloud, Proton Mail.

lvndry/jazz · 63 tokens

install-jazz-github-action

Set up Jazz as a GitHub Action for automated PR code review and on-demand /jazz PR assistance. Use when the user asks to add Jazz to CI, create a GitHub Action workflow, set up PR review automation, enable /jazz commands on PRs, or integrate Jazz with GitHub.

lvndry/jazz · 69 tokens

create-workflow

Create Jazz workflow automation files (WORKFLOW.md). Use this for scheduling Jazz agents to run recurring tasks. For OS-level scripts/commands, use create-system-routine.

lvndry/jazz · 38 tokens

obsidian

Use the official Obsidian CLI (v1.12+) to manage vaults, notes, daily notes, search, tasks, tags, properties, links, templates, sync, publish, and workspaces. Use when the user mentions Obsidian, vaults, notes, or wants to automate note-taking and knowledge base workflows.

lvndry/jazz · 71 tokens