hive.terminal-tools-pty-sessions

hive.terminal-tools-pty-sessions is a skill for Claude Code, Codex from aden-hive/hive. It costs 134 tokens per session (1,417 once invoked), scanned B, original, Apache-2.0.

A skill for using persistent terminal sessions. A persistent session keeps its directory, environment variables, and running interactive programs between commands.

In plain words
What is it for?
Use it to drive interactive shells and REPLs, preserve environment setup across commands, and respond to terminal prompts.
Why use it?
It avoids losing state when working with command-line programs that expect a real terminal, such as Python, database consoles, SSH, or login prompts.

Skill for Claude CodeCodex

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

Good fit Use it to drive interactive shells and REPLs, preserve environment setup across commands, and respond to terminal prompts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aden-hive/hive/terminal-tools-pty-sessions
About the project

OpenHive is a runtime for groups of specialized AI agents that collaborate on long-running business processes. A persistent lead agent, called the Queen, creates and coordinates worker agents while the system manages state, recovery, observability, costs, and human oversight. The catalogue entries provide agent skills, instructions, and integrations for working with this harness.

aden-hive/hive · 11,029 stars · on GitHub

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 aden-hive/hive --skill terminal-tools-pty-sessions
Clone the repo
git clone --depth 1 https://github.com/aden-hive/hive

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 hive.terminal-tools-pty-sessions

README.md
[![agentmods](https://agentmods.dev/badge/skills/aden-hive/hive/terminal-tools-pty-sessions/github.svg)](https://agentmods.dev/skills/aden-hive/hive/terminal-tools-pty-sessions)
Your own site
<a href="https://agentmods.dev/skills/aden-hive/hive/terminal-tools-pty-sessions"><img src="https://agentmods.dev/badge/skills/aden-hive/hive/terminal-tools-pty-sessions/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 hive.terminal-tools-pty-sessions

Your own site · 80×15
<a href="https://agentmods.dev/skills/aden-hive/hive/terminal-tools-pty-sessions"><img src="https://agentmods.dev/badge/skills/aden-hive/hive/terminal-tools-pty-sessions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,417 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 80
    Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
    Fix: Limit tool chaining depth and validate the output of each tool before passing it to the next. Require explicit user approval for multi-step chains.
  • medium Privilege Escalation · line 3
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
  • medium Privilege Escalation · line 80
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
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.00134 $0.01417
Opus 5 $0.00067 $0.00709
Sonnet 5 $0.00027 $0.00283
Haiku 4.5 $0.00013 $0.00142

Measured 11d ago against content hash 5842a7c281f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

hive.terminal-tools-pty-sessions scanned grade B 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 11d 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.

description: Use when you need state across calls — building env vars, navigating with cd, driving REPLs (python -i, mysql, psql, node), or responding to interactive prompts (sudo password, ssh host-key confirmation, mys
core/framework/skills/_preset_skills/terminal-tools-pty-sessions/SKILL.md · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Persistent PTY sessions

PTY sessions are how you talk to interactive programs — programs that detect a terminal (isatty()) and behave differently when they don't see one. Use a session when:

  • You need state to persist across calls (cd, env vars, sourced scripts)
  • You're driving a REPL (python -i, mysql, psql, node, irb)
  • A program demands an interactive prompt (sudo, ssh, npm login, gh auth login)

For everything else, terminal_exec is simpler. Sessions cost more (per-session bash process, ring buffer, idle-reaping bookkeeping) and have a hard cap (TERMINAL_TOOLS_MAX_PTY, default 8).

Why PTY (and not subprocess pipes)

Subprocess pipes break on every interactive program. The moment a program calls isatty() and sees False, it disables prompts, color, line-editing, password masking, progress bars — sometimes refuses to start. PTY makes us look like a real terminal so these programs work the same as in your shell.

The cost: PTY output includes terminal escape codes (cursor moves, color codes). The session captures them as-is; if you need clean text, strip ANSI escapes in your processing layer.

Bash on macOS — by deliberate policy

terminal_pty_open always invokes /bin/bash, regardless of the user's $SHELL. macOS users: yes, even when zsh is your interactive default. This is the terminal-tools-foundations policy applied to PTYs.

Reasons:

  • zsh has command/builtin classes (zmodload, =cmd expansion, zpty, ztcp) that bypass bash-shaped security checks
  • One shell behavior across platforms eliminates "works on Linux, breaks on macOS" surprises
  • Bash is universal: any shell you've used will accept the bash subset

The bash invocation uses --norc --noprofile so user dotfiles don't leak in. PS1 is set to a unique sentinel for prompt detection. PS2 is empty. PROMPT_COMMAND is empty.

Three modes of terminal_pty_run

1. Default: send command, wait for prompt sentinel

terminal_pty_run(session_id, command="ls -la")
  → { output, prompt_after: True, ... }

Read the full file on GitHub · 128 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. 11d ago First seen · 128 lines · 134 tokens per session scan B 5842a7c281f9

Subscribe to this mod's changes

hive.terminal-tools-pty-sessions is a skill published in the GitHub repository aden-hive/hive (11,029 stars, last pushed 5d ago), licensed Apache-2.0. It adds 134 tokens to every session and 1,417 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

develop-web-game

Use when Codex is building or iterating on a web game (HTML/JS) and needs a reliable development + testing loop: implement small changes, run a Playwright-based test script with short input bursts and intentional pauses, inspect screenshots/text, and review console errors with rendergametotext.

netease-youdao/LobsterAI · 64 tokens

article-writer

Multi-style article creation skill. Supports 5 writing styles (deep analysis, practical guide, story-driven, opinion, news brief), including complete workflow: material collection → outline → content → formatting. Activated when users mention "write article", "write post", "create", or "draft".

netease-youdao/LobsterAI · 62 tokens

skin-creator

Create and apply a two-asset LobsterAI visual skin from the user's style description. Use only when the AI Skin Designer kit supplies the structured skinpack workflow marker; do not use for ordinary theme or image requests.

netease-youdao/LobsterAI · 48 tokens

content-planner

WeChat Official Account topic planning and content calendar management. Based on WeChat article search and trending analysis, generates differentiated topic recommendations and outputs structured content calendars. Activated when users mention "topic", "planning", "content calendar", "trending", or "what to write next…

netease-youdao/LobsterAI · 63 tokens

music-search

Search cloud drives for downloadable music resources (songs, albums, lossless audio). Use this skill when the user wants to download a specific song or album. Do NOT use for general music information, lyrics, or recommendations.

netease-youdao/LobsterAI · 47 tokens

skill-vetter

Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.

netease-youdao/LobsterAI · 42 tokens