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 humanerd-drew/opencode-drewgent --skill terminal-output-tail-trimgit clone --depth 1 https://github.com/humanerd-drew/opencode-drewgentWrote 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/humanerd-drew/opencode-drewgent/terminal-output-tail-trim)<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/terminal-output-tail-trim"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/terminal-output-tail-trim/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/humanerd-drew/opencode-drewgent/terminal-output-tail-trim"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/terminal-output-tail-trim.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.00051 | $0.02051 |
| Opus 5 | $0.00026 | $0.01026 |
| Sonnet 5 | $0.00010 | $0.00410 |
| Haiku 4.5 | $0.00005 | $0.00205 |
Grade A, and why
terminal-output-tail-trim scanned grade A with 0 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.
terminal Output Tail Trim — Token-Efficient Default
Audit Finding (2026-05-31)
{{AGENT_NAME}}의 terminal tool은 50,000자 cap + 40/60 head/tail split safety net만 있었음. 50K는 safety net치고 너무 큼 — 50K ≈ 12,500 tokens. verbose 명령 (pytest, npm install, gcc) 한 번에 12.5K 토큰 context 소비. 90%의 terminal call은 <5K 출력이지만, 나머지 10%가 cap kick in → 매번 50K push.
원인: 기존 설계는 "rare huge output" 케이스만 상정. LLM이 매번 50K 받음. 12.5K 토큰은 LLM context window의 1-5%를 한 tool call이 잡아먹음.
Fix (shipped 2026-05-31)
~/.{{AGENT_NAME_LOWER}}/source/{{AGENT_NAME_LOWER}}-agent/tools/terminal_tool.py 의 terminal_tool에 3개 파라미터 추가, default cap 변경:
| param | type | default | 의미 |
|---|---|---|---|
truncate_chars |
int | 5000 (변경: 50000→5000) | Soft cap. 초과 시 40/60 head/tail split 적용 |
tail_lines |
int | None |
opt-in. 마지막 N줄만. truncate_chars 우회 |
head_lines |
int | None |
opt-in. 처음 N줄만. truncate_chars 우회 |
3개 mode는 상호 배타적 (priority 순):
tail_lines > 0→ 마지막 N줄head_lines > 0(and tail_lines not set) → 처음 N줄- else →
truncate_chars초과 시 40/60 head/tail split
적용 위치 (총 4개):
terminal_tool()signature — 3 param + docstringterminal_tool()body (L1368 부근) — 50K cap 로직을 3-mode 로직으로 교체_handle_terminalhandler — args pass-throughTERMINAL_SCHEMA— input schema에 3 properties
Effect (verified, 2026-05-31)
| 시나리오 | Before (50K cap) | After (5K default + opt-in) | 절약 |
|---|---|---|---|
| 작은 출력 (<5K) | full | full | 0% |
| 9K 출력, default | 9K | 5,068자 (40/60 head/tail at 5K) | 44% |
9K 출력, tail_lines=10 |
9K | 86자 | 99% |
9K 출력, head_lines=10 |
9K | 55자 | 99% |
9K 출력, truncate_chars=50000 (regression) |
9K | 9K (passthrough) | 0% (opt-in) |
검증된 6 시나리오 (직접 terminal_tool import 후 실행):
- T1: small output (20자) — passthrough ✓
- T2: ~9K, default — 5068자, 1131/2000 lines, head/tail at 5K ✓
- T3: tail_lines=10 — 86자, "1990 earlier lines omitted" + last 10 ✓
- T4: head_lines=10 — 55자, first 10 + "1990 later lines omitted" ✓
- T5: truncate_chars=50000 (regression) — 8892자 (no truncation) ✓
- T6: tail_lines=2 — 46자, "1998 earlier lines omitted" + 1999, 2000 ✓
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 · 110 lines · 51 tokens per session scan A 5105c40a6c4a
terminal-output-tail-trim is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (2 stars, last pushed 1mo ago), licensed MIT. It adds 51 tokens to every session and 2,051 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
orca-cli
Operate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser through the orca CLI. Use when the user says "$orca-cli", "Orca worktree", "child worktree", "spawn codex/claude in a worktree", "read/wait/send Orca terminal"…
warpctrl
Control and inspect the currently running local Warp application with the warpctrl CLI. Use this skill whenever the user asks the agent to manipulate Warp's own windows, tabs, panes, sessions, input buffer, themes, or UI surfaces; open a file in Warp; inspect local Warp state; or explain how to invoke Warp Control…
change-keybinding
Customize Warp keyboard shortcuts (keybindings, keymappings) by editing the user's keybindings.yaml file. Use when the user asks to remap a key combination, rebind an action, change a shortcut, or remove a default keybinding (e.g. "change ctrl+space to ctrl+s", "rebind the command palette to cmd+p", "remove the…
create-tab-config
Create new Warp tab config TOML files from natural-language requests. Use when the user wants a new tab config, a new tab layout, or asks for a slash command to generate a tab config.
glyph
Render an answer as ASCII art plus semantic emojis inline, right now, with no setup questions. Use for a fast visual take on status, comparisons, trade-offs, architecture, or any ad-hoc 'show me X visually' ask. For a full multi-artifact plan playground, use visualize-plan instead.
notes
Create and manage text notes in the workspace.