Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8,978 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chutescoder is a coding agent that runs in your terminal and treats its own context as a variable.

A fork of OpenAI Codex, rebuilt around the ideas in Prime Intellect's Prime Agent, tuned for Chutes-hosted models.


The idea

A conventional coding agent gets a fixed menu of tools and fills in one JSON form per action. Reading twelve files is twelve round trips, and all twelve files end up in the context window whether you needed them or not.

chutescoder's RLM mode gives the model exactly one tool: python. It runs in an IPython kernel that lives for the entire session. Everything else — shell, file edits, patches, search, MCP, sub-agents — is a function inside that kernel.

# one turn, not twelve
files   = [p for p in list_dir("src", depth=3) if p.endswith(".py")]
sources = {p: read_file(p) for p in files}
suspect = {p: s for p, s in sources.items() if "eval(" in s}
print(len(files), "scanned;", len(suspect), "suspects:", list(suspect))

The model sees the two-line summary. The 812 files stay in the kernel, addressable for the rest of the session.

Four consequences

Context as a variable. ctx is the whole transcript, as data — including the turns compaction already evicted from the model's window.

ctx.grep("TimeoutError")   # searches turns the model can no longer see
len(ctx.dropped)           # they are still fully readable here

Output stops being the bottleneck. A cell producing 50 000 rows returns a descriptor plus a head/tail excerpt; the rows live on as out[7].

Delegation is a function call.

findings = await rlm.map([f"Audit {m} for injection" for m in modules], concurrency=6)

Each sub-agent gets its own model, kernel and context window. It reads 200k tokens; you get back a paragraph.

The harness edits itself.

rlm.harness.create_memory("flaky-net-test",
    "tests/net/test_retry.py fails ~1 in 5; re-run before investigating")
rlm.harness.create_skill("release", description="cut a release", body=RUNBOOK)

Skills and memories change the system prompt on the next turn and persist across sessions. Only a skill's name and description sit in the prompt; the body loads when the model asks for it.

Quickstart

git clone https://github.com/chutesai/chutescode
cd chutescode/codex-rs
cargo build --release --bin chutescoder

python3 -m pip install ipython dill        # the kernel's requirements

~/.chutescoder/config.toml:

model_provider = "chutes"
model = "moonshotai/Kimi-K3-TEE"

[model_providers.chutes]
name = "Chutes"
base_url = "https://responses.chutes.ai/v1"
env_key = "CHUTES_API_KEY"
wire_api = "responses"
request_max_retries = 6
stream_idle_timeout_ms = 900000

[rlm]
enabled = true

Then:

export CHUTES_API_KEY=...
chutescoder                                                # interactive
chutescoder exec "fix the failing test in tests/parser"    # headless

With rlm.enabled = false, chutescoder is upstream Codex. That is deliberate: it makes "does this harness actually help?" a question you can answer with one binary and one flag, holding the model, the sandbox and the task set constant.

Documentation

the harness design codex-rs/chutes-rlm/DESIGN.md
the kernel wire protocol codex-rs/chutes-rlm/PROTOCOL.md
what the model is told codex-rs/chutes-rlm/prompts/rlm_mode.md
changes vs. upstream CHANGES-FROM-UPSTREAM.md

Everything upstream Codex documents — sandboxing, MCP, skills, hooks, codex exec, the SDKs — still applies; see docs/ and the original upstream README.

Relationship to upstream

chutescoder is a modified fork of openai/codex at commit 6bb6e90, distributed under the same Apache License 2.0. Files have been changed; see CHANGES-FROM-UPSTREAM.md and git diff upstream/main.

The RLM harness is an original implementation. Its design re-implements ideas published by Prime Intellect in Prime Agent; no Prime Agent code is used — that project is TypeScript on pi, this is Rust on Codex.

OpenAI and Prime Intellect do not endorse this fork.

Licence

Apache-2.0. See NOTICE.

About

Lightweight coding agent that runs in your terminal

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages