Skip to main content
pcode in a dark terminal pcode in a light terminal

pcode

pcode is a terminal-native coding agent that lets you change what's visible in your scrollback, even after the work is done. Expand commands, output, and diffs when you need the details; hide them when you want to read the conversation. The same history, with the detail you choose.

Long-running commands continue in the background and wake the agent when they finish. Run sessions in separate git worktrees, or rewind and branch a conversation to try another approach.

  • Slow work doesn't block you. Long commands become background jobs, and a finished job wakes the agent, so it can watch tests or CI and fix what fails.
  • Agents in parallel. A git worktree per session lets several agents work on one repo at once.
  • Rewind and fork. /tree returns to any point in a conversation and branches from there. Every session is kept, so you can resume or search it.
  • Change your view, not your history. Show or hide commands, output, and diffs throughout the conversation. Hidden output stays available, and /tools lets you inspect every tool call and its full output.

It runs on any model Pydantic AI supports, or on your Claude or ChatGPT subscription.

Documentation: cruxwell.github.io/pcode

Tried it? Share feedback: what worked, what didn't, and where you got stuck.

Install

With Homebrew:

brew tap cruxwell/pcode https://github.com/cruxwell/pcode.git
brew install cruxwell/pcode/pcode

Or from PyPI with uv:

uv tool install --python 3.15 'pcode[claude]'

brew install --HEAD tracks master instead of the latest release.

Quick start

pcode -m claude:claude-sonnet-5              # Claude subscription; run /login claude if not signed in
pcode -m openai-codex:gpt-5.6-luna           # ChatGPT subscription (/login openai-codex)
pcode -m anthropic:claude-sonnet-5           # or any provider, with its API key set
pcode                                        # reuses the model /model (Ctrl+L) saved; with none, an offline preview
pcode -C /path/to/repo "Summarize the open TODOs"
git diff | pcode -p --no-save                # non-interactive: reply to stdout
pcode --continue                             # resume this directory's newest session
pcode --theme-preview                        # offline sample output and the style gallery

The agent edits files and runs shell commands with your permissions and no approval prompt. Read tool permissions before pointing it at anything you care about.

More

  • Your subscription: Claude runs through Anthropic's own Agent SDK and Claude Code login (the route Anthropic supports), and ChatGPT through a Codex login. See providers.
  • Email remote control: send a task from Gmail on your phone, reply to keep going, and take the session over at a terminal with pcode --attach.
  • Custom keybindings and Vim editing: map keys to commands with arguments, add a Space leader in normal mode, or use jj to leave insert mode.
  • /btw side questions, background sessions, recall of past sessions, a browser the agent can drive, and Python extensions.
  • Built on Pydantic AI's Harness coder, with MCP (OAuth and tool search), searchable sessions, jobs and worktrees on top. Extensions are plain Pydantic AI capabilities. The conversation tree follows pi's.

See PLAN.md for the longer-term direction.

Documentation

Page What it covers
Getting started Homebrew, uv and source installs, signing in, --print, shell completion
Scrollback and transparency Guide: what goes into scrollback, /tools, /diffs
A shell for long-running work Guide: background jobs, watching CI
Parallel agents Guide: worktrees, parallel sub-agents, /agents
Extending pcode Guide: extensions, skills, settings
Providers and models Authentication, supported providers, the model picker, reasoning effort, Claude Code, proxies
Configuration pcode config, per-repository overrides, trusting repository code, the settings table, syntax styles
Commands and keys Slash commands, key bindings, vi mode, tmux newlines, status line, !command, the diff and tool inspectors
Keybindings Custom command mappings with /bind, Ctrl shortcuts, vi editing, a normal-mode leader, and custom escape sequences such as jj
Terminal setup Tab titles, the progress bar, symbols and colors, iTerm2 and tmux settings
Tools Tool permissions, web search, the browser, code mode
MCP servers Opt-in MCP configuration, OAuth sign-in, deferred tool search
Working in a repository AGENTS.md/CLAUDE.md, skills as slash commands, one worktree per session
Sessions and recovery Saving, resuming, recalling earlier sessions, checkpoints, retries
Context, limits and caching Prompt overhead, compaction, output limits, prompt cache notices
The transcript What lands in scrollback: diffs, thinking, errors, command output, /redraw
Email remote control Driving a session from Gmail, the remote profile
Conversation tree /tree: rewinding and forking a conversation
Side questions /btw: asking about the running turn without interrupting it

The same pages build into a browsable site with make docs-serve; make docs checks every page and anchor link.

Contributing

Bugs: open an issue. Feedback and ideas: the feedback discussion. Security problems: see SECURITY.md. Setup and checks are in CONTRIBUTING.md.

make test        # fast suite; real-tmux regressions skipped
make test-all    # everything, before touching layout, streaming, the editor, or the prompt

AGENTS.md has the worktree workflow and the traps worth knowing before editing. Contributor notes (architecture, dependencies, profiling, prompt caching, provider design) live in dev/, outside the published docs.

Metadata

Release files for pcode 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pcode 0.1.9
File Size Uploaded Provenance Actions
pcode-0.1.9.tar.gz 684.6 kB With provenance Details for pcode-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pcode 0.1.9
File Interpreter ABI Platform Actions
pcode-0.1.9-py3-none-any.whl Python 3 none any Details for pcode-0.1.9-py3-none-any.whl

Total release size: 1.5 MB

Release files / pcode-0.1.9.tar.gz

Download URL pcode-0.1.9.tar.gz
Size 684.6 kB
Tags Source
SHA-256 checksum
How to use checksums
86f90e644ea586c43ee2680d62256cbd388c8ef7c6815f76c503084e84df2c3f
BLAKE2b-256 checksum
How to use checksums
8f8b73c74a36f30fa7f551a3a2992c8f8f8f8584266e82e413b7390e0a3e9dac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / pcode-0.1.9-py3-none-any.whl

Download URL pcode-0.1.9-py3-none-any.whl
Size 769.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8613c4d2c667c5136a7dad9e4a0add1628d95cbca5a050794051a58b90548fcf
BLAKE2b-256 checksum
How to use checksums
9e532849f5a7c1497ed1ab57b3482cb39e9a5aadf478db6cecf2cab45eade243
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for pcode 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pcode-0.1.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page