terminal-use: Instructions file for Claude Code

CLAUDE.md

terminal-use CLAUDE.md is an instructions file for Claude Code from flipbit03/terminal-use. It costs 655 tokens per session, scanned A, original, MIT.

A project guide for terminal-use, a headless virtual terminal that AI agents can control without a person operating it. It documents how to build and test the Rust project and explains its client, background service, terminal sessions, and mouse handling.

In plain words
What is it for?
Use it when developing terminal-use, running its tests and checks, or tracing how terminal commands, sessions, mouse events, and the background service work.
Why use it?
It gives coding agents the project rules and commands needed to make changes and check that they work. It also explains where each major part of the code lives.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions Claude Code.

This is flipbit03/terminal-use's own configuration. It tells Claude Code how to work on terminal-use 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 terminal-use configures →

Reuse

Borrowing it

Nothing to install: this file belongs to flipbit03/terminal-use. 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/flipbit03/terminal-use/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/flipbit03/terminal-use

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/flipbit03/terminal-use/claude-md"><img src="https://agentmods.dev/badge/instructions/flipbit03/terminal-use/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 655 This file is loaded in full into every session.
When invoked 655 The same file — it is already loaded in full.
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.00655 $0.00655
Opus 5.5 $0.00262 $0.00262
Sonnet 5.5 $0.00131 $0.00131
Haiku 4.5 $0.00065 $0.00065

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

Security

Grade A, and why

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

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.

CLAUDE.md · 43 lines

How it starts

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

terminal-use (tu)

Headless virtual terminal for AI agents. Binary is called tu. See issue #1 for the full project spec.

Build & Test

cargo build          # dev build
cargo build --release
cargo test           # run unit tests
cargo fmt --check    # check formatting (CI enforces this)
cargo clippy -- -D warnings  # lint (CI enforces this)
RUSTDOCFLAGS="-Dwarnings" cargo doc --all-features --no-deps  # doc lint (CI enforces this)

Architecture

CLI client → Unix socket (JSON-over-newline) → background daemon → per-session PTY + alacritty_terminal emulator.

  • src/main.rs — clap CLI, command dispatch
  • src/daemon/server.rs — Unix socket listener, daemon lifecycle. Wait and Mouse requests run outside the manager lock so they don't block monitor polls.
  • src/daemon/session.rs — PTY + emulator per session, plus a per-session MouseTracker (synthetic cursor, held buttons, last event)
  • src/daemon/manager.rs — session map, request handling, handle_mouse_glided (interpolated mouse motion)
  • src/daemon/protocol.rs — JSON request/response types, mouse action/target/state types
  • src/emu.rs — wrapper around alacritty_terminal + its embedded vte::ansi parser; exposes the small Parser/Screen/Cell/Color slice the rest of the codebase consumes. Capture proxy queues Event::PtyWrite replies (DA, DCS, etc.) for the reader to forward back to the PTY.
  • src/pty/ — PTY spawn (ECHOCTL off so curses subshell apps see clean ESC echo), input injection, resize
  • src/keys.rs — key name → escape sequence mapping
  • src/mouse.rs — wire encoders for SGR / Default / UTF-8 mouse protocols, screen-search helpers (find_text / find_regex)
  • src/commands/ — CLI command handlers (each talks to daemon)
  • src/render/ — text and image screenshot renderers (PNG paints a magenta △ cursor overlay)

Conventions

  • Follow lineark patterns: usage command for LLM reference, version = "0.0.0" patched by CI, binary-release feature flag.
  • usage ≠ --help. usage is a hand-maintained <1000 token cheatsheet for agents. --help is verbose clap output for humans.
  • Commands that don't need the daemon (usage, self update) are handled before daemon connection.
  • Default terminal size: 120x40, TERM=xterm-256color, COLORTERM=truecolor (overridable via --env COLORTERM=...).

Read the full file on GitHub · 43 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. 2mo ago First seen · 43 lines · 655 tokens per session scan A c11db06f97ca

Subscribe to this mod's changes

terminal-use CLAUDE.md is an instructions file published in the GitHub repository flipbit03/terminal-use (100 stars, last pushed 2mo ago), licensed MIT. It adds 655 tokens to every session, about $0.0026 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-08-30.

Related

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

terminal-use CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
terminal-use CLAUDE.mdflipbit03/terminal-useInstructions file1002mo agoMITA655Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot