iterminal AGENTS.md

iterminal AGENTS.md is an instructions file for Codex, OpenCode from iTophua/iterminal. It costs 7,648 tokens per session, scanned C, original, MIT.

Reference instructions for iTerminal, an SSH connection manager built with Tauri, React, TypeScript, Vite, Rust, and a terminal emulator.

In plain words
What is it for?
Finding code related to SSH connections, terminal windows, shell input and output, initialization, and file transfers.
Why use it?
They give an agent a map of the application's structure and where its connection and terminal features are implemented.

Instructions file for CodexOpenCode

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/itophua/iterminal/agents-md
Clone the repo
git clone --depth 1 https://github.com/iTophua/iterminal

Made for: Codex, OpenCode.

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 iterminal AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/itophua/iterminal/agents-md.svg)](https://agentmods.dev/instructions/itophua/iterminal/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/itophua/iterminal/agents-md"><img src="https://agentmods.dev/badge/instructions/itophua/iterminal/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 7,648 This file is loaded in full into every session.
When invoked 7,648 The same file — it is already loaded in full.
Security scan C 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.07648 $0.07648
Opus 5 $0.03824 $0.03824
Sonnet 5 $0.01530 $0.01530
Haiku 4.5 $0.00765 $0.00765

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

Security

Grade C, and why

iterminal AGENTS.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 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

- 密钥路径支持 `~` 展开(如 `~/.ssh/id_rsa`)
AGENTS.md · 587 lines

How it starts

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

iTerminal - SSH Connection Manager

Generated: 2026-03-26 Branch: main

技术栈: Tauri 2.10 + React 19.2 + TypeScript 5.9 + Vite 7.3 + Ant Design 6.3 + xterm.js 6.0 + Rust (russh 0.50 + russh-sftp 2.1)

架构概览

┌─────────────────────────────────────────────────────────────┐
│                        前端 (React)                          │
├─────────────────────────────────────────────────────────────┤
│  main.tsx (入口)                                             │
│  ├─ 静态预加载器 (index.html) ─────────► 避免 React 加载白屏  │
│  ├─ SplashScreen ─────────────────────► 启动动画 + 初始化     │
│  └─ useAppInitialization ─────────────► 数据库/字体/连接加载  │
├─────────────────────────────────────────────────────────────┤
│  Terminal.tsx (主窗口)                                       │
│  ├─ listen("shell-output-{id}") ──────► 监听 shell 输出事件   │
│  └─ invoke('write_shell') ────────────► 发送用户输入          │
├─────────────────────────────────────────────────────────────┤
│  TerminalWindow.tsx (新窗口)                                 │
│  ├─ listen("terminal-window-init") ───► 监听初始化事件        │
│  ├─ restoreConnection() ──────────────► 恢复连接到 store      │
│  └─ 渲染 <Terminal /> ───────────────── 复用主窗口组件         │
├─────────────────────────────────────────────────────────────┤
│  Connections.tsx                                             │
│  └─ 从 terminalStore.allConnections 读取 ─► 全局共享状态      │
├─────────────────────────────────────────────────────────────┤
│  Sidebar.tsx                                                 │
│  └─ 从 terminalStore.allConnections 读取 ─► 响应式更新分组    │
├─────────────────────────────────────────────────────────────┤
│  FileManagerPanel.tsx                                       │
│  ├─ listen("transfer-progress-{id}") ──► 监听传输进度         │
│  └─ listen("transfer-complete-{id}") ──► 监听传输完成         │
├─────────────────────────────────────────────────────────────┤
│  terminalStore (Zustand)                                    │
│  ├─ connectedConnections: ConnectedConnection[]             │
│  │   └─ rootPane: SplitPane (支持嵌套分屏)                   │
│  ├─ allConnections: Connection[] ──────► 所有连接(启动预加载)│
│  ├─ availableFonts: string[] ──────────► 字体列表(缓存)     │
│  ├─ restoreConnection() ──────────────► 恢复连接(新窗口)    │
│  └─ activeConnectionId: string                              │
└─────────────────────────────────────────────────────────────┘
                              │
                              │ Tauri IPC / Events
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                     后端 (Rust + russh)                      │
├─────────────────────────────────────────────────────────────┤
│  init_database (启动时调用)                                   │
│  ├─ 初始化 SQLite 数据库                                      │
│  ├─ 清理过期命令历史 (90天)                                   │
│  ├─ 清理孤立命令历史 (连接已删除)                              │
│  └─ 清理无效命令历史 (含 tab 字符)                            │
├─────────────────────────────────────────────────────────────┤
│  get_shell(id, AppHandle)                                   │
│  ├─ 创建 SSH channel (async)                                │
│  └─ tokio::spawn reader task                                │
│       └─ tokio::select! { resize, write, wait() }           │
│       └─ emit("shell-output-{id}", data) ──► 推送到前端      │
├─────────────────────────────────────────────────────────────┤
│  create_terminal_window                                      │
│  ├─ 创建新 WebviewWindow                                     │
│  └─ emit("terminal-window-init", data) ──► 发送初始化数据    │
├─────────────────────────────────────────────────────────────┤
│  upload_file / download_file                                │
│  ├─ 创建独立 SSH 连接 (不阻塞 Shell)                         │
│  └─ tokio::spawn 后台传输任务                                │
│       └─ 每 200ms emit("transfer-progress-{id}")            │
│       └─ emit("transfer-complete-{id}") 完成通知             │
├─────────────────────────────────────────────────────────────┤
│  全局状态 (once_cell::Lazy + tokio::RwLock)                  │
│  ├─ SESSIONS: HashMap<id, SshSession>                       │
│  ├─ SHELLS: HashMap<id, ShellSession>                       │
│  └─ SFTP_SESSIONS: HashMap<id, SftpSessionState>            │
└─────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 587 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 · 587 lines · 7,648 tokens per session scan C 9cce593e62aa

Subscribe to this mod's changes

iterminal AGENTS.md is an instructions file published in the GitHub repository iTophua/iterminal (4 stars, last pushed 3d ago), licensed MIT. It adds 7,648 tokens to every session, about $0.0382 per session on Opus 5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

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