Skip to main content

coderio

中文 | English

The agent claims "done" without running the tests? coderio's harness stops it. A local coding agent with native Zhipu GLM & StepFun Step coding-plan support — four-tier permissions, layered sandbox, MCP, lifecycle hooks, and an interactive TUI.

demo

Install

pip install coderio
coderio    # onboarding wizard on first launch (pick provider, paste API key, auto context-window probe)

Requires Python 3.11+; Git Bash on Windows. Linux / macOS supported.

Why coderio

The shared weakness of coding agents: the model says "I'm done" and you just have to trust it. coderio turns that sentence into a structural constraint—

The Four Gates: the agent can't lie to you

Gate Behavior
VerifyGate Wrote code, never ran it, wants to finish → intercepted, forced to continue. Parses real exit codes — a failing test run does NOT count as verified
CompletionGate Declares done with pending todos → intercepted
GroundingGate Cites files it never read → intercepted
PlanGate Writes code without a todo list → soft nudge

Not a prompt-level soft rule — a system-level control based on tool-call ground truth. Claude Code and Codex don't have this.

Native Chinese coding-plan support

Zhipu GLM Coding Plan and StepFun Step Plan work out of the box (direct Anthropic-protocol connection) — your subscription quota runs a local agent, no proxies, no middle layer. Also supports OpenAI / Anthropic / Ollama / any OpenAI-compatible endpoint, with multi-profile switching.

Layered security, honestly stated

  • Four permission tiers (plan read-only / confirm per-action / auto_edit / full)
  • Command blacklist + whitelist (accident prevention); Linux bubblewrap OS sandbox (boundary enforcement)
  • First-use repo-config trust confirmation (hostile-repo protection); web_fetch SSRF protection
  • The blacklist/whitelist are accident prevention, not adversarial defense — adversarial protection comes from the sandbox + permissions; use a VM for hostile code

Feature highlights

  • Interactive TUI: streaming output, foldable thinking (Ctrl+O), collapsible TODO panel, vertical permission menu, task interruption (Esc), slash-command autocomplete, session management
  • Headless mode: coderio run "task" one-shot execution (CI / scripts / benchmarks) with graded exit codes
  • MCP support: connect external tools via .mcp.json (Claude Code-compatible format), managed with coderio mcp
  • Lifecycle hooks: [[hooks]] run your commands at PreToolUse / PostToolUse / UserPromptSubmit (exit 2 = block) — IO contract compatible with Claude Code
  • Three-layer skills: bundled + user + project, progressive disclosure saves context
  • Context governance: auto-compaction (60% window trigger), large-block offload, sqlite checkpoints across turns
  • Subagents: research (read-only, double-enforced) + general-purpose (inherits the main agent's full security stack)
  • Engineering discipline: 850+ tests, 80% coverage, mypy hard gate, uv.lock, 3 OS × 2 Python CI matrix
Config example (click to expand)
# ~/.coderio/config.toml
[model]
provider_id = "bigmodel_coding_plan"   # Zhipu/StepFun coding plan, or openai/anthropic/ollama/custom
default = "glm-5.2"

[tools]
permission_mode = "confirm"            # plan | confirm | auto_edit | full
sandbox_mode = "off"                   # off | job (resource limits) | write (Linux file-write isolation)

# Lifecycle hooks (Claude Code-compatible contract)
[[hooks]]
event = "PreToolUse"
matcher = "write_file|edit_file"
command = "python .hooks/protect.py"   # JSON on stdin; exit 2 = block

MCP, the sandbox 4-tuple, and more: docs/coderio-architecture.md.

Common commands

coderio                                              # interactive TUI
coderio run "fix the failing test" --quiet           # headless one-shot
coderio run "task" --dangerously-skip-permissions    # full access (explicit opt-in)
coderio mcp add github --type http --url ...          # manage MCP
coderio skills install                               # install skill suites

Type / inside the TUI for all commands (/resume sessions, /mode permissions, /profile configs, /think unfold reasoning).

Known limitations

  • The Windows write-sandbox currently equals job mode (true isolation awaits the ACL work — documented honestly)
  • Blacklist/whitelist are accident-prevention by design (regex can be bypassed by obfuscation); use the sandbox / a VM for adversarial scenarios

Origin

A spare-time project, open-sourced as a working reference for developers building their own coding agents. The name is code + rio (the author's English name is Lion; "codelion" sounded odd).

Contributing & License

Issues and PRs welcome — see CONTRIBUTING.md. MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coderio-0.4.3.tar.gz (598.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coderio-0.4.3-py3-none-any.whl (284.4 kB view details)

Uploaded Python 3

File details

Details for the file coderio-0.4.3.tar.gz.

File metadata

  • Download URL: coderio-0.4.3.tar.gz
  • Upload date:
  • Size: 598.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for coderio-0.4.3.tar.gz
Algorithm Hash digest
SHA256 f428a6dfcd5b76d7274336a4746181288bc789dc47170d178a9cc3e04f9bf3c0
MD5 a351e37ecac99bc85b860b3208029c0d
BLAKE2b-256 10730495bd81de8a8e19266958fa074a5bb0bcf75d6a0d2afd2ada5f44ec3dde

See more details on using hashes here.

Provenance

The following attestation bundles were made for coderio-0.4.3.tar.gz:

Publisher: release.yml on Lion-1209/coderio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coderio-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: coderio-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 284.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for coderio-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1b5ff8af8945055d2031ed1dd07abfb75981c3d03ec6de6274f7d0de903bda61
MD5 8522cf18283c465c3c7c29092ebfab8f
BLAKE2b-256 534ab5bf130031d4e55c0be672727b57db9de6afc955cafaf4fcea41d5c0d11d

See more details on using hashes here.

Provenance

The following attestation bundles were made for coderio-0.4.3-py3-none-any.whl:

Publisher: release.yml on Lion-1209/coderio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.4

2 files

This release

0.4.3 This release

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page