pyccode is a minimal Python extraction of repository A.
It follows the engineering strategy proven in repository b:
- do not rebuild the full product shell first
- extract the smallest useful agent and tool loop first
- keep the implementation compact, readable, and testable
Semantically, pyccode is guided by repository A rather than by OpenAI Codex:
- the main turn loop follows A's query pipeline
- tool registration and orchestration follow A's tool abstractions
- the model request layer follows A's Anthropic Messages path
- prompt and context injection follow A's prompt and message assembly flow
The current implementation provides:
- a minimal multi-turn agent loop
- a complete
tool_use/tool_resultloop - an Anthropic Messages adapter shaped after A's non-bare request path
- a minimal CLI
- the 22 tool names and input schemas observed in local non-bare A captures, declared directly in code
- a first-turn request that is now very close to the local non-bare A capture, aside from dynamic session values and a few remaining wire-level details
- unit tests covering the runtime loop, auth resolution, request shaping, tool schemas, and doctor checks
The current implementation intentionally does not include:
- the full TUI / React / Ink UI layer
- telemetry, feature flags, remote control, or internal-only modules
- full real implementations for all 22 default A-shaped tools
- the wider product surfaces such as full memory, hooks, MCP, or advanced background orchestration
Install dependencies:
cd <repo-root>
uv syncSet a model and API credentials:
export ANTHROPIC_API_KEY=...
export ANTHROPIC_MODEL=...Run a single prompt:
uv run pyccode "Summarize this repository in one sentence."Run the interactive CLI:
uv run pyccodeRun environment diagnostics:
uv run pyccode doctor --skip-live
uv run pyccode doctorExit the interactive CLI:
/exit
-
/v1/messages?beta=true - streaming SSE request/response skeleton
- Bearer / OAuth-first auth fallback chain
-
system: list[block] - the 22 tool schemas observed in the local non-bare A capture are exposed by default
- skills reminder injection
-
max_tokens = 32000default - persistent
device_idget-or-create logic - first-turn request is largely aligned with the local non-bare A capture except for dynamic
session_idvalues and a few remaining details
-
Agent -
AskUserQuestion -
Bash -
CronCreate -
CronDelete -
CronList -
Edit -
EnterPlanMode -
EnterWorktree -
ExitPlanMode -
ExitWorktree -
Glob -
Grep -
NotebookEdit -
Read -
Skill -
TaskOutput -
TaskStop -
TodoWrite -
WebFetch -
WebSearch -
Write
-
Read -
Write -
Edit -
Glob -
Grep -
Bash -
Agent -
AskUserQuestion -
CronCreate -
CronDelete -
CronList -
EnterPlanMode -
EnterWorktree -
ExitPlanMode -
ExitWorktree -
NotebookEdit -
Skill -
TaskOutput -
TaskStop -
TodoWrite -
WebFetch -
WebSearch - the older local execution subset is still available via
build_local_execution_tool_registry()
See docs/ARCHITECTURE.md for the current architectural mapping.