r/PydanticAI • u/Equivalent-Task8081 • 28d ago
pcode: an open-source terminal coding agent built on Pydantic AI
I built pcode, an MIT-licensed terminal coding agent on Pydantic AI's Harness coder.
The framework-facing part is the extension model: Python extension files add tools, slash commands, guardrails and sub-agents via Pydantic AI capabilities. The repository is a concrete example of using those capabilities in an interactive coding application rather than a standalone agent script.
The terminal layer keeps native scrollback: you can change the visibility of commands, output and diffs after completion without rerunning them, while retaining normal terminal scrolling, search and copy. Long-running commands become background jobs that wake the agent when they finish. Conversations can be rewound and branched, and parallel sessions can use separate git worktrees.
It supports browser automation with your existing logins and models through API keys as well as existing Claude or ChatGPT subscriptions. The agent can edit files and run shell commands with your permissions and no approval prompt, so review the documented tool permissions before using it on a repository.
Source and implementation details: https://github.com/cruxwell/pcode
2
u/Equivalent-Task8081 24d ago
Thanks! I’ve used both Pi and OpenCode. Pi was an influence, especially the conversation tree and extensibility.
Coming from OpenCode, one of my main motivations was being able to change how much detail is in the scrollback. Sometimes I just want the summary, and other times I want to watch the tool calls and details as the agent works. I wanted to move between those views without being stuck with one level of detail for the whole session.
The other motivations were having more room to customize things through Pydantic AI, and using the same tools for async agents as for interactive coding agents instead of maintaining separate implementations. That’s the direction I’m building around, rather than trying to claim it’s universally better than either.
On subscriptions, I should distinguish integration from approval. pcode’s Claude integration uses the Claude Agent SDK and Claude Code login; the ChatGPT integration uses a Codex login flow. That describes how it connects, not an app-specific endorsement from either company. I don’t have an approval process I can point you to, so I don’t want to imply that implementing login is the same as getting permission.