one-code-extension 0.3.1 → 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 +214 -147
- package/docs/guide/README.md +1 -0
- package/docs/guide/configuration.md +2 -2
- package/docs/guide/differences-from-claude-code.md +13 -4
- package/docs/guide/hooks.md +14 -2
- package/docs/guide/installation.md +54 -6
- package/docs/guide/permissions-modes-and-auto-mode.md +23 -7
- package/docs/guide/reference.md +5 -2
- package/docs/guide/sessions-and-context.md +18 -0
- package/docs/guide/terminal-interface.md +1 -1
- package/docs/guide/tools.md +24 -2
- package/docs/guide/troubleshooting.md +14 -4
- package/docs/guide/windows.md +189 -0
- package/extensions/auto-mode/actions.ts +3 -1
- package/extensions/auto-mode/paths.ts +21 -23
- package/extensions/auto-mode/safety-floor.ts +44 -6
- package/extensions/auto-mode/shell-analysis.ts +25 -10
- package/extensions/auto-mode/transcript.ts +15 -5
- package/extensions/background/index.ts +83 -34
- package/extensions/background/monitor-batch.ts +7 -5
- package/extensions/background/wakeup.ts +18 -24
- package/extensions/bash/background.ts +19 -10
- package/extensions/bash/guards.ts +36 -16
- package/extensions/bash/index.ts +36 -166
- package/extensions/branding/index.ts +35 -4
- package/extensions/btw/index.ts +207 -0
- package/extensions/btw/panel.ts +179 -0
- package/extensions/btw/prompt.ts +45 -0
- package/extensions/clear/index.ts +15 -0
- package/extensions/compaction/fit.ts +9 -6
- package/extensions/doctor/build.ts +22 -2
- package/extensions/doctor/dependencies.ts +63 -31
- package/extensions/doctor/fix-prompt.ts +12 -4
- package/extensions/doctor/index.ts +1 -0
- package/extensions/doctor/models.ts +2 -1
- package/extensions/doctor/report.ts +2 -3
- package/extensions/doctor/update-lookup.ts +19 -11
- package/extensions/effort/index.ts +2 -1
- package/extensions/footer/footer-line.ts +19 -0
- package/extensions/footer/index.ts +25 -5
- package/extensions/hooks/executor.ts +84 -18
- package/extensions/hooks/index.ts +1 -0
- package/extensions/hooks/matcher.ts +23 -9
- package/extensions/hooks/settings.ts +15 -0
- package/extensions/lib/branch-restore.ts +12 -0
- package/extensions/lib/claude-context.ts +2 -3
- package/extensions/lib/claude-settings.ts +19 -0
- package/extensions/lib/command-launch.ts +71 -0
- package/extensions/lib/deferred.ts +173 -33
- package/extensions/lib/git.ts +16 -0
- package/extensions/lib/keys.ts +38 -0
- package/extensions/lib/local-command.ts +112 -0
- package/extensions/lib/model-facts.generated.json +263 -68
- package/extensions/lib/model-policy.ts +13 -0
- package/extensions/lib/model-tier.ts +16 -5
- package/extensions/lib/notifications.ts +547 -53
- package/extensions/lib/paths.ts +130 -2
- package/extensions/lib/pi-ai-estimate.ts +57 -26
- package/extensions/lib/pi-version.ts +1 -1
- package/extensions/lib/process-tree.ts +131 -5
- package/extensions/lib/reminders.ts +80 -27
- package/extensions/lib/scratchpad.ts +11 -10
- package/extensions/lib/shell-spawn.ts +298 -0
- package/extensions/lib/shell-tool.ts +252 -0
- package/extensions/lib/shell-tools.ts +13 -0
- package/extensions/lib/side-call.ts +76 -0
- package/extensions/lib/tui-render.ts +62 -11
- package/extensions/lib/update-check.mjs +155 -0
- package/extensions/lib/usage-bus.ts +1 -1
- package/extensions/lib/which.ts +62 -0
- package/extensions/lib/worktree-channel.ts +18 -0
- package/extensions/lib/worktree-isolation.ts +2 -1
- package/extensions/lsp/client.ts +14 -3
- package/extensions/lsp/index.ts +12 -5
- package/extensions/lsp/install-hints.ts +33 -3
- package/extensions/lsp/plugin-servers.ts +2 -2
- package/extensions/lsp/servers.ts +29 -7
- package/extensions/mcp/index.ts +3 -2
- package/extensions/memory/entries.ts +9 -6
- package/extensions/memory/index.ts +3 -2
- package/extensions/memory/open-external.ts +4 -1
- package/extensions/model-default/index.ts +21 -2
- package/extensions/permissions/index.ts +57 -28
- package/extensions/permissions/matcher.ts +120 -33
- package/extensions/permissions/modes.ts +14 -6
- package/extensions/permissions/powershell-rules.ts +549 -0
- package/extensions/permissions/session-grant.ts +9 -9
- package/extensions/plugins/index.ts +3 -2
- package/extensions/plugins/install/install.ts +1 -1
- package/extensions/powershell/description.ts +139 -0
- package/extensions/powershell/guards.ts +91 -0
- package/extensions/powershell/index.ts +89 -0
- package/extensions/powershell/policy.ts +91 -0
- package/extensions/recap/index.ts +10 -24
- package/extensions/recap/prompt.ts +3 -3
- package/extensions/session-title/index.ts +120 -0
- package/extensions/session-title/title.ts +111 -0
- package/extensions/skill/index.ts +40 -18
- package/extensions/skill/invoke.ts +1 -0
- package/extensions/subagents/hand-back-review.ts +10 -12
- package/extensions/subagents/index.ts +221 -78
- package/extensions/subagents/model-select.ts +75 -7
- package/extensions/system-prompt/environment.ts +14 -1
- package/extensions/system-reminder/index.ts +9 -0
- package/extensions/tasks/index.ts +2 -1
- package/extensions/tool-search/index.ts +41 -20
- package/extensions/workflow/agent-session.ts +6 -4
- package/extensions/workflow/index.ts +28 -5
- package/extensions/worktree/guards.ts +5 -4
- package/extensions/worktree/index.ts +15 -2
- package/extensions/worktree/rewrite.ts +17 -0
- package/package.json +9 -5
- package/types/app.d.ts +18 -2
package/README.md
CHANGED
|
@@ -1,50 +1,37 @@
|
|
|
1
1
|
# One Code
|
|
2
2
|
|
|
3
|
+
[](https://github.com/IsuruMaduranga/one-code/actions/workflows/ci.yml)
|
|
4
|
+
|
|
3
5
|
**Claude Code with the model slot left open. The full workflow, open source, on any model or provider.**
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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.
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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.
|
|
14
22
|
|
|
15
23
|
<p align="center">
|
|
16
|
-
<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">
|
|
17
25
|
</p>
|
|
18
26
|
|
|
19
27
|
[User guide](docs/guide/README.md) ·
|
|
20
|
-
[
|
|
28
|
+
[Reuse your Claude Code setup](docs/guide/bring-your-claude-code-setup.md) ·
|
|
21
29
|
[Differences from Claude Code](docs/guide/differences-from-claude-code.md) ·
|
|
22
30
|
[Command reference](docs/guide/reference.md)
|
|
23
31
|
|
|
24
|
-
## ✨ What you get
|
|
25
|
-
|
|
26
|
-
- **Any model, any provider.** Anthropic, OpenAI, Gemini, OpenRouter, or a
|
|
27
|
-
local model. Bring your own and switch mid-session with `/model`. Nothing
|
|
28
|
-
stops you.
|
|
29
|
-
- **Mix providers in one session.** The parent and each subagent pick their own
|
|
30
|
-
model and provider, so an ultracode workflow can fan out to a cheap tier while
|
|
31
|
-
the parent stays on a frontier model. A single-gateway setup cannot do this,
|
|
32
|
-
which is usually the reason people switch.
|
|
33
|
-
- **Your Claude Code setup runs unchanged.** `CLAUDE.md`, `.claude/commands`,
|
|
34
|
-
`.claude/skills`, `.claude/agents`, `.mcp.json`, plugins, and permission rules
|
|
35
|
-
are picked up as they are. No migration, and no second config file to keep in
|
|
36
|
-
sync.
|
|
37
|
-
- **Capability-tiered prompting.** A weaker model gets more guidance, not less.
|
|
38
|
-
Not out of politeness; it is how you get output you can use.
|
|
39
|
-
- **A package, not a fork.** One Code is a [pi](https://github.com/earendil-works/pi)
|
|
40
|
-
package, so you extend it with your own extensions, themes, and settings.
|
|
41
|
-
Forks go stale; packages do not have to.
|
|
42
|
-
- **Free and open source** under the MIT license.
|
|
43
|
-
|
|
44
32
|
## 🚀 Get started
|
|
45
33
|
|
|
46
|
-
|
|
47
|
-
Linux; WSL works too. Native Windows is untested.
|
|
34
|
+
Install **Node.js 22.19 or later**, then run:
|
|
48
35
|
|
|
49
36
|
```bash
|
|
50
37
|
npm install -g @one-ai/one-code
|
|
@@ -52,186 +39,262 @@ cd your-project
|
|
|
52
39
|
onecode
|
|
53
40
|
```
|
|
54
41
|
|
|
55
|
-
Inside One Code, run `/login` to connect a provider, then `/model` to
|
|
56
|
-
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
|
|
57
44
|
`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`.
|
|
58
45
|
|
|
59
|
-
|
|
60
|
-
|
|
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`.
|
|
61
49
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
are missing. `/doctor` runs the full checkup and has the model fix what it finds.
|
|
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.
|
|
66
53
|
|
|
67
|
-
One Code is
|
|
68
|
-
|
|
69
|
-
|
|
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).
|
|
70
57
|
|
|
71
|
-
|
|
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.
|
|
72
61
|
|
|
73
|
-
|
|
62
|
+
### Other installation options
|
|
63
|
+
|
|
64
|
+
**Homebrew**, which installs Node.js for you:
|
|
74
65
|
|
|
75
66
|
```bash
|
|
76
67
|
brew install isurumaduranga/one-ai/onecode
|
|
77
68
|
```
|
|
78
69
|
|
|
79
|
-
**
|
|
70
|
+
**Windows installer**, which installs Node.js and One Code:
|
|
71
|
+
|
|
72
|
+
```powershell
|
|
73
|
+
powershell -c "irm https://raw.githubusercontent.com/IsuruMaduranga/one-code/master/install.ps1 | iex"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Existing pi installation**:
|
|
80
77
|
|
|
81
78
|
```bash
|
|
82
79
|
pi install npm:one-code-extension
|
|
83
80
|
```
|
|
84
81
|
|
|
85
|
-
The
|
|
86
|
-
bundles a pinned pi and
|
|
87
|
-
[`one-code-extension`](https://www.npmjs.com/package/one-code-extension)
|
|
88
|
-
your
|
|
89
|
-
|
|
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`.
|
|
90
87
|
|
|
91
88
|
The app opens in a full-screen terminal interface by default. See the
|
|
92
|
-
[installation guide](docs/guide/installation.md) for display settings and more
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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.
|
|
99
159
|
|
|
100
160
|
1. Choose the main model with `/model`.
|
|
101
|
-
2. Set the default for subagents and workflow agents with
|
|
161
|
+
2. Set the default model for subagents and workflow agents with
|
|
102
162
|
`/subagent <provider/model-id>`.
|
|
103
|
-
3. Ask for delegated work
|
|
163
|
+
3. Ask for delegated work. For example:
|
|
104
164
|
|
|
105
165
|
> Use subagents to investigate the authentication code and its tests.
|
|
106
166
|
> Have them report their findings, then make the fix in the main session.
|
|
107
167
|
|
|
108
|
-
Agent definitions in `.claude/agents/` can
|
|
109
|
-
instructions. Use `/agents` to follow their progress and `/model` to
|
|
110
|
-
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.
|
|
111
171
|
|
|
112
|
-
|
|
113
|
-
|
|
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.
|
|
114
175
|
|
|
115
|
-
|
|
176
|
+
## ♻️ Reuse your Claude Code setup
|
|
116
177
|
|
|
117
|
-
|
|
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.
|
|
118
182
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
| Your configuration | How One Code uses it |
|
|
183
|
+
| Configuration | How One Code uses it |
|
|
122
184
|
|---|---|
|
|
123
185
|
| `CLAUDE.md` | Project instructions, including nested files and `@path` imports. Falls back to `AGENTS.md` when a directory has no `CLAUDE.md`. |
|
|
124
186
|
| `.claude/skills/` and `.claude/commands/` | Discoverable skills and slash commands. |
|
|
125
|
-
| `.claude/agents/` | Subagent definitions with
|
|
187
|
+
| `.claude/agents/` | Subagent definitions with model, tool, and instruction settings. |
|
|
126
188
|
| `.claude/settings.json` | `allow`, `deny`, and `ask` permission rules, plus supported command hooks. |
|
|
127
|
-
| `.mcp.json` | MCP servers with tools loaded on demand. |
|
|
189
|
+
| `.mcp.json` | MCP servers, with tools loaded on demand. |
|
|
128
190
|
| Installed Claude Code plugins | Plugin agents, skills, commands, and MCP servers, namespaced by plugin. |
|
|
129
191
|
|
|
130
192
|
Claude Code tool names such as `Read`, `Bash`, `Edit`, and `Task` work in
|
|
131
|
-
permission rules and hook matchers.
|
|
132
|
-
|
|
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.
|
|
133
197
|
|
|
134
|
-
|
|
135
|
-
|
|
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).
|
|
136
200
|
|
|
137
|
-
|
|
138
|
-
[Skills, plugins, and MCP →](docs/guide/skills-plugins-and-mcp.md)
|
|
201
|
+
## ⚙️ Plan and delegate work
|
|
139
202
|
|
|
140
|
-
|
|
203
|
+
### Subagents and Git worktrees
|
|
141
204
|
|
|
142
|
-
|
|
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.
|
|
143
208
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
can fork the current conversation when they need its context. Three agent
|
|
147
|
-
definitions ship with One Code: `general-purpose`, `explore`, and `plan`.
|
|
209
|
+
One Code includes three agent definitions: `general-purpose`, `explore`,
|
|
210
|
+
and `plan`.
|
|
148
211
|
|
|
149
|
-
For parallel edits, give agents
|
|
150
|
-
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
|
|
151
214
|
`exit_worktree`.
|
|
152
215
|
|
|
153
216
|
### Ultracode workflows
|
|
154
217
|
|
|
155
|
-
|
|
156
|
-
model writes a JavaScript workflow
|
|
157
|
-
progress
|
|
158
|
-
|
|
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.
|
|
159
226
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
Optional output-token targets stop new and queued agents once reached;
|
|
163
|
-
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.
|
|
164
229
|
|
|
165
230
|
### Permissions and planning
|
|
166
231
|
|
|
167
|
-
**Auto mode is the default.** A classifier
|
|
168
|
-
while permission rules and deterministic checks enforce the
|
|
169
|
-
|
|
170
|
-
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.
|
|
171
235
|
|
|
172
|
-
|
|
173
|
-
Plan mode lets the agent investigate and write a plan file before you approve
|
|
174
|
-
implementation. Use `/permissions` to inspect rules and `/auto-mode` to
|
|
175
|
-
configure the classifier.
|
|
236
|
+
Project-provided hooks, MCP servers, and allow rules require trust approval.
|
|
176
237
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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.
|
|
180
241
|
|
|
181
|
-
|
|
182
|
-
|
|
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.
|
|
183
250
|
|
|
184
251
|
## 🧰 Everyday tools
|
|
185
252
|
|
|
186
|
-
| Capability |
|
|
253
|
+
| Capability | Included features |
|
|
187
254
|
|---|---|
|
|
188
|
-
| Code and files |
|
|
189
|
-
| Web | Search and fetch,
|
|
190
|
-
| 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`. |
|
|
191
258
|
| Long sessions | Per-repository memory, a session scratchpad, and context compaction. |
|
|
192
259
|
| Task tracking | A pinned progress widget, background monitors, and scheduled wake-ups. |
|
|
193
|
-
| Tool discovery |
|
|
194
|
-
| Reasoning and appearance | `/effort` or **shift+tab**
|
|
195
|
-
| 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. |
|
|
196
263
|
|
|
197
|
-
|
|
198
|
-
`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.
|
|
199
266
|
|
|
200
267
|
For scripting and session management:
|
|
201
268
|
|
|
202
269
|
```bash
|
|
203
270
|
onecode -p "Explain how authentication works in this repository"
|
|
204
|
-
onecode -c #
|
|
205
|
-
onecode --mode json # JSON
|
|
206
|
-
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.
|
|
207
274
|
```
|
|
208
275
|
|
|
209
|
-
See [Tools](docs/guide/tools.md) for
|
|
210
|
-
[command reference](docs/guide/reference.md) for
|
|
211
|
-
and environment
|
|
212
|
-
|
|
213
|
-
##
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
without native search. With neither key, the fallback is Exa's rate-limited
|
|
228
|
-
keyless endpoint, and One Code labels those results.
|
|
229
|
-
- **Native Windows:** hooks and background shells assume `/bin/sh` for now. Use
|
|
230
|
-
WSL until native Windows is verified.
|
|
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.
|
|
231
294
|
|
|
232
295
|
## 🔧 Install from source
|
|
233
296
|
|
|
234
|
-
|
|
297
|
+
To install the local extensions into an existing pi installation, run:
|
|
235
298
|
|
|
236
299
|
```bash
|
|
237
300
|
git clone https://github.com/IsuruMaduranga/one-code
|
|
@@ -242,12 +305,16 @@ pi install ./one-code
|
|
|
242
305
|
pi list
|
|
243
306
|
```
|
|
244
307
|
|
|
245
|
-
##
|
|
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.
|
|
246
312
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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.
|
|
250
317
|
|
|
251
318
|
## 📄 License
|
|
252
319
|
|
|
253
|
-
[MIT](LICENSE). Contributions welcome.
|
|
320
|
+
[MIT](LICENSE). Contributions are welcome.
|
package/docs/guide/README.md
CHANGED
|
@@ -35,6 +35,7 @@ If you've never run One Code, read these in order:
|
|
|
35
35
|
| [Sessions and context](sessions-and-context.md) | What the model sees, memory, compaction, the cache, recaps, and resuming sessions. |
|
|
36
36
|
| [Tasks and background work](tasks-and-background-work.md) | The task list, background shells, monitors, loops, and how results reach the model. |
|
|
37
37
|
| [Check your setup with doctor](doctor.md) | The report, the checkup, model presets, and the `onecode doctor` command. |
|
|
38
|
+
| [Windows](windows.md) | Git Bash and the PowerShell tool, `PowerShell(...)` rules, hooks' `shell` field, paths, and what is verified on native Windows. |
|
|
38
39
|
| [Differences from Claude Code](differences-from-claude-code.md) | What is different by design, what isn't provided, and known issues. |
|
|
39
40
|
| [Troubleshooting](troubleshooting.md) | Symptoms, causes, and fixes. |
|
|
40
41
|
| [Command and keyboard reference](reference.md) | Every command, shortcut, flag, environment variable, and file location. |
|
|
@@ -125,7 +125,7 @@ Set the subagent default with `/subagent`, or apply a preset with
|
|
|
125
125
|
## Permission settings
|
|
126
126
|
|
|
127
127
|
`/permissions` shows the mode and rules, `/allow` adds a rule, and
|
|
128
|
-
`/auto-mode setup` configures the classifier. **ctrl+q** cycles modes. To
|
|
128
|
+
`/auto-mode setup` configures the classifier. **ctrl+q** (**alt+m** on Windows and WSL) cycles modes. To
|
|
129
129
|
start a session in a given mode:
|
|
130
130
|
|
|
131
131
|
```bash
|
|
@@ -144,7 +144,7 @@ be installed and on the `PATH` used to launch One Code.
|
|
|
144
144
|
|
|
145
145
|
| Language | Server | Install |
|
|
146
146
|
|---|---|---|
|
|
147
|
-
| TypeScript, JavaScript | `typescript-language-server` | `npm install -g typescript-language-server typescript` |
|
|
147
|
+
| TypeScript, JavaScript | `typescript-language-server` | `npm install -g typescript-language-server`, plus `npm install -D typescript@5` in the project (the server reads the project's TypeScript and never a global one; TypeScript 7 no longer ships the `tsserver.js` it needs) |
|
|
148
148
|
| Python | `pyright-langserver` | `npm install -g pyright` |
|
|
149
149
|
| Go | `gopls` | `go install golang.org/x/tools/gopls@latest` |
|
|
150
150
|
| Rust | `rust-analyzer` | `rustup component add rust-analyzer` |
|
|
@@ -28,7 +28,7 @@ so nothing surprises you.
|
|
|
28
28
|
|---|---|---|
|
|
29
29
|
| Models | Anthropic models. | Any provider pi supports, switchable mid-session, with a different model per role. |
|
|
30
30
|
| Tool names on the wire | PascalCase (`Read`, `Bash`). | snake_case (`read`, `bash`); `Agent` and `SendMessage` keep their names. Claude Code names still work in rules and hook matchers. |
|
|
31
|
-
| Permission-mode key | shift+tab. | ctrl+q. pi reserves shift+tab for the reasoning-effort dial. |
|
|
31
|
+
| Permission-mode key | shift+tab. | ctrl+q; alt+m on Windows and WSL. pi reserves shift+tab for the reasoning-effort dial and, on Windows, ctrl+q for queuing a follow-up. |
|
|
32
32
|
| Task-list key | ctrl+t. | `/tasks show` and `/tasks hide`. pi reserves ctrl+t for thinking blocks. |
|
|
33
33
|
| Deleting files in auto mode | The whole project directory is trusted. | A delete is approved only when git can recover the file; otherwise the classifier decides. |
|
|
34
34
|
| Bypass mode | Protected paths stay protected. | Bypass mode bypasses everything, including protected paths. |
|
|
@@ -101,9 +101,18 @@ every model. The content is the same; only the placement differs.
|
|
|
101
101
|
|
|
102
102
|
- **macOS and Linux** are developed and verified. **WSL** works the same
|
|
103
103
|
way.
|
|
104
|
-
- **Native Windows**
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
- **Native Windows** follows Claude Code's shape: Git for Windows is
|
|
105
|
+
optional, PowerShell is the primary shell tool when it is enabled (on by
|
|
106
|
+
default on Windows, `CLAUDE_CODE_USE_POWERSHELL_TOOL=0` turns it off), and
|
|
107
|
+
your `PowerShell(...)` rules, `CLAUDE_CODE_GIT_BASH_PATH`, and per-hook
|
|
108
|
+
`shell` field work unchanged. The PowerShell tool's description is Claude
|
|
109
|
+
Code's own text. What differs: One Code has no PowerShell command parser
|
|
110
|
+
yet, so in auto mode every PowerShell command that isn't on Claude Code's
|
|
111
|
+
read-only cmdlet list goes to the classifier (Claude Code auto-approves
|
|
112
|
+
more in-project work), and the git-recoverability shortcut for in-project
|
|
113
|
+
deletes is bash-only. Verified on CI runners and through a `pwsh` on
|
|
114
|
+
macOS; a real Windows desktop has not been driven end to end yet. See
|
|
115
|
+
[Windows](windows.md).
|
|
107
116
|
|
|
108
117
|
## Provider notes
|
|
109
118
|
|
package/docs/guide/hooks.md
CHANGED
|
@@ -107,5 +107,17 @@ Set `CC_HOOKS_DEBUG=1` before launching to print each hook dispatch and its
|
|
|
107
107
|
outcome to stderr. Decisions are also appended to
|
|
108
108
|
`~/.onecode/hooks/hooks-decisions.jsonl` while the variable is set.
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
## Which shell runs a hook
|
|
111
|
+
|
|
112
|
+
Hooks run in bash, as in Claude Code: `/bin/bash` on macOS and Linux, Git
|
|
113
|
+
Bash on Windows (`CLAUDE_CODE_GIT_BASH_PATH` points at a different bash;
|
|
114
|
+
a value that isn't a bash or sh binary is ignored with a warning). A hook
|
|
115
|
+
can ask for PowerShell instead with Claude Code's `shell` field:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{ "type": "command", "command": "Get-Content $env:TEMP\\hook.log", "shell": "powershell" }
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
On a Windows machine without Git for Windows, hooks default to PowerShell.
|
|
122
|
+
Matchers accept `Bash|PowerShell` and `Bash,PowerShell` to cover both shell
|
|
123
|
+
tools. See [Windows](windows.md).
|