Back to list
olaservo

claude-agent-terminal-ts

by olaservo

Agent skills for building, testing, and learning about MCP

0🍴 0📅 Jan 25, 2026

SKILL.md


name: claude-agent-terminal-ts description: Terminal-style React UI for Claude Agent SDK with keyboard navigation, tool approval, and dark theme

Claude Agent Terminal UI

A retro terminal-inspired chat interface for Claude Agent SDK agents.

Features

  • Dark monospace theme (VS Code-inspired colors)
  • Input history with arrow key navigation
  • Collapsible tool call blocks with status badges
  • Inline tool approval prompts (Approve/Reject)
  • Auto-scroll to latest message
  • SQLite persistence for chat history
  • SDK session resumption across page reloads

Prerequisites

  • Node.js 18+
  • Claude Agent SDK (@anthropic-ai/claude-agent-sdk)
  • Claude Code authentication (claude login)

Quick Start

1. Install Dependencies

# 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

2. Copy Snippets

Copy these files to your project:

  • client.tsx and styles.css from this skill
  • websocket-server-sqlite.ts and websocket-types.ts from claude-agent-sdk-ts skill
your-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)

3. Configure Server

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",
};

4. Start Server

npx tsx server.ts

5. Use Component

import { TerminalChat } from './client';
import './styles.css';

function App() {
  return (
    <div style={{ height: '100vh' }}>
      <TerminalChat wsEndpoint="ws://localhost:3001/ws" />
    </div>
  );
}

Architecture

React Client          Express Server         Claude Agent SDK
(client.tsx)          (server.ts)
     |                     |                       |
     |-- WebSocket ------> |                       |
     |                     |-- query() ----------> |
     |<-- messages ------- |                       |
     |                     |<-- SDK messages ----- |
     |                     |                       |
     |<-- tool_approval ---|                       |
     |-- approve/reject -> |                       |
     |                     |-- continue/block ---> |

Snippets

SnippetSourceDescription
client.tsxThis skillTerminal-styled React component
styles.cssThis skillDark terminal CSS theme
websocket-server-sqlite.tsclaude-agent-sdk-tsExpress + WebSocket + SQLite server
websocket-types.tsclaude-agent-sdk-tsShared TypeScript types

Keyboard Shortcuts

KeyAction
EnterSend message
Shift+EnterNew line
Arrow UpPrevious message in history
Arrow DownNext message in history

Component Props

TerminalChat

PropTypeDescription
wsEndpointstringWebSocket server URL (e.g., ws://localhost:3001/ws)

Flexible Container

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>

WebSocket Protocol

Server to Client

Message TypeDescription
connectedInitial connection confirmation
historyChat history on connect
user_messageEcho of sent message
assistant_messageAgent response text
tool_useTool call initiated
tool_approval_requestAwaiting user approval
resultRequest completed with cost
errorError occurred

Client to Server

Message TypeDescription
chatUser message
tool_approval_responseApprove/reject tool call

Customization

Colors (in styles.css)

VariableDefaultUsage
Background#1e1e1eMain terminal background
Header#252526Header and input area
Text#d4d4d4Default text color
User text#9cdcfeUser message color
Accent#569cd6Tool blocks, focus states
Success#6a9955Completed status
Error#f14c4cError messages
Warning#ffcc00Approval prompts

Fonts

The component uses a monospace font stack:

'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'SF Mono', 'Consolas', monospace
SkillDescription
claude-agent-sdk-tsSDK patterns, API reference, and shared server code
claude-agent-ui-tsSimpler unstyled UI alternative

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon