zby

Treadle — AI skill for Claude Code

AI community

Write workflows in Pydantic AI.

How to install Treadle

This entry records only its repository, not the path inside it, so there is no exact command to give. Open zby/treadle and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Treadle does

Write workflows in Pydantic AI. Run them through Claude Code, Codex, pi, or any agent harness.

Alternatives in AI

  • ARIS Agent Guide — For AI agents reading this repo 6.2k ★
  • Desktop Cc Gui — Multi-engine AI coding desktop client (Tauri) 4.4k ★
  • EchoBird — One-click install + model switch:Claude Code,Codex CLI (OpenAI), Grok Build (xAI), DeepSeek Harness, Kimi Code 3.1k ★

README

Treadle

**Write a workflow once. Run it in Pydantic AI or through your agent harness.**

You can run a [Pydantic AI](https://ai.pydantic.dev) workflow directly in Python, but you may want the work done inside Claude Code, using its agents, tools and subscription access rather than making separate model API calls from Python. Starting that Python script from Claude Code still sends requests to the model configured for the Python run; it does not hand them to Claude Code's agents.

Treadle makes the same workflow usable through Claude Code, Codex, pi or another harness. It turns model calls into prompts for the harness's workers and returns their committed answers to the workflow. Branches, loops and parallel work stay in ordinary Python; workers use their harness's shell, editor or browser. This is a portable API from code to harness: **prompts out, committed answers back**.

The orchestrator is the transmission: it runs `treadle step`, dispatches the printed prompts, makes sure responses are committed, and repeats. The workflow decides what happens next. Treadle does not include built-in harness dispatch integrations.

Python workflow → Treadle prompts → orchestrator → harness workers
                ← committed answers ←───────────┘

**Status:** Early working prototype, tested with fake models and live agents in Pi, Claude Code and Codex. Treadle is an independent project, not affiliated with Pydantic.

One call, end to end

[examples/explain.py](examples/explain.py) is a complete workflow. The agent has a name but no configured model; step mode supplies Treadle's model adapter.

from pydantic_ai import Agent

explainer = Agent(
    name="explainer",
    instructions="Explain the topic in one clear, concrete paragraph.",
)


async def workflow(topic: str) -> str:
    return (await explainer.run(f"Explain {topic}.")).output

From the repository, install dependencies and request the first prompt:

uv sync --locked
uv run tr