<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged codex</title>
<link>https://coderlegion.com/tag/codex</link>
<description>Powered by Question2Answer</description>
<item>
<title>Meta-Architect for AI Coding Agents</title>
<link>https://coderlegion.com/25781/meta-architect-for-ai-coding-agents</link>
<description>&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=11385886575204290620&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;p&gt;AI coding agents can generate code quickly. The hard part is knowing whether the architecture makes sense, dependencies are real, logic holds, security was checked, and “done” is actually verified.&lt;/p&gt;

&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.producthunt.com/products/meta-architect/reviews/new?utm_source=badge-product_review&amp;amp;utm_medium=badge&amp;amp;utm_source=badge-meta-architect&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://api.producthunt.com/widgets/embed-image/v1/product_review.svg?product_id=1217323&amp;amp;theme=light&quot; alt=&quot;Meta-Architect - Codex skills for architecture and system design | Product Hunt&quot; style=&quot;width: 250px; height: 54px;&quot; width=&quot;250&quot; height=&quot;54&quot;&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href=&quot;https://www.producthunt.com/products/meta-architect/launches/meta-architect?embed=true&amp;amp;utm_source=badge-featured&amp;amp;utm_medium=badge&amp;amp;utm_campaign=badge-meta-architect&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img alt=&quot;Meta-Architect - Skills for architecture and system design | Product Hunt&quot; width=&quot;250&quot; height=&quot;54&quot; src=&quot;https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1137574&amp;amp;theme=neutral&amp;amp;t=1788059656049&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h4 id=&quot;meta-architect-is-an-open-source-workflow-governor-for-ai-coding-agents-&quot;&gt;Meta-Architect is an open-source workflow governor for AI coding agents.&lt;/h4&gt;
&lt;p&gt;It adds a fail-closed release runway:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`Architecture → Evidence → Logic → Security → Experience → Build&lt;/code&gt;`&lt;br&gt;
A build stays locked until the required upstream gates pass. Red stays red.&lt;/p&gt;
&lt;h3 id=&quot;what-it-includes&quot;&gt;What it includes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;6 gated lanes — $arch, $sage, $flow, $vet, $vibe, and $build&lt;/li&gt;
&lt;li&gt;$maestro — a bounded manager that reads workflow state and choose the next safe action&lt;/li&gt;
&lt;li&gt;11 public skills — including $align, $diagnose, $tdd, and $cleanup&lt;/li&gt;
&lt;li&gt;Evidence grading — stack claims are marked VERIFIED, PARTIAL, or MISSING through GitMCP/MCP sources&lt;/li&gt;
&lt;li&gt;Learning Loop — learnings begin as candidates and require source, evidence, authority, and a next verification path before promotion&lt;/li&gt;
&lt;li&gt;Obsidian brain context — vault notes inform planning as vault_context; they do not become build evidence automatically&lt;/li&gt;
&lt;li&gt;Ralph execution — approved plans become story-sized,  verification-backed implementation loops&lt;/li&gt;
&lt;li&gt;Security and release proof — MCP policy, redaction, dependency/exposure review, issue-linked evidence, checksums, SBOMs, and release summaries&lt;/li&gt;
&lt;li&gt;55 supported AI-agent hosts through the Universal Plugin Broker compatibility model&lt;/li&gt;
&lt;li&gt;Native Linux packages for Debian, Arch, and RPM, plus npm and Bash installation paths&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;why-it-s-different&quot;&gt;Why it’s different&lt;/h3&gt;
&lt;p&gt;Most spec tools organize what an agent writes.&lt;/p&gt;
&lt;p&gt;Meta-Architect governs what an agent can claim to have proven.&lt;/p&gt;
&lt;p&gt;It separates discovery from evidence, context from authority, helper work from gate approval, and “looks finished” from verified build readiness.&lt;/p&gt;
&lt;h3 id=&quot;-quick-start&quot;&gt;🧩 Quick start&lt;/h3&gt;
&lt;h4 id=&quot;ai-agent-installation-prompt&quot;&gt;AI agent installation prompt&lt;/h4&gt;
&lt;p&gt;Copy and paste this prompt into your AI coding agent:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Install Meta-Architect for this project.

1. Detect the current AI host and its native project configuration surface.
2. Install or update `@jstn-sdk/ma@latest` using the host's supported package manager.
3. Set `MA_AGENT` to the detected host ID when a host-specific surface is available.
4. Run `ma setup` and accept the detected project scope and targets.
5. Verify the generated `.ma/` state and native host artifacts.
6. Report the installed version, selected host, generated files, and any unsupported capabilities.

