Skip to content

[Feature Request] Add a native interactive PTY session tool (session handle, incremental prompt I/O, and EOF handoff) #112386

Backlog

Description

@zsicheng0214

Problem

Claude Code's Bash tool executes commands non-interactively and does not expose a native, stateful PTY session handle for interactive CLIs, REPLs, debuggers (gdb/pdb/lldb), or line-prompted maintenance tools (fsck-style confirmation loops).

In our containerized evaluation of Claude Code 2.1.332 across 95 tasks on TraceTrial-Bench (arXiv:2610.32285), Claude Code scored 80.4% across Execution (E) overall, but interactive PTY tasks were the single sharpest drop in Execution:

Task Agent Score Harness Score Observed Behavior (2.1.332)
E9-ptyfsck-001 50.0% 25.0% No real interactive PTY handle; line prompts and post-EOF completion were not observable to the model
E9-ptyrepl-002 50.0% 25.0% Interactive REPL prompt and follow-up output after EOF were not reliably captured

Proposed Feature

Expose a native interactive PTY tool (e.g., PtyStart / PtyWrite / PtyRead / PtyClose, or an interactive session mode on Bash) that provides:

  1. A persistent session handle attached to a real pseudo-terminal (isatty() == true);
  2. Incremental prompt-aware reads (returning partial line prompts without requiring a trailing newline);
  3. Explicit EOF (Ctrl-D) / signal (Ctrl-C) delivery with clean exit-status and trailing-output capture.

Reproducibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:basharea:toolsenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions