{"slug": "show-hn-one-code-almost-all-of-claude-code-s-features-on-pi-with-any-model", "title": "Show HN: One Code, almost all of Claude Code's features on pi, with any model", "summary": "An independent open-source project called One Code recreates Claude Code's coding workflow on top of pi while letting users plug in any model or provider, released free under the MIT license as the npm package @one-ai/one-code. One Code carries over subagents, Git worktrees, auto mode, plan mode, permissions and context management in the harness, and reads existing CLAUDE.md and .claude/ configuration directly with no import step, falling back to AGENTS.md when no CLAUDE.md exists. It requires Node.js 22.19 or later, supports Anthropic, OpenAI, Gemini, OpenRouter or local models with mid-session switching via /model, and is developed and verified on macOS, Linux and Windows; features depending on Claude Code's hosted or desktop services are outside its scope.", "body_md": "**Claude Code with the model slot left open. The full workflow, open source, on any model or provider.**\n\nOne Code rebuilds the Claude Code workflow around the model you choose.\nSubagents, Git worktrees, auto mode, plan mode, permissions, and context\nmanagement all live in the harness, so they come along whatever model you\nput in it. Your `CLAUDE.md`, skills, commands, agents, and permission rules\ncarry over with no import step.\n\nIf you already use Claude Code, nothing here needs relearning. Pick a model, give it a task, review its plan, and let it work. Switch models mid-session, or give each subagent its own model and provider: a frontier model on the main task, a cheaper one for exploration and tests.\n\nOne Code is an independent, open-source implementation built on\n[pi](https://github.com/earendil-works/pi). It recreates the coding workflow;\nfeatures that depend on Claude Code's hosted or desktop services are outside\nits scope.\n\n[User guide](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/README.md) ·\n[Reuse your Claude Code setup](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/bring-your-claude-code-setup.md) ·\n[Differences from Claude Code](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/differences-from-claude-code.md) ·\n[Command reference](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/reference.md)\n\nInstall **Node.js 22.19 or later**, then run:\n\n```\nnpm install -g @one-ai/one-code\ncd your-project\nonecode\n```\n\nInside One Code, run `/login` to connect a provider, then `/model` to choose a\nmodel. You can also supply an API key through an environment variable such as\n`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`.\n\nOne Code reads an existing `CLAUDE.md` and `.claude/` configuration directly.\nIf a directory has no `CLAUDE.md`, it falls back to `AGENTS.md`. For a new\nproject, run `/init` to draft a `CLAUDE.md`.\n\nTo check your setup, run `onecode doctor` or `/doctor report` inside a session.\nThe report lists provider credentials, model assignments, detected configuration,\nand missing programs. Run `/doctor` for a checkup with agent-assisted fixes.\n\nOne Code is developed on macOS and verified on macOS, Linux, and Windows.\nWSL works too. For the native Windows setup and what has been checked there,\nsee the [Windows guide](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/windows.md).\n\nOne Code is free under the MIT license. Model access, usage charges, and rate\nlimits depend on your provider. See\n[Providers and models](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/providers-and-models.md) for connection options.\n\n**Homebrew**, which installs Node.js for you:\n\n```\nbrew install isurumaduranga/one-ai/onecode\n```\n\n**Windows installer**, which installs Node.js and One Code:\n\n```\npowershell -c \"irm https://raw.githubusercontent.com/IsuruMaduranga/one-code/master/install.ps1 | iex\"\n```\n\n**Existing pi installation**:\n\n```\npi install npm:one-code-extension\n```\n\nThe [`@one-ai/one-code`](https://www.npmjs.com/package/@one-ai/one-code)\napp package bundles a pinned version of pi and provides the `onecode` command.\nThe [`one-code-extension`](https://www.npmjs.com/package/one-code-extension)\npackage uses your existing pi installation and is tested against pi versions\n1.0.0 through 1.5. For the extension package, use `pi` in place of `onecode`.\n\nThe app opens in a full-screen terminal interface by default. See the\n[installation guide](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/installation.md) for display settings and more\ninstallation details.\n\n- **Choose models by task.** Use Anthropic, OpenAI, Gemini, OpenRouter, or a\nlocal model. Switch the main model mid-session with`/model` .\n- **Mix providers in one session.** Give the main agent and each subagent\ntheir own model and provider, without configuring a routing gateway.\n- **Reuse your Claude Code configuration.** One Code reads project\ninstructions, skills, commands, agents, plugins, permission rules, and\nModel Context Protocol (MCP) server configuration. There is no import step.\n- **Adapt guidance to the model.** Four capability tiers adjust prompting\nand tool guidance, with more explicit instructions for smaller models.\n- **Extend the harness.** One Code is a[pi](https://github.com/earendil-works/pi) package built from extensions.\nAdd your own extensions, themes, and settings.\n- **Inspect and change the code.** The project is open source under the[MIT license](https://github.com/IsuruMaduranga/one-code/blob/master/LICENSE) .\n\nYou can point Claude Code at another endpoint with `ANTHROPIC_BASE_URL`.\nIf that endpoint supports the API Claude Code expects, this can be enough\nto use an alternative model in a familiar interface.\n\nThe override changes where requests go. It does not, by itself, adapt the prompts, provider features, authentication, or supporting model calls to the model receiving them. Your endpoint or gateway has to bridge those gaps.\n\nOne Code builds that adaptation into the harness:\n\n- **Different providers for different agents.** A URL override points\nrequests at one endpoint. To route those requests across providers, you\nneed a gateway. One Code connects each agent to its own provider directly.\nThe main agent can use a frontier model while subagents use a cheaper\nmodel elsewhere.\n- **Prompts matched to the model.** Changing the endpoint does not change\nthe instructions sent to the model. One Code uses four capability tiers\nto adjust prompting and tool guidance. Smaller and local models receive\nmore explicit playbooks and structured search tools.\n- **Native caching support.** Providers use different caching mechanisms.\nAn API-compatible response alone does not establish that a gateway\npreserves caching behavior. One Code uses native provider integrations,\nkeeps prompt prefixes stable, and shows the cache hit rate in the footer.\n- **Account sign-ins as well as API keys.** Changing a URL does not add\na provider's sign-in flow. One Code signs in with the accounts you\nalready have (Claude Pro and Max, ChatGPT, GitHub Copilot, OpenRouter,\nKimi, xAI, and Radius), and you can mix them with API-key connections in\nthe same session.\n- **Tools and supporting calls that account for the provider.** Web search,\ndeferred tools, reasoning, and background model calls need more than an\nendpoint change. One Code provides shared tool interfaces and selects\nsupporting models from the provider's catalog, subject to capability\nrequirements.\n- **Auto mode on any provider.** Claude Code's auto mode now sends each\ntool call to the API server for a safety check, using a request field\nthe endpoint has to support. Claude Code keeps its local classifier as a\nfallback only for a while ([LiteLLM's notes](https://docs.litellm.ai/blog/claude-code-server-side-auto-mode) give October 23, 2026), so an endpoint without that support can leave\nauto mode unavailable. One Code runs its own two-stage classifier on a\nmodel from your provider, so auto mode works wherever your models run.\n- **An open harness you can change.** One Code's prompts, tools, and\nworkflows are implemented as pi extensions. You can inspect them,\nchange their behavior, and add your own.\n\nUse a URL override when one compatible endpoint covers your needs. Use One Code when you want the Claude Code workflow with model choice built into the prompts, tools, authentication, and agent coordination.\n\nSee [Differences from Claude Code](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/differences-from-claude-code.md)\nfor the full comparison and compatibility boundaries.\n\nKeep your preferred model on the main task and delegate exploration, tests, or review to another model or provider.\n\n1. \nChoose the main model with `/model` .\n2. \nSet the default model for subagents and workflow agents with `/subagent <provider/model-id>` .\n3. \nAsk for delegated work. For example: Use subagents to investigate the authentication code and its tests. Have them report their findings, then make the fix in the main session.\n\nAgent definitions in `.claude/agents/` can specify their own model, tools,\nand instructions. Use `/agents` to follow their progress and `/model` to\nchange the main model as the task changes.\n\nCost and output quality depend on the models, the task, and how much work\nyou delegate. See [Subagents and workflows](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/subagents-and-workflows.md)\nfor configuration details.\n\nOne Code reads Claude Code configuration directly and keeps its own settings\nseparately. It treats `~/.claude` as read-only, with one deliberate exception:\nper-repository memory is written to Claude Code's own memory folder, so both\ntools share it.\n\n| Configuration | How One Code uses it | \n|---|---|\n| `CLAUDE.md` | Project instructions, including nested files and `@path` imports. Falls back to`AGENTS.md` when a directory has no`CLAUDE.md` . | \n| `.claude/skills/` and`.claude/commands/` | Discoverable skills and slash commands. | \n| `.claude/agents/` | Subagent definitions with model, tool, and instruction settings. | \n| `.claude/settings.json` | `allow` ,`deny` , and`ask` permission rules, plus supported command hooks. | \n| `.mcp.json` | MCP servers, with tools loaded on demand. | \n| Installed Claude Code plugins | Plugin agents, skills, commands, and MCP servers, namespaced by plugin. | \n\nClaude Code tool names such as `Read`, `Bash`, `Edit`, and `Task` work in\npermission rules and hook matchers.\n\nCompatibility covers configuration and workflows. Features and skills that depend on Claude Code's hosted or desktop services are not included.\n\nSee [Configuration compatibility](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/bring-your-claude-code-setup.md)\nand [Skills, plugins, and MCP](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/skills-plugins-and-mcp.md).\n\nGive an investigation its own context window and bring the results back to the main conversation. Subagents run in the background, accept follow-up messages, and can fork the conversation when they need its context.\n\nOne Code includes three agent definitions: `general-purpose`, `explore`,\nand `plan`.\n\nFor parallel edits, give agents separate Git worktrees. You can also move\nthe whole session into a worktree with `enter_worktree` and leave it with\n`exit_worktree`.\n\nInclude **`ultracode`** in a request for a broad audit, migration, or review.\nThe model writes a JavaScript workflow to coordinate agents in parallel.\nFollow progress in `/workflows`, or use `/effort ultracode` to keep this\nbehavior enabled across turns.\n\nWhen you resume an interrupted run, completed agent calls can be reused if\ntheir inputs still match. Save reusable scripts in `.claude/workflows/` to\ncall them by name.\n\nOptional output-token targets stop new and queued agents when the target is reached. Agents already running can finish above the target.\n\n**Auto mode is the default.** A classifier evaluates actions that need\nreview, while permission rules and deterministic checks enforce the remaining\ncontrols. `deny` rules take precedence over `allow` rules.\n\nProject-provided hooks, MCP servers, and allow rules require trust approval.\n\nPress **ctrl+q**, or **alt+m** on Windows and WSL, to cycle through manual,\naccept-edits, plan, and auto modes. In plan mode, the agent investigates and\nwrites a plan file before you approve implementation.\n\nUse `/permissions` to manage rules and approve calls auto mode blocked, and\n`/auto-mode` to configure the classifier.\n\nThe permission system provides application-level controls. For operating\nsystem isolation, run One Code inside a container. See\n[Permissions and modes](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/permissions-modes-and-auto-mode.md) for\nguarantees and known limitations, and [Hooks](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/hooks.md) for\nhook configuration.\n\n| Capability | Included features | \n|---|---|\n| Code and files | File reading, writing, and editing; shell commands; background processes; repository search; and notebook editing. | \n| Web | Search and fetch, using provider search or Brave, Tavily, and Exa fallbacks. | \n| Diagnostics | Language server diagnostics after edits. Install the relevant server on your `PATH` . | \n| Long sessions | Per-repository memory, a session scratchpad, and context compaction. | \n| Task tracking | A pinned progress widget, background monitors, and scheduled wake-ups. | \n| Tool discovery | Tools loaded on demand to reduce prompt overhead. | \n| Artifacts | HTML pages the model writes (reports, dashboards, small tools), saved in `~/.onecode/artifacts/` with every version kept, and opened in your browser. | \n| Reasoning and appearance | `/effort` or**shift+tab** to set reasoning effort;`onecode` and`onecode-light` themes. | \n| Customization | pi extensions, themes, and settings. | \n\nBundled skills include `simplify`, `code-review`, `security-review`,\n`fewer-permission-prompts`, and `artifact-design`. A project skill with the\nsame name takes precedence.\n\nFor scripting and session management:\n\n```\nonecode -p \"Explain how authentication works in this repository\"\nonecode -c                       # Continue the previous session.\nonecode --mode json              # Output JSON events.\nonecode --permission-mode plan   # Start in plan mode.\n```\n\nSee [Tools](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/tools.md) for available tools and the\n[command reference](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/reference.md) for commands, shortcuts, flags,\nand environment variables.\n\n- **Provider coverage:** End-to-end testing focuses on Anthropic, OpenAI,\nand OpenRouter. Other providers have less test coverage.\n- **Web search:** For providers without native search, set`BRAVE_SEARCH_API_KEY` or`TAVILY_API_KEY` . Without either key, One Code\nfalls back to Exa's rate-limited keyless endpoint and labels those results.\n- **Native Windows:** The shells, hooks, and the PowerShell tool follow\nClaude Code's behavior. They pass on the Windows CI runner, where a real\nmodel drives both shell tools, and they have been checked by hand on a\nWindows Server 2025 machine: the interface in Windows Terminal, permission\nprompts, plan mode, the PowerShell tool, background shells, and`/doctor` .\nWindows 10 and 11 desktops have had less time in the field, so report what\nyou hit. WSL remains the longest-tested route.\n\nTo install the local extensions into an existing pi installation, run:\n\n```\ngit clone https://github.com/IsuruMaduranga/one-code\ncd one-code\nnpm install\ncd ..\npi install ./one-code\npi list\n```\n\nThe [user guide](https://github.com/IsuruMaduranga/one-code/blob/master/docs/guide/README.md) covers setup, configuration, providers,\npermissions, workflows, tools, session management, and troubleshooting.\nIf you want to change One Code itself, the [developer docs](https://github.com/IsuruMaduranga/one-code/blob/master/docs/dev/README.md)\ncover the architecture, the rules extensions follow, and how to test.\n\nFor the ideas behind the project, read\n[Harness Engineering 101](https://isuruwijesiri.com/harness-engineering-101/).\nThe sixteen-chapter series starts with a small coding agent and develops the\nharness patterns used in One Code, with examples from this repository.\n\n[MIT](https://github.com/IsuruMaduranga/one-code/blob/master/LICENSE). Contributions are welcome.", "url": "https://wpnews.pro/news/show-hn-one-code-almost-all-of-claude-code-s-features-on-pi-with-any-model", "canonical_source": "https://github.com/IsuruMaduranga/one-code", "published_at": "2026-11-04 14:09:16+00:00", "updated_at": "2026-11-04 14:25:19.056574+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "large-language-models", "agent-protocols"], "entities": ["One Code", "Claude Code", "pi", "Anthropic", "OpenAI", "Gemini", "OpenRouter", "Isuru Maduranga"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-one-code-almost-all-of-claude-code-s-features-on-pi-with-any-model", "markdown": "https://wpnews.pro/news/show-hn-one-code-almost-all-of-claude-code-s-features-on-pi-with-any-model.md", "text": "https://wpnews.pro/news/show-hn-one-code-almost-all-of-claude-code-s-features-on-pi-with-any-model.txt", "jsonld": "https://wpnews.pro/news/show-hn-one-code-almost-all-of-claude-code-s-features-on-pi-with-any-model.jsonld"}}