Do not overwrite user-owned files, modify unrelated configuration, or claim a host is supported without verification.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Uninstall Meta-Architect: &lt;code&gt;npm uninstall -g @jstn-sdk/ma&lt;/code&gt;&lt;br&gt;
Uninstall Meta-Architect and Codex: &lt;code&gt;npm uninstall -g @jstn-sdk/ma @openai/codex&lt;/code&gt;&lt;/p&gt;
&lt;h4 id=&quot;install-into-an-ai-vendor-host&quot;&gt;Install into an AI vendor host&lt;/h4&gt;
&lt;p&gt;Install Meta-Architect once, then select the host surface before launch. The&lt;br&gt;
pre-launch step detects installed hosts and writes the selected scope and&lt;br&gt;
targets to &lt;code&gt;.ma/prelaunch.json&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Codex (reference host)
npm i -g @openai/codex@latest @jstn-sdk/ma@latest
ma --madmax --high

# Claude Code
MA_AGENT=claude-code npm i -g @jstn-sdk/ma@latest
MA_AGENT=claude-code ma --madmax --high

# Cursor
MA_AGENT=cursor npm i -g @jstn-sdk/ma@latest
MA_AGENT=cursor ma --madmax --high

# Any registered host surface
MA_AGENT=&amp;lt;host-id&amp;gt; npm i -g @jstn-sdk/ma@latest
MA_AGENT=&amp;lt;host-id&amp;gt; ma --madmax --high
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Launches</category>
<guid isPermaLink="true">https://coderlegion.com/25781/meta-architect-for-ai-coding-agents</guid>
<pubDate>Sun, 30 Aug 2026 03:18:23 +0000</pubDate>
</item>
<item>
<title>I use AI coding agents daily.</title>
<link>https://coderlegion.com/24717/i-use-ai-coding-agents-daily</link>
<description>&lt;p&gt;My AI coding agent kept claiming &quot;done&quot; without proof. So I built gates for it.&lt;/p&gt;
&lt;p&gt;I use AI coding agents daily. They're fast. They're also confident when wrong.&lt;/p&gt;
&lt;p&gt;Last month mine recommended a library which doesn't exist. Another run claimed &quot;build complete&quot; with zero tests executed. Sound familiar?&lt;/p&gt;
&lt;p&gt;So I built Meta-Architect. Open-source skill pack for Codex. Six fail-closed gates before anything ships:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;$arch: architecture first, with a written decision record&lt;/li&gt;
&lt;li&gt;$sage: every dependency claim graded VERIFIED, PARTIAL, or MISSING against upstream repos&lt;/li&gt;
&lt;li&gt;$flow: logic and state review&lt;/li&gt;
&lt;li&gt;$vet: security and dependency audit&lt;/li&gt;
&lt;li&gt;$vibe: DX/UX review&lt;/li&gt;
&lt;li&gt;$build: stays locked until all five pass&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Red stays red. The agent stops instead of pretending.&lt;/p&gt;
&lt;p&gt;What it won't do:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Replace your agent, runtime, or model&lt;/li&gt;
&lt;li&gt;Run unattended&lt;/li&gt;
&lt;li&gt;Claim &quot;production-ready&quot; without receipts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Current state: v0.1.13, Codex-only, MIT license. Claude Code and Cursor support on the roadmap.&lt;/p&gt;
&lt;p&gt;github.com/JustineDevs/meta-architect&lt;/p&gt;
&lt;p&gt;What's the worst thing your AI agent shipped while claiming success? Best answer becomes my first gate test case.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/24717/i-use-ai-coding-agents-daily</guid>
<pubDate>Sun, 16 Aug 2026 13:37:07 +0000</pubDate>
</item>
<item>
<title>How to batch 5 coding-agent turns into 1 macro workflow</title>
<link>https://coderlegion.com/23099/how-to-batch-5-coding-agent-turns-into-1-macro-workflow</link>
<description>&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; I maintain &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/Tura-AI/tura&quot;&gt;Tura&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here is the simple idea. A normal coding agent may use five separate LLM turns for one predictable workflow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Turn 1 — inspect&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;rg -n &quot;TODO|command_run|handler&quot; crates/
rg --files crates/runtime/src crates/tools/src
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Turn 2 — apply the patch&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-diff&quot;&gt;- // old command handler logic
+ // patched command handler logic
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Turn 3 — build&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cargo build -p runtime
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Turn 4 — test&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cargo test -p runtime --lib
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Turn 5 — lint&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cargo clippy -p runtime --all-targets
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The overhead is not only the shell commands. The model wakes up five times and receives the growing conversation again.&lt;/p&gt;
&lt;p&gt;Tura exposes one macro tool called command_run, so the agent can send the same workflow once:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;name&quot;: &quot;command_run&quot;,
  &quot;arguments&quot;: {
    &quot;commands&quot;: [
      { &quot;step&quot;: 1, &quot;command_type&quot;: &quot;shell_command&quot;, &quot;command_line&quot;: &quot;inspect files&quot; },
      { &quot;step&quot;: 2, &quot;command_type&quot;: &quot;apply_patch&quot;, &quot;command_line&quot;: &quot;apply patch&quot; },
      { &quot;step&quot;: 3, &quot;command_type&quot;: &quot;shell_command&quot;, &quot;command_line&quot;: &quot;cargo build -p runtime&quot; },
      { &quot;step&quot;: 4, &quot;command_type&quot;: &quot;shell_command&quot;, &quot;command_line&quot;: &quot;cargo test -p runtime --lib&quot; },
      { &quot;step&quot;: 4, &quot;command_type&quot;: &quot;shell_command&quot;, &quot;command_line&quot;: &quot;cargo clippy -p runtime --all-targets&quot; }
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Build, test, and lint still run. The model simply does not need a new turn between predictable steps.&lt;/p&gt;
&lt;p&gt;In the full DeepSWE comparison, Balanced used &lt;strong&gt;35.8% fewer turns&lt;/strong&gt; and &lt;strong&gt;31.1% fewer tokens&lt;/strong&gt; than Codex CLI. Direct used &lt;strong&gt;69.1% fewer turns&lt;/strong&gt; and &lt;strong&gt;77.5% fewer tokens&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;GitHub: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/Tura-AI/tura&quot;&gt;https://github.com/Tura-AI/tura&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Benchmark: &lt;a rel=&quot;nofollow&quot; href=&quot;https://turaai.net/benchmark&quot;&gt;https://turaai.net/benchmark&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/23099/how-to-batch-5-coding-agent-turns-into-1-macro-workflow</guid>
<pubDate>Tue, 21 Jul 2026 02:57:59 +0000</pubDate>
</item>
<item>
<title>kasetto - declarative AI agent environment manager, written in Rust</title>
<link>https://coderlegion.com/15335/kasetto-declarative-ai-agent-environment-manager-written-in-rust</link>
<description>&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.kasetto.dev&quot;&gt;https://www.kasetto.dev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/pivoshenko/kasetto&quot;&gt;https://github.com/pivoshenko/kasetto&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hey community! &lt;/p&gt;
&lt;p&gt;I want to share an open-source tool I built for myself, and that I hope will be useful to other developers working with AI agents.&lt;/p&gt;
&lt;h3 id=&quot;the-problem&quot;&gt;The Problem&lt;/h3&gt;
&lt;p&gt;The more AI coding tools we adopted, the messier our setup got. Skills and MCP servers installed manually, via individual commands, or copy-pasted from docs. Scattered across Claude Code, Cursor, Codex, Windsurf - with no way to version any of it, no way to share it with teammates, no way to reproduce it on a new machine or project.&lt;/p&gt;
&lt;p&gt;Every new team member meant walking them through the same manual steps. Every new machine meant doing it all over again. And if someone changed a skill or added an MCP server, there was no way to propagate that to the rest of the team.&lt;/p&gt;
&lt;p&gt;Sound familiar?&lt;/p&gt;
&lt;h3 id=&quot;the-idea&quot;&gt;The Idea&lt;/h3&gt;
&lt;p&gt;I built &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/pivoshenko/kasetto&quot;&gt;kasetto&lt;/a&gt; to fix that. The idea is borrowed from things I already loved - the declarative reproducibility of dotfiles, the simplicity of &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/astral-sh/uv&quot;&gt;uv&lt;/a&gt; for Python packages. What uv did for Python, kasetto aims to do for AI agent skills.&lt;/p&gt;
&lt;p&gt;One YAML config describes your entire setup: skills, MCP servers, target agents. Commit it, share it, and everyone on the team gets the exact same environment. No manual editing, no drift between machines or teammates. New machine? One command.&lt;/p&gt;
&lt;h3 id=&quot;the-name&quot;&gt;The Name&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Kasetto&lt;/em&gt; (カセット) is the Japanese word for cassette - as in a cassette tape. A cassette was a self-contained, portable thing: you recorded something once, handed it to someone, and it played back exactly the same on any device. No setup, no drift, no &quot;works on my machine.&quot; That's exactly what kasetto does for your AI agent environment - package it once, share it, and it reproduces identically everywhere.&lt;/p&gt;
&lt;h3 id=&quot;why-kasetto&quot;&gt;Why kasetto&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Declarative&lt;/strong&gt; - one YAML config, version it, share it, bootstrap a whole team in seconds&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-agent&lt;/strong&gt; - 21 built-in presets: Claude Code, Cursor, Codex, Windsurf, Copilot, Gemini CLI, and more&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-source&lt;/strong&gt; - pulls from GitHub, GitLab, Bitbucket, Codeberg including self-hosted and enterprise&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MCP management&lt;/strong&gt; - merges MCP servers into each agent's native settings file automatically&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Global and project scopes&lt;/strong&gt; - install skills globally or per-project, each with its own lockfile&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CI-friendly&lt;/strong&gt; - &lt;code&gt;--dry-run&lt;/code&gt; to preview, &lt;code&gt;--json&lt;/code&gt; for automation, non-zero exit on failure&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Single binary&lt;/strong&gt; - no runtime dependencies, written in Rust, fast cold starts&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;how-it-works&quot;&gt;How It Works&lt;/h3&gt;
&lt;p&gt;Define your config:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;agent:
  - claude-code
  - cursor
  - codex

skills:
  - source: https://github.com/org/skill-pack
    skills: &quot;*&quot;
  - source: https://github.com/org/skill-pack-2
    skills:
      - product-design
  - source: https://github.com/org/skill-pack-3
    skills:
      - name: jupyter-notebook
        path: skills/.curated

mcps:
  - source: https://github.com/org/mcp-pack
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then sync:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kst sync
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That's it. Kasetto pulls the skills and MCP servers, installs them into the right agent directories, and merges MCP configs into each agent's native settings file. The next time you run &lt;code&gt;sync&lt;/code&gt;, only what changed gets updated.&lt;/p&gt;
&lt;h3 id=&quot;command-overview&quot;&gt;Command Overview&lt;/h3&gt;
&lt;p&gt;Kasetto ships with a focused set of commands - each does exactly one thing:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kst sync              # pull skills + MCP servers and install them
kst sync --dry-run    # preview what would change without touching anything
kst sync --json       # structured output for CI pipelines

kst list              # browse installed skills and MCPs interactively
kst list --json       # dump installed state as JSON

kst init              # scaffold a kasetto.yaml in the current directory
kst doctor            # check your environment and diagnose issues

kst clean             # remove all installed skills and MCP entries
kst self update       # update kasetto to the latest release
kst self uninstall    # remove kasetto and all its files
kst completions       # generate shell completions (bash, zsh, fish, etc.)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The binary is available as both &lt;code&gt;kasetto&lt;/code&gt; and &lt;code&gt;kst&lt;/code&gt; - the short alias makes daily use quick.&lt;/p&gt;
&lt;h3 id=&quot;install&quot;&gt;Install&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;macOS / Linux
curl -fsSL https://raw.githubusercontent.com/pivoshenko/kasetto/main/scripts/install.sh | sh

Homebrew
brew install pivoshenko/tap/kasetto

Cargo
cargo install kasetto
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;what-s-next&quot;&gt;What's Next&lt;/h3&gt;
&lt;p&gt;The &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/pivoshenko/kasetto#roadmap&quot;&gt;roadmap&lt;/a&gt; includes agents management and hooks management. If you have ideas or run into issues, &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/pivoshenko/kasetto/issues&quot;&gt;open an issue&lt;/a&gt; - feedback from real users shapes the direction.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/pivoshenko/kasetto&quot;&gt;github.com/pivoshenko/kasetto&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If kasetto saves you time, a GitHub star means a lot. And drop a comment below - I'd love to hear what your AI agent setup looks like today, and what pain points you're still hitting.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/15335/kasetto-declarative-ai-agent-environment-manager-written-in-rust</guid>
<pubDate>Mon, 20 Apr 2026 21:09:16 +0000</pubDate>
</item>
<item>
<title>We Ported NanoClaw from Claude to Codex. The Hard Part Was Not the Runtime.</title>
<link>https://coderlegion.com/14496/we-ported-nanoclaw-from-claude-to-codex-the-hard-part-was-not-the-runtime</link>
<description>&lt;p&gt;&lt;em&gt;NanoClaw started as an agent harness that was not just compatible with Claude, but heavily shaped by Claude while working inside its own repo. Porting it to Codex meant rewriting both the runtime and the instruction substrate that had been teaching the old agent how to extend the app.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Most &quot;AI app ports&quot; are not really ports.&lt;/p&gt;
&lt;p&gt;Usually they are some combination of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;swap the SDK&lt;/li&gt;
&lt;li&gt;change the model name&lt;/li&gt;
&lt;li&gt;leave the runtime assumptions alone&lt;/li&gt;
&lt;li&gt;declare victory&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This was not that.&lt;/p&gt;
&lt;p&gt;When Anthropic tightened Claude subscription usage for third-party harnesses, one thing became obvious fast:&lt;/p&gt;
&lt;p&gt;Building a serious agent system on top of a first-party subscription runtime is not a stable foundation.&lt;/p&gt;
&lt;p&gt;That did not instantly kill NanoClaw. But it did force the right question:&lt;/p&gt;
&lt;p&gt;What parts of this system are actually &lt;em&gt;our architecture&lt;/em&gt;, and what parts are just the residue of the agent runtime that originally helped build it?&lt;/p&gt;
&lt;p&gt;That turned out to be the whole story.&lt;/p&gt;
&lt;h3 id=&quot;nanoclaw-was-built-inside-an-agent-world&quot;&gt;NanoClaw Was Built Inside an Agent World&lt;/h3&gt;
&lt;p&gt;NanoClaw originally evolved in a Claude-native operating model.&lt;/p&gt;
&lt;p&gt;The workflow looked roughly like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;point Claude Code at the repo&lt;/li&gt;
&lt;li&gt;give it a stack of markdown instructions&lt;/li&gt;
&lt;li&gt;run command-driven setup flows&lt;/li&gt;
&lt;li&gt;let it scaffold, extend, and refine the app from inside that environment&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That means the old system was not merely &quot;compatible with Claude.&quot;&lt;/p&gt;
&lt;p&gt;It was, in a very real sense, built by an agent that also helped define the repo's conventions for how future work should happen.&lt;/p&gt;
&lt;p&gt;So once we decided to make NanoClaw truly Codex-native, the job was not:&lt;/p&gt;
&lt;p&gt;&quot;replace Anthropic with OpenAI.&quot;&lt;/p&gt;
&lt;p&gt;The real job was:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;separate the application from the worldview of the agent that originally co-authored its architecture.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;the-markdown-was-part-of-the-runtime&quot;&gt;The Markdown Was Part of the Runtime&lt;/h3&gt;
&lt;p&gt;This is the part that matters if you have ever let an agent spend serious time extending a codebase.&lt;/p&gt;
&lt;p&gt;NanoClaw did not just have docs. It had a markdown-based behavioral layer:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.claude/skills/...&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;setup flows&lt;/li&gt;
&lt;li&gt;installer guidance&lt;/li&gt;
&lt;li&gt;capability docs&lt;/li&gt;
&lt;li&gt;hidden conventions for how the repo should be extended&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These files were not just passive notes.&lt;/p&gt;
&lt;p&gt;They told the agent:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;how to initialize the app&lt;/li&gt;
&lt;li&gt;how to install integrations&lt;/li&gt;
&lt;li&gt;how memory should work&lt;/li&gt;
&lt;li&gt;how channels should be extended&lt;/li&gt;
&lt;li&gt;how &quot;skills&quot; should be applied&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So some of the &lt;code&gt;.md&lt;/code&gt; files were effectively architecture, even if they were not executable TypeScript.&lt;/p&gt;
&lt;p&gt;That meant the port had two distinct layers:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Port the host/container runtime&lt;/li&gt;
&lt;li&gt;Audit and rewrite the instruction layer that had been shaping the system&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If we only did the first, the app would still think in Claude-shaped terms.&lt;/p&gt;
&lt;h3 id=&quot;what-nanoclaw-actually-is&quot;&gt;What NanoClaw Actually Is&lt;/h3&gt;
&lt;p&gt;At its core, NanoClaw is a small Node.js orchestrator for running isolated assistants inside containers.&lt;/p&gt;
&lt;p&gt;The host process owns:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;channels&lt;/li&gt;
&lt;li&gt;routing&lt;/li&gt;
&lt;li&gt;SQLite state&lt;/li&gt;
&lt;li&gt;scheduling&lt;/li&gt;
&lt;li&gt;group registration&lt;/li&gt;
&lt;li&gt;IPC&lt;/li&gt;
&lt;li&gt;container lifecycle&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The container owns:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the actual agent runtime&lt;/li&gt;
&lt;li&gt;group-local context&lt;/li&gt;
&lt;li&gt;active skills&lt;/li&gt;
&lt;li&gt;delegated subagents&lt;/li&gt;
&lt;li&gt;tool access through MCP&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That architecture survived the port.&lt;/p&gt;
&lt;p&gt;What changed was the substrate it was built on.&lt;/p&gt;
&lt;h3 id=&quot;what-was-actually-claude-specific&quot;&gt;What Was Actually Claude-Specific&lt;/h3&gt;
&lt;p&gt;Before the port, Claude-specific assumptions were everywhere:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Claude SDK query loop&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt; instruction contract&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.claude/&lt;/code&gt; session and state layout&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.claude/skills/&lt;/code&gt; install model&lt;/li&gt;
&lt;li&gt;old slash-command setup flows&lt;/li&gt;
&lt;li&gt;Claude-era delegation semantics&lt;/li&gt;
&lt;li&gt;remote control built around Claude tooling&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And because the app had evolved with Claude actively working in the repo, those assumptions were reinforced both in code and in markdown.&lt;/p&gt;
&lt;p&gt;So the first real task was not coding.&lt;/p&gt;
&lt;p&gt;It was classification:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;what is host application behavior?&lt;/li&gt;
&lt;li&gt;what is Claude-specific runtime behavior?&lt;/li&gt;
&lt;li&gt;what is a real feature that just happens to be wearing Claude-shaped names?&lt;/li&gt;
&lt;li&gt;which markdown files are still runtime-significant?&lt;/li&gt;
&lt;li&gt;which ones are just historical scaffolding now?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That step mattered more than any single code change.&lt;/p&gt;
&lt;p&gt;If you classify the layers wrong, you either delete real capabilities or preserve the wrong abstractions.&lt;/p&gt;
&lt;h3 id=&quot;the-port-was-not-remove-claude-add-codex-&quot;&gt;The Port Was Not &quot;Remove Claude, Add Codex&quot;&lt;/h3&gt;
&lt;p&gt;A real port required four categories of work.&lt;/p&gt;
&lt;h4 id=&quot;1-replace-the-runtime-contract&quot;&gt;1. Replace the runtime contract&lt;/h4&gt;
&lt;p&gt;The old container runner was built around Claude-native execution.&lt;/p&gt;
&lt;p&gt;The new one is built around Codex CLI running non-interactively inside the container.&lt;/p&gt;
&lt;p&gt;That meant:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;building prompt context from host state plus group instructions&lt;/li&gt;
&lt;li&gt;invoking Codex correctly for fresh turns and resumed turns&lt;/li&gt;
&lt;li&gt;streaming results back through a stable host/container protocol&lt;/li&gt;
&lt;li&gt;preserving session continuity where possible&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That sounds simple until you hit the reality that CLI surfaces diverge in annoying ways.&lt;/p&gt;
&lt;p&gt;We hit bugs where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;flags worked on &lt;code&gt;codex&lt;/code&gt; but not &lt;code&gt;codex exec&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;fresh turns accepted options that &lt;code&gt;codex exec resume&lt;/code&gt; rejected&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those are the kinds of portability problems that do not show up in architecture diagrams. They only show up when the host queue is already working and production message flow starts failing on resume paths.&lt;/p&gt;
&lt;h4 id=&quot;2-rewrite-the-instruction-layer&quot;&gt;2. Rewrite the instruction layer&lt;/h4&gt;
&lt;p&gt;This was the difference between a fake port and a real one.&lt;/p&gt;
&lt;p&gt;The Claude-native repo had accumulated behavior through markdown:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;skills&lt;/li&gt;
&lt;li&gt;setup flow&lt;/li&gt;
&lt;li&gt;integration guidance&lt;/li&gt;
&lt;li&gt;memory conventions&lt;/li&gt;
&lt;li&gt;extension patterns&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We had to go file by file and make hard calls:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;convert&lt;/li&gt;
&lt;li&gt;replace&lt;/li&gt;
&lt;li&gt;prune&lt;/li&gt;
&lt;li&gt;delete&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That meant moving from Claude-specific conventions to Codex-native ones:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt; became &lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;repo and group skills became &lt;code&gt;SKILL.md&lt;/code&gt; based&lt;/li&gt;
&lt;li&gt;old &lt;code&gt;.claude/skills/&lt;/code&gt; assumptions were removed&lt;/li&gt;
&lt;li&gt;setup had to be rewritten around the runtime that actually exists today&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This was not glamorous work, but it was essential.&lt;/p&gt;
&lt;p&gt;If the repo still teaches the wrong mental model to the next agent that works in it, the architecture immediately starts drifting backwards.&lt;/p&gt;
&lt;h4 id=&quot;3-keep-the-real-product-features&quot;&gt;3. Keep the real product features&lt;/h4&gt;
&lt;p&gt;One easy failure mode in a port is to treat every old feature as vendor-specific and quietly delete it.&lt;/p&gt;
&lt;p&gt;That would have been wrong here.&lt;/p&gt;
&lt;p&gt;Some things really were Claude-specific and needed to die:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Claude SDK integration&lt;/li&gt;
&lt;li&gt;Claude remote control&lt;/li&gt;
&lt;li&gt;old Claude-only marketplace conventions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But other things were just product capabilities that happened to live in a Claude-native system:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Telegram&lt;/li&gt;
&lt;li&gt;WhatsApp&lt;/li&gt;
&lt;li&gt;Web UI&lt;/li&gt;
&lt;li&gt;subagent delegation&lt;/li&gt;
&lt;li&gt;host skills&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those needed to be ported, not discarded.&lt;/p&gt;
&lt;p&gt;The right question was not:&lt;/p&gt;
&lt;p&gt;&quot;Does this mention Claude?&quot;&lt;/p&gt;
&lt;p&gt;The right question was:&lt;/p&gt;
&lt;p&gt;&quot;Is this a real application capability, and does Codex have a legitimate equivalent or integration path?&quot;&lt;/p&gt;
&lt;h4 id=&quot;4-make-the-host-own-the-architecture&quot;&gt;4. Make the host own the architecture&lt;/h4&gt;
&lt;p&gt;This is the actual lesson of the whole project.&lt;/p&gt;
&lt;p&gt;The clean shape is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NanoClaw owns orchestration&lt;/li&gt;
&lt;li&gt;NanoClaw owns state&lt;/li&gt;
&lt;li&gt;NanoClaw owns channels&lt;/li&gt;
&lt;li&gt;NanoClaw owns setup&lt;/li&gt;
&lt;li&gt;NanoClaw owns skills&lt;/li&gt;
&lt;li&gt;Codex is the agent backend&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the host owns those things, the backend is replaceable.&lt;/p&gt;
&lt;p&gt;If the backend owns those things, the host is just branding.&lt;/p&gt;
&lt;h3 id=&quot;the-bugs-that-proved-the-point&quot;&gt;The Bugs That Proved the Point&lt;/h3&gt;
&lt;p&gt;The most interesting bugs in this kind of port are not random. They reveal exactly where your assumptions still belong to the old system.&lt;/p&gt;
&lt;h4 id=&quot;bug-1-the-bot-looked-alive-but-was-brain-dead&quot;&gt;Bug 1: The bot looked alive but was brain-dead&lt;/h4&gt;
&lt;p&gt;Telegram connected.&lt;br&gt;
Messages were reaching the database.&lt;br&gt;
Logs looked active.&lt;/p&gt;
&lt;p&gt;But nothing was actually being processed.&lt;/p&gt;
&lt;p&gt;Why?&lt;/p&gt;
&lt;p&gt;Because WhatsApp was loading even when it was not really configured, entering a reconnect loop, and blocking the async startup path before the message loop was fully alive.&lt;/p&gt;
&lt;p&gt;That produced a nasty half-working state:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;inbound messages landed in SQLite&lt;/li&gt;
&lt;li&gt;logs looked normal enough&lt;/li&gt;
&lt;li&gt;the main message loop never really came online&lt;/li&gt;
&lt;li&gt;the system looked alive while functionally dead&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The fix was to stop treating channel startup as monolithic:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;load channels only from real config/auth state&lt;/li&gt;
&lt;li&gt;allow channel connection failure without killing overall startup&lt;/li&gt;
&lt;li&gt;skip missing channels cleanly instead of blocking the process&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That sounds basic. It was not basic in context. It was a symptom of a system that had grown around agent-era assumptions instead of explicit host orchestration.&lt;/p&gt;
&lt;h4 id=&quot;bug-2-auth-existed-but-codex-still-returned-401&quot;&gt;Bug 2: Auth existed, but Codex still returned 401&lt;/h4&gt;
&lt;p&gt;This was my favorite bug in the whole port because it was pure systems work.&lt;/p&gt;
&lt;p&gt;The host was logged into Codex.&lt;br&gt;
The container was supposed to inherit auth.&lt;br&gt;
But every in-container turn failed with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;401 Unauthorized: Missing bearer or basic authentication in header&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The credentials were not absent.&lt;br&gt;
They were misplaced.&lt;/p&gt;
&lt;p&gt;The chain looked like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;auth was copied into a nested &lt;code&gt;.codex/.codex/auth.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;that path was mounted into the container&lt;/li&gt;
&lt;li&gt;Codex expected auth relative to &lt;code&gt;$HOME/.codex/auth.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;the file existed on disk, just not where the CLI actually looked&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is the kind of bug that disappears if you only talk in high-level diagrams.&lt;/p&gt;
&lt;p&gt;It only becomes obvious when you trace:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;host path&lt;/li&gt;
&lt;li&gt;mounted path&lt;/li&gt;
&lt;li&gt;container &lt;code&gt;$HOME&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;actual CLI lookup conventions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The fix:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;flatten the per-group Codex state layout&lt;/li&gt;
&lt;li&gt;mount it directly to &lt;code&gt;/home/node/.codex&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;migrate the old nested layout forward&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After that, the 401 vanished and the live message path finally completed.&lt;/p&gt;
&lt;h4 id=&quot;bug-3-resume-was-not-the-same-as-fresh-execution&quot;&gt;Bug 3: Resume was not the same as fresh execution&lt;/h4&gt;
&lt;p&gt;Fresh turns worked.&lt;br&gt;
Resume did not.&lt;/p&gt;
&lt;p&gt;The reason was simple and annoying:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;codex exec resume&lt;/code&gt; did not accept the same options as the fresh execution path.&lt;/p&gt;
&lt;p&gt;That is a perfect example of why &quot;we already integrated the CLI&quot; is not a meaningful milestone.&lt;/p&gt;
&lt;p&gt;You have to test:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;fresh turns&lt;/li&gt;
&lt;li&gt;resumed turns&lt;/li&gt;
&lt;li&gt;session restoration&lt;/li&gt;
&lt;li&gt;output handling after resume&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those are separate runtime contracts, even when they share most of the binary name.&lt;/p&gt;
&lt;h3 id=&quot;what-the-system-looks-like-now&quot;&gt;What the System Looks Like Now&lt;/h3&gt;
&lt;p&gt;The current NanoClaw branch is not &quot;Claude code with Codex paint.&quot;&lt;/p&gt;
&lt;p&gt;It is a different runtime model.&lt;/p&gt;
&lt;p&gt;Today it has:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a Codex-native container runner&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AGENTS.md&lt;/code&gt; for project and group instructions&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SKILL.md&lt;/code&gt; based skills&lt;/li&gt;
&lt;li&gt;per-group Codex state&lt;/li&gt;
&lt;li&gt;Telegram, WhatsApp, and Web UI channels&lt;/li&gt;
&lt;li&gt;Codex-backed delegation through MCP&lt;/li&gt;
&lt;li&gt;host-owned setup and orchestration&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Most importantly, it no longer depends on the repo being interpreted through Claude-native markdown conventions to keep evolving correctly.&lt;/p&gt;
&lt;p&gt;That was the actual finish line.&lt;/p&gt;
&lt;p&gt;Not &quot;the build passes.&quot;&lt;/p&gt;
&lt;p&gt;Not &quot;the logs look healthy.&quot;&lt;/p&gt;
&lt;p&gt;But:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;the application can now be operated, extended, and reasoned about as a Codex-native system.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;the-real-lesson&quot;&gt;The Real Lesson&lt;/h3&gt;
&lt;p&gt;The strongest takeaway from this work is that agent-built systems can end up with architecture embedded in places most teams do not normally treat as architecture.&lt;/p&gt;
&lt;p&gt;In this case, that included:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;markdown instruction files&lt;/li&gt;
&lt;li&gt;setup flows&lt;/li&gt;
&lt;li&gt;skill directories&lt;/li&gt;
&lt;li&gt;implied extension workflows&lt;/li&gt;
&lt;li&gt;hidden filesystem conventions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to port a system like that, you have to audit all of it.&lt;/p&gt;
&lt;p&gt;Not just the code.&lt;/p&gt;
&lt;p&gt;Not just the SDK.&lt;/p&gt;
&lt;p&gt;All of it.&lt;/p&gt;
&lt;p&gt;Because once an agent has spent enough time building inside a repo, the repo starts encoding assumptions about that agent's worldview.&lt;/p&gt;
&lt;p&gt;That is fascinating when it works.&lt;/p&gt;
&lt;p&gt;It is dangerous when you need to switch runtimes.&lt;/p&gt;
&lt;h3 id=&quot;if-you-are-thinking-about-doing-this-yourself&quot;&gt;If You Are Thinking About Doing This Yourself&lt;/h3&gt;
&lt;p&gt;My advice is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;inventory the instruction layer before touching the runtime&lt;/li&gt;
&lt;li&gt;treat markdown conventions as potentially runtime-significant architecture&lt;/li&gt;
&lt;li&gt;separate host ownership from backend ownership early&lt;/li&gt;
&lt;li&gt;verify real CLI behavior instead of trusting docs from memory&lt;/li&gt;
&lt;li&gt;test startup, auth, fresh turns, resumed turns, and recovery independently&lt;/li&gt;
&lt;li&gt;do not call it a port if you quietly deleted capabilities that had real equivalents&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The hard part is not replacing the model.&lt;/p&gt;
&lt;p&gt;The hard part is identifying all the places where the old model had already shaped the application.&lt;/p&gt;
&lt;p&gt;Once you do that, the work becomes much clearer:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;you are not porting an SDK. You are reclaiming the architecture.&lt;/strong&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/14496/we-ported-nanoclaw-from-claude-to-codex-the-hard-part-was-not-the-runtime</guid>
<pubDate>Sat, 11 Apr 2026 14:27:43 +0000</pubDate>
</item>
</channel>
</rss>