mini-term CLAUDE.md

mini-term CLAUDE.md is an instructions file for coding agents from dreamlonglll/mini-term. It costs 3,956 tokens per session, scanned B, original, MIT.

Repository instructions for mini-term, a desktop terminal manager built with Rust. They describe the project structure, development commands, packaging files, and precautions for running development and installed versions together.

In plain words
What is it for?
Use them when changing mini-term, especially to stage its supporting programs, start an isolated development copy, run Rust, relay-server, or mobile tests, and regenerate translation data.
Why use it?
They give coding agents the project context and exact commands needed to build, test, and run the software without disturbing user data or creating misleading changes.

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/dreamlonglll/mini-term/claude-md
Clone the repo
git clone --depth 1 https://github.com/dreamlonglll/mini-term

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 mini-term CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dreamlonglll/mini-term/claude-md.svg)](https://agentmods.dev/instructions/dreamlonglll/mini-term/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/dreamlonglll/mini-term/claude-md"><img src="https://agentmods.dev/badge/instructions/dreamlonglll/mini-term/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,956 This file is loaded in full into every session.
When invoked 3,956 The same file — it is already loaded in full.
Security scan B 1 finding. 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.03956 $0.03956
Opus 5 $0.01978 $0.01978
Sonnet 5 $0.00791 $0.00791
Haiku 4.5 $0.00396 $0.00396

Measured 4d ago against content hash 88aa42824e3a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

mini-term CLAUDE.md scanned grade B 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 4d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Grok 的 hook 接入与另外两家有两处结构性差异,改动前先看 `mt-ai::hook_registry::register_grok_hooks` 的注释:① grok 默认还会扫描 `~/.claude/settings.json` 的 hooks(Claude 兼容层),同一事件会来两趟,sidecar 靠 `GROK_SESSION_ID` + 是否带 argv 丢弃兼容层那趟(只注册了 Claude 的用户必须放行—
CLAUDE.md · 145 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

mini-term — GPUI 原生桌面终端管理器,支持多项目、多标签、分屏布局,并能感知 AI 进程(Claude/Codex/Grok 等)状态;带移动端中转镜像与 SSH 远程项目能力。

  • UI/渲染: gpui 0.2.x(Zed 官方,crates.io 版)+ gpui-component(Resizable/Modal/Input/Tree 等)
  • 终端: alacritty_terminal(VT 状态机,进程内直喂,无 IPC)+ portable-pty
  • 发布形态: Windows x64 NSIS 安装包(scripts/windows-installer.nsi,包内平铺 exe + 三个 sidecar + portable-conpty,全部「与 exe 同目录」)+ macOS dmg + Linux deb/tar.gz
  • 历史: 项目最初是 Tauri v2 + React 实现,v1.0.0-beta 后整体删除切换到 GPUI 原生版;找旧实现看 git 历史(合并点 236d5c1

开发命令

# 首次/换版本后:构建三个 sidecar 并连同便携 ConPTY 就位到 target/debug/
node scripts/stage-sidecars.mjs

# 启动开发实例(⚠️ 与装机版并跑时必须隔离数据目录)
MT_APP_DATA_DIR="$LOCALAPPDATA/mini-term-gpui-dev" cargo run -p mt-app

# 全工作区测试(27 个目标 1500+ 例)
cargo test --workspace

# 中转服务端协议边界测试 / sidecar 工作区
cd relay-server && cargo test
cargo build --manifest-path sidecars/Cargo.toml

# 移动端 PWA
cd mobile && npm run build

# 改文案后重新生成 i18n 字典
node crates/mt-i18n/tools/gen_from_ts.mjs
  • ⚠️ 禁跑 cargo fmt:本仓 HEAD 非 rustfmt-clean,全仓 fmt 会重排几十个文件淹没 diff。
  • ⚠️ GPUI dev 实例运行中时 cargo test -p mt-app 会卡在「无法替换 target/debug/mini-term.exe」——先关实例,或 cargo test --no-run --message-format=json 取出测试二进制直接执行。

架构说明

工作区布局

目录 说明
crates/ 主工作区(根 Cargo.toml,members = crates/*)
sidecars/ sidecar 二进制独立工作区(miniterm-hook / mt-ssh-mcp / mt-ssh-cli)。版本号自成语义——daemon 换代靠它判断,不跟随主程序发版,故不并入根 workspace。产物由 scripts/stage-sidecars.mjs 就位到主程序 exe 同目录
relay-server/ 移动端中转服务(axum),其 protocol crate 被 mt-relay 跨工作区 path 依赖
mobile/ 移动端 PWA(React + TS + Vite),产物由中转托管

crates/ 各 crate 职责

crate 职责
mt-app GPUI 应用壳:Workspace 组件树、AppStore 全局状态、SplitNode 布局树、各面板/弹窗/托盘/标题栏。组件树图见 main.rs 模块注释
mt-ui GPUI 渲染层:终端 view/element、主题桥。不含业务逻辑
mt-terminal VT 状态机 + grid 模型(alacritty_terminal 封装)。不依赖 gpui
mt-pty PTY 生命周期(spawn/read/write/resize/kill)+ 便携 ConPTY 预载(conpty.rs,从 exe 旁 portable-conpty/ LoadLibrary 预载)
mt-ai AI 感知:hook server(权威)、hook 注册(hook_registry.rs)、输入检测降级(detect.rs)、状态判定(monitor.rs/perception.rs)、会话记录读取(sessions.rs
mt-project 文件树、目录监听、搜索、Git(git2,vendored-openssl 必须保留)、外部编辑器、WSL 发行版枚举
mt-config 配置持久化(config.db,rusqlite)与主题包。不依赖 gpui。config.json 已退化成给 sidecar 读的 SSH 投影(见下节);界面布局另见 mt-layout
mt-layout 界面布局持久化(layout.db,rusqlite):三栏比例 / 每项目分屏树 / 窗口几何。分屏树整棵存 JSON 不拆关系表,理由见模块注释
mt-i18n 双语文案层。字典源头是 locales/*.ts(TS 对象字面量,随 Tauri 版下线迁入),src/dict.rstools/gen_from_ts.mjs 生成——禁止手改 dict.rs,改文案改 locales 后重跑生成器,tests/consistency.rs 的对账常量随之更新
mt-relay 移动端中转桌面侧:出站 WSS 长连、配对、项目快照/增量、对话镜像(mirror.rs)、移动端指令写穿
mt-ssh 共享 SSH 通信层(russh 持久会话池 + SFTP 原语),主程序与 sidecar 共用
mt-usage 用量统计:会话轮次解析 / SQLite 账本 / 聚合 / 计价
mt-core 叶子共享库(WSL UNC 解析 / SSH 提示扫描 / 原子写等)。⚠️ 依赖方向铁律:只依赖 serde/serde_json/dirs,绝不反向依赖上层 crate——它同时被三个 sidecar 与 mt-ssh 链接

Read the full file on GitHub · 145 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. 4d ago First seen · 145 lines · 3,956 tokens per session scan B 88aa42824e3a

Subscribe to this mod's changes

mini-term CLAUDE.md is an instructions file published in the GitHub repository dreamlonglll/mini-term (217 stars, last pushed 5d ago), licensed MIT. It adds 3,956 tokens to every session, about $0.0198 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens