one-code-extension 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -219
- package/docs/guide/windows.md +8 -3
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -4,114 +4,34 @@
|
|
|
4
4
|
|
|
5
5
|
**Claude Code with the model slot left open. The full workflow, open source, on any model or provider.**
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
One Code rebuilds the Claude Code workflow around the model you choose.
|
|
8
|
+
Subagents, Git worktrees, auto mode, plan mode, permissions, and context
|
|
9
|
+
management all live in the harness, so they come along whatever model you
|
|
10
|
+
put in it. Your `CLAUDE.md`, skills, commands, agents, and permission rules
|
|
11
|
+
carry over with no import step.
|
|
12
|
+
|
|
13
|
+
If you already use Claude Code, nothing here needs relearning. Pick a model,
|
|
14
|
+
give it a task, review its plan, and let it work. Switch models mid-session,
|
|
15
|
+
or give each subagent its own model and provider: a frontier model on the
|
|
16
|
+
main task, a cheaper one for exploration and tests.
|
|
17
|
+
|
|
18
|
+
One Code is an independent, open-source implementation built on
|
|
19
|
+
[pi](https://github.com/earendil-works/pi). It recreates the coding workflow;
|
|
20
|
+
features that depend on Claude Code's hosted or desktop services are outside
|
|
21
|
+
its scope.
|
|
16
22
|
|
|
17
23
|
<p align="center">
|
|
18
|
-
<img src="demo/onecode.gif" alt="One Code
|
|
24
|
+
<img src="demo/onecode.gif" alt="One Code terminal showing permission modes, a model switch, an approved edit, a side question, diagnostics, and a running subagent" width="820">
|
|
19
25
|
</p>
|
|
20
26
|
|
|
21
27
|
[User guide](docs/guide/README.md) ·
|
|
22
|
-
[
|
|
28
|
+
[Reuse your Claude Code setup](docs/guide/bring-your-claude-code-setup.md) ·
|
|
23
29
|
[Differences from Claude Code](docs/guide/differences-from-claude-code.md) ·
|
|
24
30
|
[Command reference](docs/guide/reference.md)
|
|
25
31
|
|
|
26
|
-
## ✨ What you get
|
|
27
|
-
|
|
28
|
-
- **Any model, any provider.** Anthropic, OpenAI, Gemini, OpenRouter, or a
|
|
29
|
-
local model. Bring your own and switch mid-session with `/model`. Nothing
|
|
30
|
-
stops you.
|
|
31
|
-
- **Mix providers in one session.** The parent and each subagent pick their own
|
|
32
|
-
model and provider, so an ultracode workflow can fan out to a cheap tier while
|
|
33
|
-
the parent stays on a frontier model. A single-gateway setup cannot do this,
|
|
34
|
-
which is usually the reason people switch.
|
|
35
|
-
- **Your Claude Code setup runs unchanged.** `CLAUDE.md`, `.claude/commands`,
|
|
36
|
-
`.claude/skills`, `.claude/agents`, `.mcp.json`, plugins, and permission rules
|
|
37
|
-
are picked up as they are. No migration, and no second config file to keep in
|
|
38
|
-
sync. A directory with no `CLAUDE.md` falls back to its `AGENTS.md`, the
|
|
39
|
-
cross-tool convention Claude Code now reads too, so a repo written for another
|
|
40
|
-
agent works here with nothing to change.
|
|
41
|
-
- **Capability-tiered prompting.** A weaker model gets more guidance, not less.
|
|
42
|
-
Not out of politeness; it is how you get output you can use.
|
|
43
|
-
- **A package, not a fork.** One Code is a [pi](https://github.com/earendil-works/pi)
|
|
44
|
-
package, so you extend it with your own extensions, themes, and settings.
|
|
45
|
-
Forks go stale; packages do not have to.
|
|
46
|
-
- **Free and open source** under the MIT license.
|
|
47
|
-
|
|
48
|
-
## 🤔 "But I can already point Claude Code at Ollama"
|
|
49
|
-
|
|
50
|
-
You can:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
export ANTHROPIC_BASE_URL="http://localhost:11434"
|
|
54
|
-
claude --model kimi-k2.7-code:cloud
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Claude Code will happily talk to whoever picks up the phone. If one model
|
|
58
|
-
behind Claude Code's interface is all you want, enjoy it.
|
|
59
|
-
|
|
60
|
-
The catch: you swapped the brain and told the body nothing. Claude Code's
|
|
61
|
-
prompts, caching, and side calls all assume a current Claude is on the other
|
|
62
|
-
end, and that assumption doesn't come off with an environment variable.
|
|
63
|
-
|
|
64
|
-
One Code started as the experiment that follows from that. My
|
|
65
|
-
[Harness Engineering 101](https://isuruwijesiri.com/harness-engineering-101/)
|
|
66
|
-
series argues the model is the brain and the harness is the body, and the good
|
|
67
|
-
parts live in the body. So: rebuild the body from scratch on a model-neutral
|
|
68
|
-
runtime and put any brain in it. This repository is that rebuild, and here's
|
|
69
|
-
what it does that a base URL can't.
|
|
70
|
-
|
|
71
|
-
- **One phone line.** You can rename the subagent model in Claude Code, but
|
|
72
|
-
every call, main agent, subagents, classifier, compaction, still dials the one
|
|
73
|
-
endpoint behind that URL. Mixing providers means running a routing gateway
|
|
74
|
-
and maintaining it. One Code gives each seat its own brain on its own
|
|
75
|
-
provider, natively. A frontier model in charge, DeepSeek V4 Flash running
|
|
76
|
-
twelve subagents. That's the setup this was built for.
|
|
77
|
-
- **Subscriptions don't fit behind a base URL.** A gateway wants API keys. One
|
|
78
|
-
Code signs you in with the account you already pay for: Claude Pro and Max,
|
|
79
|
-
ChatGPT, GitHub Copilot, OpenRouter, Kimi, xAI, and Radius all have native
|
|
80
|
-
OAuth logins, and you can mix them in one session.
|
|
81
|
-
- **Someone else's prompt.** Claude Code's prompt is about 8k characters,
|
|
82
|
-
because Claude 5 doesn't need hand-holding. Give it to a smaller model and
|
|
83
|
-
you get a stranger reading Claude's notes. One Code sizes the prompt to the
|
|
84
|
-
model in four tiers, down to playbooks and strict-schema search tools for
|
|
85
|
-
flash-class and local models. Weaker brains need more body.
|
|
86
|
-
- **Cache misses, billed to you.** Anthropic caches at explicit `cache_control`
|
|
87
|
-
markers; most other providers cache on an exact prefix, and the two do not
|
|
88
|
-
line up. A gateway that translates between them silently maps the markers
|
|
89
|
-
wrong, so the cache sticks at the system prompt and never advances, or never
|
|
90
|
-
forms at all. Nothing errors. You just pay full price every turn. This is not
|
|
91
|
-
hypothetical: users report proxies where the cache-creation count is zero on
|
|
92
|
-
every turn and half the turns re-bill the whole context, and Claude Code's own
|
|
93
|
-
attribution header defeats caching behind a base URL unless you know the flag
|
|
94
|
-
to turn off. One Code speaks each provider's native API, keeps the prefix
|
|
95
|
-
byte-stable, and shows the live hit rate in the footer, because one careless
|
|
96
|
-
byte up top is a tenfold price increase.
|
|
97
|
-
- **Anthropic-only parts.** Deferred tools, server-side web search, the
|
|
98
|
-
thinking block. A foreign endpoint drops them. One Code has a
|
|
99
|
-
provider-neutral version of each.
|
|
100
|
-
- **Side jobs that ask for Haiku by name.** Your gateway had better know who
|
|
101
|
-
that is. One Code picks side models from your provider's own catalog, with
|
|
102
|
-
a capability floor.
|
|
103
|
-
- **A knob, not a toolbox.** Claude Code isn't open source; the base URL is
|
|
104
|
-
the one knob. One Code is pi extensions all the way down, so anything
|
|
105
|
-
missing is one more extension.
|
|
106
|
-
|
|
107
|
-
The base URL trick swaps the brain and hopes the body doesn't notice. One Code
|
|
108
|
-
is the body that was built to notice.
|
|
109
|
-
|
|
110
32
|
## 🚀 Get started
|
|
111
33
|
|
|
112
|
-
|
|
113
|
-
Linux; WSL works too. Native Windows runs in Claude Code's shape (Git Bash
|
|
114
|
-
optional, PowerShell tool) — see the [Windows guide](docs/guide/windows.md).
|
|
34
|
+
Install **Node.js 22.19 or later**, then run:
|
|
115
35
|
|
|
116
36
|
```bash
|
|
117
37
|
npm install -g @one-ai/one-code
|
|
@@ -119,194 +39,262 @@ cd your-project
|
|
|
119
39
|
onecode
|
|
120
40
|
```
|
|
121
41
|
|
|
122
|
-
Inside One Code, run `/login` to connect a provider, then `/model` to
|
|
123
|
-
model. You can also
|
|
42
|
+
Inside One Code, run `/login` to connect a provider, then `/model` to choose a
|
|
43
|
+
model. You can also supply an API key through an environment variable such as
|
|
124
44
|
`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`.
|
|
125
45
|
|
|
126
|
-
|
|
127
|
-
|
|
46
|
+
One Code reads an existing `CLAUDE.md` and `.claude/` configuration directly.
|
|
47
|
+
If a directory has no `CLAUDE.md`, it falls back to `AGENTS.md`. For a new
|
|
48
|
+
project, run `/init` to draft a `CLAUDE.md`.
|
|
49
|
+
|
|
50
|
+
To check your setup, run `onecode doctor` or `/doctor report` inside a session.
|
|
51
|
+
The report lists provider credentials, model assignments, detected configuration,
|
|
52
|
+
and missing programs. Run `/doctor` for a checkup with agent-assisted fixes.
|
|
128
53
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
are missing. `/doctor` runs the full checkup and has the model fix what it finds.
|
|
54
|
+
One Code is developed on macOS and verified on macOS, Linux, and Windows.
|
|
55
|
+
WSL works too. For the native Windows setup and what has been checked there,
|
|
56
|
+
see the [Windows guide](docs/guide/windows.md).
|
|
133
57
|
|
|
134
|
-
One Code is free. Model access, usage charges, and rate
|
|
135
|
-
|
|
136
|
-
for connection options.
|
|
58
|
+
One Code is free under the MIT license. Model access, usage charges, and rate
|
|
59
|
+
limits depend on your provider. See
|
|
60
|
+
[Providers and models](docs/guide/providers-and-models.md) for connection options.
|
|
137
61
|
|
|
138
|
-
### Other
|
|
62
|
+
### Other installation options
|
|
139
63
|
|
|
140
|
-
**Homebrew
|
|
64
|
+
**Homebrew**, which installs Node.js for you:
|
|
141
65
|
|
|
142
66
|
```bash
|
|
143
67
|
brew install isurumaduranga/one-ai/onecode
|
|
144
68
|
```
|
|
145
69
|
|
|
146
|
-
**Windows
|
|
70
|
+
**Windows installer**, which installs Node.js and One Code:
|
|
147
71
|
|
|
148
72
|
```powershell
|
|
149
73
|
powershell -c "irm https://raw.githubusercontent.com/IsuruMaduranga/one-code/master/install.ps1 | iex"
|
|
150
74
|
```
|
|
151
75
|
|
|
152
|
-
**
|
|
76
|
+
**Existing pi installation**:
|
|
153
77
|
|
|
154
78
|
```bash
|
|
155
79
|
pi install npm:one-code-extension
|
|
156
80
|
```
|
|
157
81
|
|
|
158
|
-
The
|
|
159
|
-
bundles a pinned pi and
|
|
160
|
-
[`one-code-extension`](https://www.npmjs.com/package/one-code-extension)
|
|
161
|
-
your
|
|
162
|
-
|
|
82
|
+
The [`@one-ai/one-code`](https://www.npmjs.com/package/@one-ai/one-code)
|
|
83
|
+
app package bundles a pinned version of pi and provides the `onecode` command.
|
|
84
|
+
The [`one-code-extension`](https://www.npmjs.com/package/one-code-extension)
|
|
85
|
+
package uses your existing pi installation and is tested against pi versions
|
|
86
|
+
0.83 through 0.86. For the extension package, use `pi` in place of `onecode`.
|
|
163
87
|
|
|
164
88
|
The app opens in a full-screen terminal interface by default. See the
|
|
165
|
-
[installation guide](docs/guide/installation.md) for display settings and more
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
89
|
+
[installation guide](docs/guide/installation.md) for display settings and more
|
|
90
|
+
installation details.
|
|
91
|
+
|
|
92
|
+
## ✨ Why One Code?
|
|
93
|
+
|
|
94
|
+
- **Choose models by task.** Use Anthropic, OpenAI, Gemini, OpenRouter, or a
|
|
95
|
+
local model. Switch the main model mid-session with `/model`.
|
|
96
|
+
- **Mix providers in one session.** Give the main agent and each subagent
|
|
97
|
+
their own model and provider, without configuring a routing gateway.
|
|
98
|
+
- **Reuse your Claude Code configuration.** One Code reads project
|
|
99
|
+
instructions, skills, commands, agents, plugins, permission rules, and
|
|
100
|
+
Model Context Protocol (MCP) server configuration. There is no import step.
|
|
101
|
+
- **Adapt guidance to the model.** Four capability tiers adjust prompting
|
|
102
|
+
and tool guidance, with more explicit instructions for smaller models.
|
|
103
|
+
- **Extend the harness.** One Code is a
|
|
104
|
+
[pi](https://github.com/earendil-works/pi) package built from extensions.
|
|
105
|
+
Add your own extensions, themes, and settings.
|
|
106
|
+
- **Inspect and change the code.** The project is open source under the
|
|
107
|
+
[MIT license](LICENSE).
|
|
108
|
+
|
|
109
|
+
## 🤔 Why not use Claude Code with a URL override?
|
|
110
|
+
|
|
111
|
+
You can point Claude Code at another endpoint with `ANTHROPIC_BASE_URL`.
|
|
112
|
+
If that endpoint supports the API Claude Code expects, this can be enough
|
|
113
|
+
to use an alternative model in a familiar interface.
|
|
114
|
+
|
|
115
|
+
The override changes where requests go. It does not, by itself, adapt the
|
|
116
|
+
prompts, provider features, authentication, or supporting model calls to
|
|
117
|
+
the model receiving them. Your endpoint or gateway has to bridge those gaps.
|
|
118
|
+
|
|
119
|
+
One Code builds that adaptation into the harness:
|
|
120
|
+
|
|
121
|
+
- **Different providers for different agents.** A URL override points
|
|
122
|
+
requests at one endpoint. To route those requests across providers, you
|
|
123
|
+
need a gateway. One Code connects each agent to its own provider directly.
|
|
124
|
+
The main agent can use a frontier model while subagents use a cheaper
|
|
125
|
+
model elsewhere.
|
|
126
|
+
- **Prompts matched to the model.** Changing the endpoint does not change
|
|
127
|
+
the instructions sent to the model. One Code uses four capability tiers
|
|
128
|
+
to adjust prompting and tool guidance. Smaller and local models receive
|
|
129
|
+
more explicit playbooks and structured search tools.
|
|
130
|
+
- **Native caching support.** Providers use different caching mechanisms.
|
|
131
|
+
An API-compatible response alone does not establish that a gateway
|
|
132
|
+
preserves caching behavior. One Code uses native provider integrations,
|
|
133
|
+
keeps prompt prefixes stable, and shows the cache hit rate in the footer.
|
|
134
|
+
- **Account sign-ins as well as API keys.** Changing a URL does not add
|
|
135
|
+
a provider's sign-in flow. One Code signs in with the accounts you
|
|
136
|
+
already have (Claude Pro and Max, ChatGPT, GitHub Copilot, OpenRouter,
|
|
137
|
+
Kimi, xAI, and Radius), and you can mix them with API-key connections in
|
|
138
|
+
the same session.
|
|
139
|
+
- **Tools and supporting calls that account for the provider.** Web search,
|
|
140
|
+
deferred tools, reasoning, and background model calls need more than an
|
|
141
|
+
endpoint change. One Code provides shared tool interfaces and selects
|
|
142
|
+
supporting models from the provider's catalog, subject to capability
|
|
143
|
+
requirements.
|
|
144
|
+
- **An open harness you can change.** One Code's prompts, tools, and
|
|
145
|
+
workflows are implemented as pi extensions. You can inspect them,
|
|
146
|
+
change their behavior, and add your own.
|
|
147
|
+
|
|
148
|
+
Use a URL override when one compatible endpoint covers your needs. Use
|
|
149
|
+
One Code when you want the Claude Code workflow with model choice built
|
|
150
|
+
into the prompts, tools, authentication, and agent coordination.
|
|
151
|
+
|
|
152
|
+
See [Differences from Claude Code](docs/guide/differences-from-claude-code.md)
|
|
153
|
+
for the full comparison and compatibility boundaries.
|
|
154
|
+
|
|
155
|
+
## 🎛️ Use different models in one session
|
|
156
|
+
|
|
157
|
+
Keep your preferred model on the main task and delegate exploration, tests,
|
|
158
|
+
or review to another model or provider.
|
|
172
159
|
|
|
173
160
|
1. Choose the main model with `/model`.
|
|
174
|
-
2. Set the default for subagents and workflow agents with
|
|
161
|
+
2. Set the default model for subagents and workflow agents with
|
|
175
162
|
`/subagent <provider/model-id>`.
|
|
176
|
-
3. Ask for delegated work
|
|
163
|
+
3. Ask for delegated work. For example:
|
|
177
164
|
|
|
178
165
|
> Use subagents to investigate the authentication code and its tests.
|
|
179
166
|
> Have them report their findings, then make the fix in the main session.
|
|
180
167
|
|
|
181
|
-
Agent definitions in `.claude/agents/` can
|
|
182
|
-
instructions. Use `/agents` to follow their progress and `/model` to
|
|
183
|
-
main model as the task changes.
|
|
168
|
+
Agent definitions in `.claude/agents/` can specify their own model, tools,
|
|
169
|
+
and instructions. Use `/agents` to follow their progress and `/model` to
|
|
170
|
+
change the main model as the task changes.
|
|
184
171
|
|
|
185
|
-
|
|
186
|
-
|
|
172
|
+
Cost and output quality depend on the models, the task, and how much work
|
|
173
|
+
you delegate. See [Subagents and workflows](docs/guide/subagents-and-workflows.md)
|
|
174
|
+
for configuration details.
|
|
187
175
|
|
|
188
|
-
|
|
176
|
+
## ♻️ Reuse your Claude Code setup
|
|
189
177
|
|
|
190
|
-
|
|
178
|
+
One Code reads Claude Code configuration directly and keeps its own settings
|
|
179
|
+
separately. It treats `~/.claude` as read-only, with one deliberate exception:
|
|
180
|
+
per-repository memory is written to Claude Code's own memory folder, so both
|
|
181
|
+
tools share it.
|
|
191
182
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
| Your configuration | How One Code uses it |
|
|
183
|
+
| Configuration | How One Code uses it |
|
|
195
184
|
|---|---|
|
|
196
185
|
| `CLAUDE.md` | Project instructions, including nested files and `@path` imports. Falls back to `AGENTS.md` when a directory has no `CLAUDE.md`. |
|
|
197
186
|
| `.claude/skills/` and `.claude/commands/` | Discoverable skills and slash commands. |
|
|
198
|
-
| `.claude/agents/` | Subagent definitions with
|
|
187
|
+
| `.claude/agents/` | Subagent definitions with model, tool, and instruction settings. |
|
|
199
188
|
| `.claude/settings.json` | `allow`, `deny`, and `ask` permission rules, plus supported command hooks. |
|
|
200
|
-
| `.mcp.json` | MCP servers with tools loaded on demand. |
|
|
189
|
+
| `.mcp.json` | MCP servers, with tools loaded on demand. |
|
|
201
190
|
| Installed Claude Code plugins | Plugin agents, skills, commands, and MCP servers, namespaced by plugin. |
|
|
202
191
|
|
|
203
192
|
Claude Code tool names such as `Read`, `Bash`, `Edit`, and `Task` work in
|
|
204
|
-
permission rules and hook matchers.
|
|
205
|
-
|
|
193
|
+
permission rules and hook matchers.
|
|
194
|
+
|
|
195
|
+
Compatibility covers configuration and workflows. Features and skills that
|
|
196
|
+
depend on Claude Code's hosted or desktop services are not included.
|
|
206
197
|
|
|
207
|
-
|
|
208
|
-
|
|
198
|
+
See [Configuration compatibility](docs/guide/bring-your-claude-code-setup.md)
|
|
199
|
+
and [Skills, plugins, and MCP](docs/guide/skills-plugins-and-mcp.md).
|
|
209
200
|
|
|
210
|
-
|
|
211
|
-
[Skills, plugins, and MCP →](docs/guide/skills-plugins-and-mcp.md)
|
|
201
|
+
## ⚙️ Plan and delegate work
|
|
212
202
|
|
|
213
|
-
|
|
203
|
+
### Subagents and Git worktrees
|
|
214
204
|
|
|
215
|
-
|
|
205
|
+
Give an investigation its own context window and bring the results back to
|
|
206
|
+
the main conversation. Subagents run in the background, accept follow-up
|
|
207
|
+
messages, and can fork the conversation when they need its context.
|
|
216
208
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
can fork the current conversation when they need its context. Three agent
|
|
220
|
-
definitions ship with One Code: `general-purpose`, `explore`, and `plan`.
|
|
209
|
+
One Code includes three agent definitions: `general-purpose`, `explore`,
|
|
210
|
+
and `plan`.
|
|
221
211
|
|
|
222
|
-
For parallel edits, give agents
|
|
223
|
-
whole session into a worktree with `enter_worktree` and leave it with
|
|
212
|
+
For parallel edits, give agents separate Git worktrees. You can also move
|
|
213
|
+
the whole session into a worktree with `enter_worktree` and leave it with
|
|
224
214
|
`exit_worktree`.
|
|
225
215
|
|
|
226
216
|
### Ultracode workflows
|
|
227
217
|
|
|
228
|
-
|
|
229
|
-
model writes a JavaScript workflow
|
|
230
|
-
progress
|
|
231
|
-
|
|
218
|
+
Include **`ultracode`** in a request for a broad audit, migration, or review.
|
|
219
|
+
The model writes a JavaScript workflow to coordinate agents in parallel.
|
|
220
|
+
Follow progress in `/workflows`, or use `/effort ultracode` to keep this
|
|
221
|
+
behavior enabled across turns.
|
|
222
|
+
|
|
223
|
+
When you resume an interrupted run, completed agent calls can be reused if
|
|
224
|
+
their inputs still match. Save reusable scripts in `.claude/workflows/` to
|
|
225
|
+
call them by name.
|
|
232
226
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
Optional output-token targets stop new and queued agents once reached;
|
|
236
|
-
agents already running can finish above the target.
|
|
227
|
+
Optional output-token targets stop new and queued agents when the target
|
|
228
|
+
is reached. Agents already running can finish above the target.
|
|
237
229
|
|
|
238
230
|
### Permissions and planning
|
|
239
231
|
|
|
240
|
-
**Auto mode is the default.** A classifier
|
|
241
|
-
while permission rules and deterministic checks enforce the
|
|
242
|
-
|
|
243
|
-
and allow rules.
|
|
232
|
+
**Auto mode is the default.** A classifier evaluates actions that need
|
|
233
|
+
review, while permission rules and deterministic checks enforce the remaining
|
|
234
|
+
controls. `deny` rules take precedence over `allow` rules.
|
|
244
235
|
|
|
245
|
-
|
|
246
|
-
Plan mode lets the agent investigate and write a plan file before you approve
|
|
247
|
-
implementation. Use `/permissions` to inspect rules and `/auto-mode` to
|
|
248
|
-
configure the classifier.
|
|
236
|
+
Project-provided hooks, MCP servers, and allow rules require trust approval.
|
|
249
237
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
238
|
+
Press **ctrl+q**, or **alt+m** on Windows and WSL, to cycle through manual,
|
|
239
|
+
accept-edits, plan, and auto modes. In plan mode, the agent investigates and
|
|
240
|
+
writes a plan file before you approve implementation.
|
|
253
241
|
|
|
254
|
-
|
|
255
|
-
|
|
242
|
+
Use `/permissions` to inspect rules and `/auto-mode` to configure the
|
|
243
|
+
classifier.
|
|
244
|
+
|
|
245
|
+
The permission system provides application-level controls. For operating
|
|
246
|
+
system isolation, run One Code inside a container. See
|
|
247
|
+
[Permissions and modes](docs/guide/permissions-modes-and-auto-mode.md) for
|
|
248
|
+
guarantees and known limitations, and [Hooks](docs/guide/hooks.md) for
|
|
249
|
+
hook configuration.
|
|
256
250
|
|
|
257
251
|
## 🧰 Everyday tools
|
|
258
252
|
|
|
259
|
-
| Capability |
|
|
253
|
+
| Capability | Included features |
|
|
260
254
|
|---|---|
|
|
261
|
-
| Code and files |
|
|
262
|
-
| Web | Search and fetch,
|
|
263
|
-
| Diagnostics | Language
|
|
255
|
+
| Code and files | File reading, writing, and editing; shell commands; background processes; repository search; and notebook editing. |
|
|
256
|
+
| Web | Search and fetch, using provider search or Brave, Tavily, and Exa fallbacks. |
|
|
257
|
+
| Diagnostics | Language server diagnostics after edits. Install the relevant server on your `PATH`. |
|
|
264
258
|
| Long sessions | Per-repository memory, a session scratchpad, and context compaction. |
|
|
265
259
|
| Task tracking | A pinned progress widget, background monitors, and scheduled wake-ups. |
|
|
266
|
-
| Tool discovery |
|
|
267
|
-
| Reasoning and appearance | `/effort` or **shift+tab**
|
|
268
|
-
| Customization |
|
|
260
|
+
| Tool discovery | Tools loaded on demand to reduce prompt overhead. |
|
|
261
|
+
| Reasoning and appearance | `/effort` or **shift+tab** to set reasoning effort; `onecode` and `onecode-light` themes. |
|
|
262
|
+
| Customization | pi extensions, themes, and settings. |
|
|
269
263
|
|
|
270
|
-
|
|
271
|
-
`fewer-permission-prompts`. A project skill with the same name
|
|
264
|
+
Bundled skills include `simplify`, `code-review`, `security-review`, and
|
|
265
|
+
`fewer-permission-prompts`. A project skill with the same name takes precedence.
|
|
272
266
|
|
|
273
267
|
For scripting and session management:
|
|
274
268
|
|
|
275
269
|
```bash
|
|
276
270
|
onecode -p "Explain how authentication works in this repository"
|
|
277
|
-
onecode -c #
|
|
278
|
-
onecode --mode json # JSON
|
|
279
|
-
onecode --permission-mode plan #
|
|
271
|
+
onecode -c # Continue the previous session.
|
|
272
|
+
onecode --mode json # Output JSON events.
|
|
273
|
+
onecode --permission-mode plan # Start in plan mode.
|
|
280
274
|
```
|
|
281
275
|
|
|
282
|
-
See [Tools](docs/guide/tools.md) for
|
|
283
|
-
[command reference](docs/guide/reference.md) for
|
|
284
|
-
and environment
|
|
285
|
-
|
|
286
|
-
##
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
without native search. With neither key, the fallback is Exa's rate-limited
|
|
301
|
-
keyless endpoint, and One Code labels those results.
|
|
302
|
-
- **Native Windows:** shells, hooks, and the PowerShell tool follow Claude
|
|
303
|
-
Code's behavior and pass on Windows CI runners, but a real Windows desktop
|
|
304
|
-
session hasn't been driven end to end yet. Expect rough edges around
|
|
305
|
-
drive-letter paths in permission rules; WSL remains the safest route.
|
|
276
|
+
See [Tools](docs/guide/tools.md) for available tools and the
|
|
277
|
+
[command reference](docs/guide/reference.md) for commands, shortcuts, flags,
|
|
278
|
+
and environment variables.
|
|
279
|
+
|
|
280
|
+
## 💡 Platform and provider notes
|
|
281
|
+
|
|
282
|
+
- **Provider coverage:** End-to-end testing focuses on Anthropic, OpenAI,
|
|
283
|
+
and OpenRouter. Other providers have less test coverage.
|
|
284
|
+
- **Web search:** For providers without native search, set
|
|
285
|
+
`BRAVE_SEARCH_API_KEY` or `TAVILY_API_KEY`. Without either key, One Code
|
|
286
|
+
falls back to Exa's rate-limited keyless endpoint and labels those results.
|
|
287
|
+
- **Native Windows:** The shells, hooks, and the PowerShell tool follow
|
|
288
|
+
Claude Code's behavior. They pass on the Windows CI runner, where a real
|
|
289
|
+
model drives both shell tools, and they have been checked by hand on a
|
|
290
|
+
Windows Server 2025 machine: the interface in Windows Terminal, permission
|
|
291
|
+
prompts, plan mode, the PowerShell tool, background shells, and `/doctor`.
|
|
292
|
+
Windows 10 and 11 desktops have had less time in the field, so report what
|
|
293
|
+
you hit. WSL remains the longest-tested route.
|
|
306
294
|
|
|
307
295
|
## 🔧 Install from source
|
|
308
296
|
|
|
309
|
-
|
|
297
|
+
To install the local extensions into an existing pi installation, run:
|
|
310
298
|
|
|
311
299
|
```bash
|
|
312
300
|
git clone https://github.com/IsuruMaduranga/one-code
|
|
@@ -317,15 +305,16 @@ pi install ./one-code
|
|
|
317
305
|
pi list
|
|
318
306
|
```
|
|
319
307
|
|
|
320
|
-
##
|
|
308
|
+
## 📚 Documentation and background
|
|
309
|
+
|
|
310
|
+
The [user guide](docs/guide/README.md) covers setup, configuration, providers,
|
|
311
|
+
permissions, workflows, tools, session management, and troubleshooting.
|
|
321
312
|
|
|
322
|
-
|
|
323
|
-
[Harness Engineering 101](https://isuruwijesiri.com/harness-engineering-101/)
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
how a ~300-line toy agent grows into the patterns you see here. The series
|
|
327
|
-
points at this repository wherever it needs a grown-up example.
|
|
313
|
+
For the ideas behind the project, read
|
|
314
|
+
[Harness Engineering 101](https://isuruwijesiri.com/harness-engineering-101/).
|
|
315
|
+
The sixteen-chapter series starts with a small coding agent and develops the
|
|
316
|
+
harness patterns used in One Code, with examples from this repository.
|
|
328
317
|
|
|
329
318
|
## 📄 License
|
|
330
319
|
|
|
331
|
-
[MIT](LICENSE). Contributions welcome.
|
|
320
|
+
[MIT](LICENSE). Contributions are welcome.
|
package/docs/guide/windows.md
CHANGED
|
@@ -172,9 +172,14 @@ is the same.
|
|
|
172
172
|
- The PowerShell tool has also been driven through a real model with a
|
|
173
173
|
`pwsh` on macOS, the same way Claude Code's own PowerShell tool was
|
|
174
174
|
captured for reference.
|
|
175
|
-
- An interactive session on a Windows
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
- An interactive session on a real Windows machine (a Windows Server 2025
|
|
176
|
+
VM, the same kernel as the CI runner): the interface in Windows Terminal,
|
|
177
|
+
`alt+m` mode cycling, a permission prompt, plan mode, the PowerShell tool's
|
|
178
|
+
rendering, a background PowerShell shell with its panel and notification,
|
|
179
|
+
diagnostics through an npm-installed language server, and both `/doctor`
|
|
180
|
+
surfaces, with Git for Windows present and with PowerShell alone. Windows
|
|
181
|
+
10 and 11 desktops have not had the same pass; if you hit something there,
|
|
182
|
+
[Troubleshooting](troubleshooting.md) says what to collect.
|
|
178
183
|
|
|
179
184
|
## Not provided
|
|
180
185
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one-code-extension",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "One Code as a pi package — the Claude Code experience on your own pi install: ported system prompt, Claude-Code-format permissions, .claude/ compatibility, ToolSearch-style deferred tools, and system-reminder steering. For the bundled app, install `@one-ai/one-code` instead.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi",
|
|
@@ -88,7 +88,8 @@
|
|
|
88
88
|
"scripts": {
|
|
89
89
|
"typecheck": "tsc --noEmit",
|
|
90
90
|
"test": "vitest run",
|
|
91
|
-
"gen:model-facts": "node scripts/gen-model-facts.mjs"
|
|
91
|
+
"gen:model-facts": "node scripts/gen-model-facts.mjs",
|
|
92
|
+
"sync:app-readme": "node scripts/app-readme.mjs"
|
|
92
93
|
},
|
|
93
94
|
"dependencies": {
|
|
94
95
|
"@modelcontextprotocol/sdk": "^1.30.0",
|