pyrycode

module
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: MIT

README

Pyrycode

A process supervisor and runtime for Claude Code. Run pyry instead of claude to get a long-lived, self-healing host for your AI assistant — with a control socket for status, logs, graceful shutdown, and detach/reattach from any shell.

Status

Phase 0 complete and exercised. Foreground mode is a drop-in claude wrapper with auto-restart. Service mode runs pyry under launchd or systemd and exposes a Unix-socket control plane. The next milestone (Phase 0.5) is using pyry as the daily-driver supervisor on a real Linux box, replacing the prior tmux + bash restart-loop setup.

Production hardening — multi-session routing, Channels integration, in-process knowledge capture, remote access, voice — is on the roadmap (see docs/plan.md).

What it does

  • Supervises claude in a pseudo-terminal with crash recovery and exponential backoff.
  • Resumes the previous session on every restart so conversation history survives crashes.
  • Two modes from one binary. Run from a TTY for interactive development; run under a service manager (no TTY) for production. The same binary auto-detects and adapts.
  • Control plane on a Unix socket. Query state, stream logs, request shutdown, attach a terminal — all from any shell, with single-user filesystem permissions as the security boundary.
  • CLI transparency. Anything pyry doesn't recognise is forwarded to claude verbatim. Pyry's own flags use a -pyry-* prefix so they never collide.

Platforms

Linux and macOS. Windows is out of scope (different PTY backend, different signal model).

Install

Pyrycode is not yet published as a binary release. Build from source:

git clone https://github.com/pyrycode/pyrycode
cd pyrycode
make build           # ./pyry
./pyry version

Requires Go 1.23 or later and a working claude binary on PATH.

Cross-compile for a remote machine:

make linux           # dist/pyry-linux-amd64
make dist            # adds darwin/arm64 and darwin/amd64

Quickstart

Foreground (development). Run pyry instead of claude:

pyry "summarize foo.md"           # forwarded as claude's initial prompt
pyry --model sonnet -p "..."      # any claude flag passes through

If claude exits, pyry restarts it with --continue so you keep your session.

Service mode (production). Run pyry under launchd or systemd. The supervised claude has no terminal of its own; you connect to it on demand:

pyry attach    # your terminal becomes claude's terminal
               # press Ctrl-B d to detach — pyry stays running

pyry status, pyry logs, and pyry stop work from any shell.

For the full walkthrough — including multi-instance, deployment under systemd / launchd, and troubleshooting — see docs/guide.md.

Documentation

Development

make check           # vet + race-enabled tests + staticcheck
make build           # ./pyry
make linux           # cross-compile for Linux

CODING-STYLE.md covers Go conventions used in the repo.

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
pyry command
Command pyry is the Pyrycode daemon — a process supervisor for Claude Code.
Command pyry is the Pyrycode daemon — a process supervisor for Claude Code.
internal
control
Package control implements pyry's local control plane: a Unix domain socket that lets clients (such as `pyry status`) query the running daemon.
Package control implements pyry's local control plane: a Unix domain socket that lets clients (such as `pyry status`) query the running daemon.
install
Package install writes service-manager unit files (systemd, launchd) for pyry.
Package install writes service-manager unit files (systemd, launchd) for pyry.
supervisor
Package supervisor runs Claude Code under process supervision: spawn in a PTY, stream I/O transparently to the controlling terminal, and restart the child with exponential backoff when it exits.
Package supervisor runs Claude Code under process supervision: spawn in a PTY, stream I/O transparently to the controlling terminal, and restart the child with exponential backoff when it exits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL