terminal-use CLAUDE.md

terminal-use CLAUDE.md is an instructions file for coding agents 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

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.

agentmods
npx agentmods add instructions/flipbit03/terminal-use/claude-md
Clone the repo
git clone --depth 1 https://github.com/flipbit03/terminal-use

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00655 $0.00655
Opus 5 $0.00328 $0.00328
Sonnet 5 $0.00131 $0.00131
Haiku 4.5 $0.00065 $0.00065

Measured 5d ago against content hash c11db06f97ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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. 5d 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 (87 stars, last pushed 18d ago), licensed MIT. It adds 655 tokens to every session, about $0.0033 per session on Opus 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.