iterminal: Instructions file for Codex

AGENTS.md

iterminal AGENTS.md is an instructions file for Codex, OpenCode from iTophua/iterminal. It costs 7,712 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

Written for Codex and OpenCode: the file is AGENTS.md.

This is iTophua/iterminal's own configuration. It tells Codex and OpenCode how to work on iterminal 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 iterminal configures →

Reuse

Borrowing it

Nothing to install: this file belongs to iTophua/iterminal. 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/iTophua/iterminal/main/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/github.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/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 iterminal AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/itophua/iterminal/agents-md"><img src="https://agentmods.dev/badge/instructions/itophua/iterminal/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7,712 This file is loaded in full into every session.
When invoked 7,712 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.07712 $0.07712
Opus 5.5 $0.03085 $0.03085
Sonnet 5.5 $0.01542 $0.01542
Haiku 4.5 $0.00771 $0.00771

Measured 18d ago against content hash 926316c7b028, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 18d 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. 18d ago Changed · +64 tokens per session 926316c7b028
  2. 2mo 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 8d ago), licensed MIT. It adds 7,712 tokens to every session, about $0.0308 per session on Opus 5.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

iterminal AGENTS.md compared with instructions from other repositories

iterminal AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
iterminal AGENTS.mdiTophua/iterminalInstructions file48d agoMITC7,712Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode ai-customization.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA1,907GitHub Copilot