ワンクリックで
claude-agent-terminal-ts
Terminal-style React UI for Claude Agent SDK with keyboard navigation, tool approval, and dark theme
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Terminal-style React UI for Claude Agent SDK with keyboard navigation, tool approval, and dark theme
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Build AI agents with Claude Agent SDK in TypeScript. Covers V1 query() API for batch workflows and V2 session API for interactive apps. Includes tool configuration, hooks, MCP servers, and multi-turn patterns.
Develop MCP Apps hosts (AppBridge) and access comprehensive MCP Apps reference documentation. Covers host embedding, multi-server routing, sandbox security, and full API reference. Use when building chat applications that embed MCP App UIs, or when you need in-depth MCP Apps architecture/API knowledge without cloning ext-apps.
Build TypeScript MCP clients with composable code snippets. Includes agentic pattern with LLM integration, server-initiated requests (sampling, elicitation), and dynamic discovery. Use when creating applications that connect to MCP servers.
Build TypeScript MCP servers with composable code snippets from the official Everything reference server. Use the add script to selectively copy tool, resource, or prompt modules. Use when creating MCP servers.
Add a React + WebSocket UI on top of Claude Agent SDK agents with tool approval and SQLite persistence
| name | claude-agent-terminal-ts |
| description | Terminal-style React UI for Claude Agent SDK with keyboard navigation, tool approval, and dark theme |
A retro terminal-inspired chat interface for Claude Agent SDK agents.
@anthropic-ai/claude-agent-sdk)claude login)# Server dependencies
npm install express cors ws @anthropic-ai/claude-agent-sdk better-sqlite3
npm install -D @types/better-sqlite3 @types/express @types/cors @types/ws tsx typescript
# Client dependencies
npm install react react-dom @mantine/core @mantine/hooks @tabler/icons-react
Copy these files to your project:
client.tsx and styles.css from this skillwebsocket-server-sqlite.ts and websocket-types.ts from claude-agent-sdk-ts skillyour-project/
src/
client.tsx # Terminal React component (this skill)
styles.css # Terminal theme (this skill)
server.ts # WebSocket server (from claude-agent-sdk-ts)
types.ts # Shared types (from claude-agent-sdk-ts)
Edit the server CONFIG section:
const CONFIG = {
port: 3001,
workingDirectory: process.cwd(),
model: "sonnet", // opus, sonnet, or haiku
allowedTools: ["Bash", "Read", "Write", "Edit", "Glob", "Grep"],
systemPrompt: "You are a helpful AI assistant.",
dbPath: "./chat.db",
};
npx tsx server.ts
import { TerminalChat } from './client';
import './styles.css';
function App() {
return (
<div style={{ height: '100vh' }}>
<TerminalChat wsEndpoint="ws://localhost:3001/ws" />
</div>
);
}
React Client Express Server Claude Agent SDK
(client.tsx) (server.ts)
| | |
|-- WebSocket ------> | |
| |-- query() ----------> |
|<-- messages ------- | |
| |<-- SDK messages ----- |
| | |
|<-- tool_approval ---| |
|-- approve/reject -> | |
| |-- continue/block ---> |
| Snippet | Source | Description |
|---|---|---|
client.tsx | This skill | Terminal-styled React component |
styles.css | This skill | Dark terminal CSS theme |
websocket-server-sqlite.ts | claude-agent-sdk-ts | Express + WebSocket + SQLite server |
websocket-types.ts | claude-agent-sdk-ts | Shared TypeScript types |
| Key | Action |
|---|---|
| Enter | Send message |
| Shift+Enter | New line |
| Arrow Up | Previous message in history |
| Arrow Down | Next message in history |
| Prop | Type | Description |
|---|---|---|
wsEndpoint | string | WebSocket server URL (e.g., ws://localhost:3001/ws) |
The <TerminalChat /> component fills whatever container it's placed in:
// Full page
<div style={{ height: '100vh' }}>
<TerminalChat wsEndpoint="ws://localhost:3001/ws" />
</div>
// Sidebar
<div style={{ display: 'flex' }}>
<MainContent />
<div style={{ width: '400px', height: '100vh' }}>
<TerminalChat wsEndpoint="ws://localhost:3001/ws" />
</div>
</div>
// Fixed height panel
<div style={{ height: '300px' }}>
<TerminalChat wsEndpoint="ws://localhost:3001/ws" />
</div>
| Message Type | Description |
|---|---|
connected | Initial connection confirmation |
history | Chat history on connect |
user_message | Echo of sent message |
assistant_message | Agent response text |
tool_use | Tool call initiated |
tool_approval_request | Awaiting user approval |
result | Request completed with cost |
error | Error occurred |
| Message Type | Description |
|---|---|
chat | User message |
tool_approval_response | Approve/reject tool call |
| Variable | Default | Usage |
|---|---|---|
| Background | #1e1e1e | Main terminal background |
| Header | #252526 | Header and input area |
| Text | #d4d4d4 | Default text color |
| User text | #9cdcfe | User message color |
| Accent | #569cd6 | Tool blocks, focus states |
| Success | #6a9955 | Completed status |
| Error | #f14c4c | Error messages |
| Warning | #ffcc00 | Approval prompts |
The component uses a monospace font stack:
'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'SF Mono', 'Consolas', monospace
| Skill | Description |
|---|---|
claude-agent-sdk-ts | SDK patterns, API reference, and shared server code |
claude-agent-ui-ts | Simpler unstyled UI alternative |