[BUG] Claude.app PID held 511/511 ptys with only 19 living children, uptime 2d18h.

Resolved 💬 1 comment Opened Jun 19, 2026 by mvoshell652 Closed Jun 22, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The Claude desktop app on macOS leaks pseudo-terminal (pty) file descriptors over time. After 2–3 days of normal usage, the app accumulates ptys until it hits the system-wide limit (kern.tty.ptmx_max, default 511). Once at the cap, every process on the machine that needs a pty fails with:

forkpty: Device not configured
Could not create a new process and open a pseudo-tty.

This breaks not just Claude — it breaks Terminal.app, iTerm, VS Code's integrated terminal, and anything else that allocates a pty, until Claude is quit.

What Should Happen?

The Claude app should close each pty file descriptor when its corresponding child process exits. The held-pty count should stay roughly proportional to currently-running children, not grow unbounded with app uptime.

Error Messages/Logs

forkpty: Device not configured
Could not create a new process and open a pseudo-tty.

Diagnostic captured during the incident:

$ ls /dev/ttys* | wc -l
527

$ sysctl kern.tty.ptmx_max
kern.tty.ptmx_max: 511

$ lsof /dev/ptmx | tail -n +2 | awk '{print $1}' | sort | uniq -c
 511 Claude

$ ps -o pid,etime,comm -p 96916
  PID     ELAPSED COMM
96916 02-18:59:39 /Applications/Claude.app/Contents/MacOS/Claude

$ pgrep -P 96916 | wc -l
10

A single Claude process (PID 96916) held 511/511 ptys with only 10 direct children
and 19 total descendants. ~492 ptys were orphaned — children had exited but their
pty fds were never closed by the parent.

Steps to Reproduce

  1. Launch Claude.app on macOS
  2. Use Claude Code sessions normally (heavy Bash-tool usage is the fastest accelerant)
  3. Leave the app running for 2–3 days of regular use without quitting
  4. Periodically check held ptys:

lsof /dev/ptmx | grep -c Claude

  1. The count grows monotonically and never drops, even when sessions are closed
  2. Once it reaches kern.tty.ptmx_max (511 by default), every new pty allocation system-wide fails
  3. Quitting Claude (⌘Q) releases all fds and resets the cycle

Observed leak rate in my case: ~180 ptys/day → hit the cap every ~3 days, reproducibly.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude 1.13576.0 (1290fc) 2026-06-16T05:46:10.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • macOS version: Darwin 25.6.0
  • Claude.app uptime when cap was hit: 2 days, 18 hours, 59 minutes
  • Workaround: quit Claude (⌘Q, not just close the window) every 1–2 days before hitting the cap
  • Severity is high because the failure mode is system-wide, not contained to Claude — any other app that needs a pty also breaks until Claude is quit
  • Reproducible: this is the Nth time the user has hit this; restart-resets-cycle pattern is consistent

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