terminal-output-tail-trim

terminal-output-tail-trim is a skill for Claude Code, Codex from humanerd-drew/opencode-drewgent. It costs 51 tokens per session (2,051 once invoked), scanned A, original, MIT.

A terminal-output setting that limits how much command output is returned by default, with options to show only the first or last lines.

In plain words
What is it for?
It is for making output from tests, builds, installs, and other noisy terminal commands shorter and easier to read.
Why use it?
It keeps verbose command results from filling the agent's context with text that may not be needed. The head and tail options retain either the beginning or end of output for quick inspection.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for making output from tests, builds, installs, and other noisy terminal commands shorter and easier to read.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/humanerd-drew/opencode-drewgent/terminal-output-tail-trim
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.

Any agent
npx skills add humanerd-drew/opencode-drewgent --skill terminal-output-tail-trim
Clone the repo
git clone --depth 1 https://github.com/humanerd-drew/opencode-drewgent

Made for: Claude Code, Codex.

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 terminal-output-tail-trim

README.md
[![agentmods](https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/terminal-output-tail-trim/github.svg)](https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/terminal-output-tail-trim)
Your own site
<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.

agentmods 80×15 button for terminal-output-tail-trim

Your own site · 80×15
<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>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,051 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00051 $0.02051
Opus 5 $0.00026 $0.01026
Sonnet 5 $0.00010 $0.00410
Haiku 4.5 $0.00005 $0.00205

Measured 5d ago against content hash 5105c40a6c4a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

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.

skills/software-development/terminal-output-tail-trim/SKILL.md · 110 lines

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.pyterminal_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 순):

  1. tail_lines > 0 → 마지막 N줄
  2. head_lines > 0 (and tail_lines not set) → 처음 N줄
  3. else → truncate_chars 초과 시 40/60 head/tail split

적용 위치 (총 4개):

  1. terminal_tool() signature — 3 param + docstring
  2. terminal_tool() body (L1368 부근) — 50K cap 로직을 3-mode 로직으로 교체
  3. _handle_terminal handler — args pass-through
  4. TERMINAL_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 ✓

Read the full file on GitHub · 110 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. 5d ago First seen · 110 lines · 51 tokens per session scan A 5105c40a6c4a

Subscribe to this mod's changes

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.

Related

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"…

stablyai/orca · 163 tokens

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…

warpdotdev/warp · 69 tokens

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…

warpdotdev/warp · 82 tokens

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.

warpdotdev/warp · 44 tokens

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.

yonatangross/orchestkit · 64 tokens

notes

Create and manage text notes in the workspace.

gebruder/wirken · 10 tokens