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.
npx skills add lyhcode/agent-skills --skill iterm2-automationgit clone --depth 1 https://github.com/lyhcode/agent-skillsWrote 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.
[](https://agentmods.dev/skills/lyhcode/agent-skills/iterm2-automation)<a href="https://agentmods.dev/skills/lyhcode/agent-skills/iterm2-automation"><img src="https://agentmods.dev/badge/skills/lyhcode/agent-skills/iterm2-automation/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.
<a href="https://agentmods.dev/skills/lyhcode/agent-skills/iterm2-automation"><img src="https://agentmods.dev/badge/skills/lyhcode/agent-skills/iterm2-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00109 | $0.01582 |
| Opus 5.5 | $0.00044 | $0.00633 |
| Sonnet 5.5 | $0.00022 | $0.00316 |
| Haiku 4.5 | $0.00011 | $0.00158 |
Grade B, and why
iterm2-automation scanned grade B with 2 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 3mo 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
**Auto-fill sudo password prompt:** Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
result = subprocess.run( How it starts
The opening of the file, as written. The whole thing — 209 lines — stays where its author put it; the contents beside it link to each section on GitHub.
iTerm2 Automation & Scripting
Help the user automate iTerm2 with triggers, Python API scripts, and escape codes.
User's Environment
- iTerm2 3.6.8 on macOS, using zsh
- Python scripts directory:
~/Library/Application Support/iTerm2/Scripts/ - No existing Python scripts
Triggers
Triggers are regex-based rules that fire actions when matching text appears in terminal output. They're the simplest form of automation — no coding required.
Configuration Path
Settings > Profiles > Advanced > Triggers > Edit
Each trigger has:
- Regex — ICU regular expression (matched line-by-line)
- Action — What to do when matched
- Parameter — Action-specific value
- Instant — Fire immediately without waiting for newline (useful for password prompts)
Common Trigger Patterns
Highlight errors in red:
- Regex:
(?i)\b(error|fail|fatal|exception)\b - Action: Highlight Text
- Parameter: Red text color
Notification on build completion:
- Regex:
(BUILD SUCCESSFUL|Build complete|✓ Done) - Action: Post Notification
- Parameter: "Build finished"
Auto-fill sudo password prompt:
- Regex:
^\[sudo\] password - Action: Open Password Manager
- Instant: checked
Mark deployment events:
- Regex:
Deployed to (production|staging) - Action: Set Mark + Post Notification
Highlight IP addresses:
- Regex:
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b - Action: Make Hyperlink
For the full list of all 26 trigger actions, read references/trigger-actions.md.
Trigger Tips
- Triggers process the last 3 wrapped lines by default (adjustable in Advanced Settings)
- Use capture groups
\1,\2in parameters to reference matched text - "Stop Processing Triggers" action prevents subsequent triggers from firing — useful for priority ordering
- Triggers are profile-specific; use dynamic profiles to share triggers across contexts
Python API
iTerm2's Python API enables deeper automation than triggers. Scripts can create windows, monitor sessions, build custom status bar components, and respond to events.
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3mo ago First seen · 209 lines · 109 tokens per session scan B b634f28e6985
iterm2-automation is a skill published in the GitHub repository lyhcode/agent-skills (2 stars, last pushed 7mo ago), licensed MIT. It adds 109 tokens to every session and 1,582 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
iterm2-automation compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| iterm2-automationlyhcode/agent-skills | Skill | 2 | 7mo ago | MIT | B | 109 | Claude Code, Codex |
| local-ai-agentsmicrosoft/ai-agents-for-beginners | Skill | 82k | today | MIT | A | 200 | Claude Code, Codex |
| imagegenopenai/codex | Skill | 137k | today | Apache-2.0 | A | 113 | Codex |
| playwright-climicrosoft/playwright | Skill | 102k | today | Apache-2.0 | A | 19 | Claude Code |
| browser-automationopenclaw/openclaw | Skill | 396k | today | MIT | A | 36 | Claude Code |
| free-llm-apismnfst/awesome-free-llm-apis | Skill | 15k | yesterday | CC0-1.0 | A | 113 | Claude Code, Codex |
| systematic-debuggingobra/superpowers | Skill | 331k | 5d ago | MIT | A | 21 | Claude Code |