Skills for Real Engineers. Straight from my .agents directory.
hive.terminal-tools-pty-sessions
Agent skill fromaden-hive/hive
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, mysql connection). Teaches the prompt-sentinel exec pattern (default mode), raw I/O for REPLs (raw_send=True then read_only=True), the one-in-flight-per-session rule, and the close-or-leak-against-the-cap discipline. Bash on macOS — never zsh; explicit shell=/bin/zsh is rejected. Read before calling terminal_pty_open.
How to install hive.terminal-tools-pty-sessions
npx skills add aden-hive/hive# or add only this skill to Claude Code: copy the folder
core/framework/skills/_preset_skills/terminal-tools-pty-sessions/
# into
~/.claude/skills/terminal-tools-pty-sessions/ (all projects)
.claude/skills/terminal-tools-pty-sessions/ (one project)
1# Persistent PTY sessions23PTY 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:45- You need state to persist across calls (`cd`, env vars, sourced scripts)6- You're driving a REPL (`python -i`, `mysql`, `psql`, `node`, `irb`)7- A program demands an interactive prompt (`sudo`, `ssh`, `npm login`, `gh auth login`)89For 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).1011## Why PTY (and not subprocess pipes)1213Subprocess 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.1415The 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.1617## Bash on macOS — by deliberate policy1819`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.2021Reasons:22…
Excerpt shown under the repository's Apache-2.0 license.
More skills in hive
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
