mcp-terminal: Instructions file for Claude Code

CLAUDE.md

mcp-terminal CLAUDE.md is an instructions file for Claude Code from alejoair/mcp-terminal. It costs 1,004 tokens per session, scanned C, original, MIT.

A project guide for an AI coding assistant working on an MCP Terminal Server. MCP is a standard way for an AI assistant to use external tools; here, the tool provides interactive terminal sessions.

In plain words
What is it for?
Use it when modifying the terminal session manager, virtual screen buffer, FastAPI web interface, request models, or server setup.
Why use it?
It gives the assistant an overview of the code structure and how its parts fit together, reducing guesswork when changing the project.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is alejoair/mcp-terminal's own configuration. It tells Claude Code how to work on mcp-terminal itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-terminal configures →

Reuse

Borrowing it

Nothing to install: this file belongs to alejoair/mcp-terminal. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/alejoair/mcp-terminal/develop/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/alejoair/mcp-terminal

Made for: Claude Code.

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 mcp-terminal CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/alejoair/mcp-terminal/claude-md/github.svg)](https://agentmods.dev/instructions/alejoair/mcp-terminal/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/alejoair/mcp-terminal/claude-md"><img src="https://agentmods.dev/badge/instructions/alejoair/mcp-terminal/claude-md/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 mcp-terminal CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/alejoair/mcp-terminal/claude-md"><img src="https://agentmods.dev/badge/instructions/alejoair/mcp-terminal/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,004 This file is loaded in full into every session.
When invoked 1,004 The same file — it is already loaded in full.
Security scan C 1 finding. 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.01004 $0.01004
Opus 5.5 $0.00402 $0.00402
Sonnet 5.5 $0.00201 $0.00201
Haiku 4.5 $0.00100 $0.00100

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

Security

Grade C, and why

mcp-terminal CLAUDE.md scanned grade C with 1 finding 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 2mo 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf dist build *.egg-info src/*.egg-info
CLAUDE.md · 99 lines

What it actually says

  • ● Arquitectura del Proyecto MCP Terminal

    src/mcp_terminal/ ├── core/ # Lógica de negocio │ └── terminal/ │ ├── manager.py # Gestión de sesiones terminales │ ├── session.py # Sesión terminal individual (pty) │ └── buffer.py # Buffer de pantalla virtual │ ├── api/ # Capa HTTP/REST │ ├── dependencies.py # ✅ Singleton TerminalManager │ ├── lifespan.py # ✅ Startup/Shutdown hooks │ └── endpoints.py # 🔜 HTTP endpoints (CRUD terminales) │ ├── models/ # Pydantic schemas │ └── terminal.py # Request/Response models │ └── server.py # 🔜 FastAPI app + CORS + MCP mount

    Flujo:

    1. server.py → Configura FastAPI + middlewares + monta MCP
    2. endpoints.py → Define rutas HTTP usando TerminalManagerDep
    3. dependencies.py → Provee singleton de TerminalManager
    4. core/terminal/ → Implementa lógica de terminales (pty, buffers)
    5. models/ → Define contratos de API (request/response)

    Patrón: Arquitectura en capas con inyección de dependencias (FastAPI Depends).

  • Arquitectura Actual - MCP Terminal

    src/mcp_terminal/ ├── server.py # FastAPI app + CORS + MCP mount (56 líneas) ├── api/ │ ├── dependencies.py # Singleton TerminalManager + DI │ ├── lifespan.py # Startup/shutdown hooks │ └── endpoints.py # REST + WebSocket (ahora con operation_id) ├── core/terminal/ │ ├── manager.py # Gestión múltiples terminales + reader interno │ ├── session.py # PTY session individual (terminado) │ └── buffer.py # Buffer visual (pyte) + ANSI parsing └── models/ └── terminal.py # Pydantic schemas (Request/Response)

    Flujo:

    1. create_terminal → Inicia PTY + reader interno
    2. Reader lee PTY → Actualiza buffer circular (5 snapshots)
    3. get_snapshot → Consulta cache instantáneo
    4. send_input → Escribe al PTY
    5. WebSocket /ws → I/O bidireccional (opcional)

    Patrón: Arquitectura en capas + DI + Event-driven (reader interno automático)

    Ahora voy a verificar y commitear los cambios de operation_id.

● Arquitectura MCP Terminal

Terminal creado ↓ Reader interno (auto-start) → Lee PTY cada 50ms ↓ Buffer circular (5 snapshots) → Actualizado automáticamente ↓ REST API (consulta cache) + WebSocket (streaming opcional)

Componentes:

  • server.py - FastAPI + MCP mount
  • api/endpoints.py - 6 endpoints REST + 1 WebSocket
  • api/dependencies.py - Singleton TerminalManager
  • core/terminal/manager.py - Coordina sessions + buffers + readers
  • core/terminal/session.py - PTY wrapper (terminado)
  • core/terminal/buffer.py - Screen buffer (pyte)

API:

  • create_terminal - Crea PTY + inicia reader
  • get_terminal_snapshot - Consulta instantánea del cache
  • send_terminal_input - Escribe al PTY
  • resize_terminal - Cambia dimensiones
  • close_terminal - Limpia recursos
  • list_terminals - Lista activos

Stack: FastAPI + terminado (PTY) + pyte (buffer) + asyncio

  • Publicar Nueva Versión en PyPI (Resumen Rápido)

    1. Actualizar versión en pyproject.toml: version = "0.2.2" # Incrementar
    2. Limpiar y construir: rm -rf dist build .egg-info src/.egg-info python -m build
    3. Publicar: python -m twine upload dist/*
    4. Commit: git add pyproject.toml git commit -m "Bump version to 0.2.2" git push

    Versionado: X.Y.Z

    • X = Major (breaking changes)
    • Y = Minor (nuevas features)
    • Z = Patch (bugfixes)
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. 2mo ago First seen · 99 lines · 1,004 tokens per session scan C a345b8a2ac15

Subscribe to this mod's changes

mcp-terminal CLAUDE.md is an instructions file published in the GitHub repository alejoair/mcp-terminal (1 stars, last pushed 11mo ago), licensed MIT. It adds 1,004 tokens to every session, about $0.0040 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

mcp-terminal CLAUDE.md compared with instructions from other repositories

mcp-terminal CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-terminal CLAUDE.mdalejoair/mcp-terminalInstructions file111mo agoMITC1,004Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode