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 agentmods add skills/lyhcode/agent-skills/iterm2-automationnpx 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.svg" alt="Measured on agentmods" 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 | $0.00055 | $0.00791 |
| Sonnet 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 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.
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.
- 5d 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 5mo ago), licensed MIT. It adds 109 tokens to every session and 1,582 once invoked, about $0.0005 per session on Opus 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.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…