one-code-extension 0.3.0 → 0.4.0
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 +189 -94
- package/docs/guide/README.md +3 -2
- package/docs/guide/bring-your-claude-code-setup.md +7 -5
- package/docs/guide/configuration.md +7 -5
- package/docs/guide/differences-from-claude-code.md +25 -14
- package/docs/guide/doctor.md +5 -3
- package/docs/guide/hooks.md +20 -6
- package/docs/guide/installation.md +62 -12
- package/docs/guide/permissions-modes-and-auto-mode.md +46 -28
- package/docs/guide/providers-and-models.md +12 -10
- package/docs/guide/reference.md +9 -4
- package/docs/guide/sessions-and-context.md +23 -3
- package/docs/guide/skills-plugins-and-mcp.md +7 -5
- package/docs/guide/subagents-and-workflows.md +13 -11
- package/docs/guide/tasks-and-background-work.md +10 -8
- package/docs/guide/terminal-interface.md +7 -5
- package/docs/guide/tools.md +29 -5
- package/docs/guide/troubleshooting.md +26 -14
- package/docs/guide/windows.md +184 -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 +7 -4
- package/types/app.d.ts +18 -2
package/README.md
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
# One Code
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/IsuruMaduranga/one-code/actions/workflows/ci.yml)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
lets you choose the models. It includes subagents, plan mode, permissions,
|
|
7
|
-
skills, and git worktrees. Reuse your existing Claude Code setup, keep a capable model
|
|
8
|
-
in the main conversation, delegate routine work to a cheaper one, and switch
|
|
9
|
-
providers during a session.
|
|
5
|
+
**Claude Code with the model slot left open. The full workflow, open source, on any model or provider.**
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **Keep control as work grows.** Plan before editing, isolate changes in git
|
|
17
|
-
worktrees, and follow parallel agents from a live progress panel.
|
|
7
|
+
Claude Code is a good harness. It just ships bolted to one model. One Code
|
|
8
|
+
unbolts it, and runs the whole workflow (subagents, git worktrees, auto mode,
|
|
9
|
+
ultracode workflows, plan mode) on the model you pick. Keep Claude Code for the
|
|
10
|
+
work that earns its best model. Reach for One Code whenever a cheaper or
|
|
11
|
+
different model fits the job.
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
The parts that make the harness good (the steering, the permission gate, the
|
|
14
|
+
context management) live in the harness, not the model. One Code brings all of
|
|
15
|
+
them across, because the good part was never the logo.
|
|
21
16
|
|
|
22
17
|
<p align="center">
|
|
23
|
-
<img src="demo/onecode.gif" alt="One Code
|
|
18
|
+
<img src="demo/onecode.gif" alt="One Code: permission modes, a mid-session model switch, an agentic edit approved by auto mode, a /btw side question, /doctor report, and a subagent in the live panel" width="820">
|
|
24
19
|
</p>
|
|
25
20
|
|
|
26
21
|
[User guide](docs/guide/README.md) ·
|
|
@@ -28,10 +23,95 @@ Claude Code, with the bundled app's state kept in `~/.onecode`.
|
|
|
28
23
|
[Differences from Claude Code](docs/guide/differences-from-claude-code.md) ·
|
|
29
24
|
[Command reference](docs/guide/reference.md)
|
|
30
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:
|
|
32
51
|
|
|
33
|
-
|
|
34
|
-
|
|
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
|
+
## 🚀 Get started
|
|
111
|
+
|
|
112
|
+
You need **Node.js 22.19+**. One Code is developed and verified on macOS and
|
|
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).
|
|
35
115
|
|
|
36
116
|
```bash
|
|
37
117
|
npm install -g @one-ai/one-code
|
|
@@ -39,51 +119,56 @@ cd your-project
|
|
|
39
119
|
onecode
|
|
40
120
|
```
|
|
41
121
|
|
|
42
|
-
Inside One Code, run `/login` to connect a provider, then `/model` to
|
|
43
|
-
model. You can also
|
|
44
|
-
|
|
122
|
+
Inside One Code, run `/login` to connect a provider, then `/model` to pick a
|
|
123
|
+
model. You can also pass a provider key through an environment variable such as
|
|
124
|
+
`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`.
|
|
45
125
|
|
|
46
|
-
Open a project
|
|
47
|
-
|
|
126
|
+
Open a project that already has a `CLAUDE.md` or `.claude/` setup and One Code
|
|
127
|
+
reuses it right away. Starting fresh? `/init` drafts a `CLAUDE.md` for you.
|
|
48
128
|
|
|
49
|
-
Not sure what is
|
|
50
|
-
reports which providers have credentials, which model each role
|
|
51
|
-
of your Claude Code configuration was picked up, and which programs
|
|
52
|
-
`/doctor` runs the full checkup
|
|
129
|
+
Not sure what is wired up? Run `onecode doctor` (or `/doctor report` inside a
|
|
130
|
+
session). It reports which providers have credentials, which model each role
|
|
131
|
+
uses, what of your Claude Code configuration was picked up, and which programs
|
|
132
|
+
are missing. `/doctor` runs the full checkup and has the model fix what it finds.
|
|
53
133
|
|
|
54
|
-
One Code is free
|
|
55
|
-
provider. See [Providers and models](docs/guide/providers-and-models.md)
|
|
56
|
-
connection options.
|
|
134
|
+
One Code is free. Model access, usage charges, and rate limits are between you
|
|
135
|
+
and your provider. See [Providers and models](docs/guide/providers-and-models.md)
|
|
136
|
+
for connection options.
|
|
57
137
|
|
|
58
138
|
### Other ways to install
|
|
59
139
|
|
|
60
140
|
**Homebrew** installs Node for you:
|
|
61
141
|
|
|
62
142
|
```bash
|
|
63
|
-
brew install isurumaduranga/one-ai/
|
|
143
|
+
brew install isurumaduranga/one-ai/onecode
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Windows** without Node.js? This fetches Node for you and installs the app:
|
|
147
|
+
|
|
148
|
+
```powershell
|
|
149
|
+
powershell -c "irm https://raw.githubusercontent.com/IsuruMaduranga/one-code/master/install.ps1 | iex"
|
|
64
150
|
```
|
|
65
151
|
|
|
66
|
-
**Already
|
|
152
|
+
**Already on pi?** Add the extensions to your existing installation:
|
|
67
153
|
|
|
68
154
|
```bash
|
|
69
155
|
pi install npm:one-code-extension
|
|
70
156
|
```
|
|
71
157
|
|
|
72
158
|
The app package, [`@one-ai/one-code`](https://www.npmjs.com/package/@one-ai/one-code),
|
|
73
|
-
bundles a pinned pi
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
159
|
+
bundles a pinned pi and gives you the `onecode` command. The extension package,
|
|
160
|
+
[`one-code-extension`](https://www.npmjs.com/package/one-code-extension), runs on
|
|
161
|
+
your own pi and is tested against pi 0.83 to 0.86; use `pi` in place of `onecode`
|
|
162
|
+
for that install.
|
|
77
163
|
|
|
78
164
|
The app opens in a full-screen terminal interface by default. See the
|
|
79
|
-
[installation guide](docs/guide/installation.md) for display settings and more
|
|
80
|
-
details.
|
|
165
|
+
[installation guide](docs/guide/installation.md) for display settings and more.
|
|
81
166
|
|
|
82
|
-
## Put different models to work
|
|
167
|
+
## 🎛️ Put different models to work
|
|
83
168
|
|
|
84
169
|
A main conversation and a repository-wide investigation do not need the same
|
|
85
|
-
model.
|
|
86
|
-
|
|
170
|
+
model. Keep your preferred model in charge and let subagents use another
|
|
171
|
+
provider for exploration, tests, or review.
|
|
87
172
|
|
|
88
173
|
1. Choose the main model with `/model`.
|
|
89
174
|
2. Set the default for subagents and workflow agents with
|
|
@@ -93,22 +178,22 @@ subagents use another provider for exploration, tests, or review.
|
|
|
93
178
|
> Use subagents to investigate the authentication code and its tests.
|
|
94
179
|
> Have them report their findings, then make the fix in the main session.
|
|
95
180
|
|
|
96
|
-
Agent definitions in `.claude/agents/` can
|
|
97
|
-
|
|
98
|
-
|
|
181
|
+
Agent definitions in `.claude/agents/` can name their own model, tools, and
|
|
182
|
+
instructions. Use `/agents` to follow their progress and `/model` to change the
|
|
183
|
+
main model as the task changes.
|
|
99
184
|
|
|
100
|
-
This
|
|
101
|
-
|
|
185
|
+
This is where you decide where the money goes. Actual cost and quality depend on
|
|
186
|
+
the models, the task, and how much you delegate.
|
|
102
187
|
|
|
103
188
|
[Subagents and workflows →](docs/guide/subagents-and-workflows.md)
|
|
104
189
|
|
|
105
|
-
## Reuse the setup you already have
|
|
190
|
+
## ♻️ Reuse the setup you already have
|
|
106
191
|
|
|
107
|
-
One Code reads Claude Code configuration directly
|
|
192
|
+
One Code reads Claude Code configuration directly. There is no import step.
|
|
108
193
|
|
|
109
194
|
| Your configuration | How One Code uses it |
|
|
110
195
|
|---|---|
|
|
111
|
-
| `CLAUDE.md` | Project instructions, including nested files and `@path` imports. Falls back to `AGENTS.md` when no `CLAUDE.md
|
|
196
|
+
| `CLAUDE.md` | Project instructions, including nested files and `@path` imports. Falls back to `AGENTS.md` when a directory has no `CLAUDE.md`. |
|
|
112
197
|
| `.claude/skills/` and `.claude/commands/` | Discoverable skills and slash commands. |
|
|
113
198
|
| `.claude/agents/` | Subagent definitions with their model, tools, and instructions. |
|
|
114
199
|
| `.claude/settings.json` | `allow`, `deny`, and `ask` permission rules, plus supported command hooks. |
|
|
@@ -116,62 +201,60 @@ One Code reads Claude Code configuration directly, without an import step.
|
|
|
116
201
|
| Installed Claude Code plugins | Plugin agents, skills, commands, and MCP servers, namespaced by plugin. |
|
|
117
202
|
|
|
118
203
|
Claude Code tool names such as `Read`, `Bash`, `Edit`, and `Task` work in
|
|
119
|
-
permission rules and hook matchers. One Code
|
|
120
|
-
and treats `~/.claude` as read-only.
|
|
204
|
+
permission rules and hook matchers. One Code keeps its own settings separately
|
|
205
|
+
and treats `~/.claude` as read-only, so nothing you already have gets rewritten.
|
|
121
206
|
|
|
122
|
-
Compatibility covers
|
|
123
|
-
|
|
124
|
-
included.
|
|
207
|
+
Compatibility covers configuration and workflow surfaces. Features and skills
|
|
208
|
+
that need Claude Code's own hosted or desktop services are not included.
|
|
125
209
|
|
|
126
210
|
[Configuration details →](docs/guide/bring-your-claude-code-setup.md) ·
|
|
127
211
|
[Skills, plugins, and MCP →](docs/guide/skills-plugins-and-mcp.md)
|
|
128
212
|
|
|
129
|
-
## Workflows that scale with the task
|
|
213
|
+
## ⚙️ Workflows that scale with the task
|
|
130
214
|
|
|
131
215
|
### Subagents and git worktrees
|
|
132
216
|
|
|
133
217
|
Give an investigation its own context window and bring the result back to the
|
|
134
|
-
main conversation. Subagents run in the background,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
`plan`.
|
|
218
|
+
main conversation. Subagents run in the background, take follow-up messages, and
|
|
219
|
+
can fork the current conversation when they need its context. Three agent
|
|
220
|
+
definitions ship with One Code: `general-purpose`, `explore`, and `plan`.
|
|
138
221
|
|
|
139
|
-
For parallel edits, give agents
|
|
222
|
+
For parallel edits, give agents their own git worktrees. You can also move the
|
|
140
223
|
whole session into a worktree with `enter_worktree` and leave it with
|
|
141
224
|
`exit_worktree`.
|
|
142
225
|
|
|
143
226
|
### Ultracode workflows
|
|
144
227
|
|
|
145
|
-
|
|
146
|
-
|
|
228
|
+
Put **`ultracode`** in a request for a broad audit, migration, or review. The
|
|
229
|
+
model writes a JavaScript workflow that coordinates agents in parallel, with
|
|
147
230
|
progress visible in `/workflows`. Use `/effort ultracode` to keep this behavior
|
|
148
|
-
|
|
231
|
+
on across turns.
|
|
149
232
|
|
|
150
233
|
Resume an interrupted run to reuse completed agent calls whose inputs still
|
|
151
|
-
match. Save reusable scripts in `.claude/workflows/` to
|
|
234
|
+
match. Save reusable scripts in `.claude/workflows/` to call them by name.
|
|
152
235
|
Optional output-token targets stop new and queued agents once reached;
|
|
153
|
-
already
|
|
236
|
+
agents already running can finish above the target.
|
|
154
237
|
|
|
155
238
|
### Permissions and planning
|
|
156
239
|
|
|
157
|
-
**Auto mode is the default.** A classifier
|
|
158
|
-
while permission rules and deterministic checks enforce
|
|
159
|
-
|
|
160
|
-
|
|
240
|
+
**Auto mode is the default.** A classifier judges actions that need review,
|
|
241
|
+
while permission rules and deterministic checks enforce the rest. `deny` rules
|
|
242
|
+
beat `allow` rules. Trust approval covers project-provided hooks, MCP servers,
|
|
243
|
+
and allow rules.
|
|
161
244
|
|
|
162
|
-
Press **ctrl+q** to cycle through manual, accept-edits, plan, and auto modes.
|
|
163
|
-
Plan mode lets the agent investigate and write a
|
|
164
|
-
|
|
165
|
-
|
|
245
|
+
Press **ctrl+q** (**alt+m** on Windows and WSL) to cycle through manual, accept-edits, plan, and auto modes.
|
|
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.
|
|
166
249
|
|
|
167
250
|
The permission system is an application-level control. For OS-level isolation,
|
|
168
|
-
run One Code inside a container. The
|
|
169
|
-
|
|
251
|
+
run One Code inside a container. The guide spells out the guarantees and the
|
|
252
|
+
known gaps.
|
|
170
253
|
|
|
171
254
|
[Permissions and modes →](docs/guide/permissions-modes-and-auto-mode.md) ·
|
|
172
255
|
[Hooks →](docs/guide/hooks.md)
|
|
173
256
|
|
|
174
|
-
## Everyday tools
|
|
257
|
+
## 🧰 Everyday tools
|
|
175
258
|
|
|
176
259
|
| Capability | What you get |
|
|
177
260
|
|---|---|
|
|
@@ -180,12 +263,12 @@ out in the guide.
|
|
|
180
263
|
| Diagnostics | Language-server diagnostics after edits; install the relevant server on your `PATH`. |
|
|
181
264
|
| Long sessions | Per-repository memory, a session scratchpad, and context compaction. |
|
|
182
265
|
| Task tracking | A pinned progress widget, background monitors, and scheduled wake-ups. |
|
|
183
|
-
| Tool discovery | Deferred tools loaded when needed to
|
|
266
|
+
| Tool discovery | Deferred tools loaded when needed to keep prompt overhead down. |
|
|
184
267
|
| Reasoning and appearance | `/effort` or **shift+tab** for reasoning effort; `onecode` and `onecode-light` themes. |
|
|
185
268
|
| Customization | Extend One Code with pi extensions, themes, and settings. |
|
|
186
269
|
|
|
187
270
|
The bundled skills include `simplify`, `code-review`, `security-review`, and
|
|
188
|
-
`fewer-permission-prompts`. A project skill with the same name
|
|
271
|
+
`fewer-permission-prompts`. A project skill with the same name wins.
|
|
189
272
|
|
|
190
273
|
For scripting and session management:
|
|
191
274
|
|
|
@@ -197,28 +280,31 @@ onecode --permission-mode plan # start in plan mode
|
|
|
197
280
|
```
|
|
198
281
|
|
|
199
282
|
See [Tools](docs/guide/tools.md) for every tool the model can call and the
|
|
200
|
-
[command reference](docs/guide/reference.md) for every command, shortcut,
|
|
201
|
-
|
|
283
|
+
[command reference](docs/guide/reference.md) for every command, shortcut, flag,
|
|
284
|
+
and environment variable.
|
|
202
285
|
|
|
203
|
-
## Documentation
|
|
286
|
+
## 📚 Documentation
|
|
204
287
|
|
|
205
288
|
The [user guide](docs/guide/README.md) covers everything: installation,
|
|
206
289
|
providers and models, the terminal interface, configuration, permissions and
|
|
207
290
|
auto mode, hooks, subagents and workflows, skills, plugins, and MCP, tools,
|
|
208
|
-
sessions and context, background work, the doctor, differences from Claude
|
|
209
|
-
|
|
291
|
+
sessions and context, background work, the doctor, differences from Claude Code,
|
|
292
|
+
troubleshooting, and a full reference.
|
|
210
293
|
|
|
211
|
-
##
|
|
294
|
+
## 💡 Good to know
|
|
212
295
|
|
|
213
|
-
- **Providers:** end-to-end
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
296
|
+
- **Providers:** end-to-end testing has focused on Anthropic, OpenAI, and
|
|
297
|
+
OpenRouter. Other providers are less exercised, so expect the occasional rough
|
|
298
|
+
edge.
|
|
299
|
+
- **Web search:** set `BRAVE_SEARCH_API_KEY` or `TAVILY_API_KEY` on a provider
|
|
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.
|
|
220
306
|
|
|
221
|
-
## Install from source
|
|
307
|
+
## 🔧 Install from source
|
|
222
308
|
|
|
223
309
|
This installs the local extensions into an existing pi installation:
|
|
224
310
|
|
|
@@ -231,6 +317,15 @@ pi install ./one-code
|
|
|
231
317
|
pi list
|
|
232
318
|
```
|
|
233
319
|
|
|
234
|
-
##
|
|
320
|
+
## 🧠 Learn the ideas behind it
|
|
321
|
+
|
|
322
|
+
One Code is the production-scale companion to
|
|
323
|
+
[Harness Engineering 101](https://isuruwijesiri.com/harness-engineering-101/),
|
|
324
|
+
a sixteen-chapter series that builds these ideas up from first principles: what
|
|
325
|
+
a coding harness actually does, why the good parts are model-independent, and
|
|
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.
|
|
328
|
+
|
|
329
|
+
## 📄 License
|
|
235
330
|
|
|
236
331
|
[MIT](LICENSE). Contributions welcome.
|
package/docs/guide/README.md
CHANGED
|
@@ -6,7 +6,7 @@ One Code is and why it exists, see the [project README](../../README.md).
|
|
|
6
6
|
|
|
7
7
|
## Start here
|
|
8
8
|
|
|
9
|
-
If you
|
|
9
|
+
If you've never run One Code, read these in order:
|
|
10
10
|
|
|
11
11
|
1. [Install One Code](installation.md). Install it and open your first
|
|
12
12
|
session.
|
|
@@ -35,7 +35,8 @@ If you have 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
|
-
| [
|
|
38
|
+
| [Windows](windows.md) | Git Bash and the PowerShell tool, `PowerShell(...)` rules, hooks' `shell` field, paths, and what is verified on native Windows. |
|
|
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. |
|
|
41
42
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Bring your Claude Code setup
|
|
2
2
|
|
|
3
|
+
[← One Code user guide](README.md)
|
|
4
|
+
|
|
3
5
|
One Code reads the same configuration files as Claude Code, so your
|
|
4
|
-
existing setup works without changes. There
|
|
6
|
+
existing setup works without changes. There's no import step and nothing
|
|
5
7
|
to convert. Open a project that already has a `.claude/` directory, and One
|
|
6
8
|
Code picks up each of the following as it is.
|
|
7
9
|
|
|
@@ -17,12 +19,12 @@ If a directory has no `CLAUDE.md`, One Code uses its `AGENTS.md` instead, so
|
|
|
17
19
|
a repository that standardized on `AGENTS.md` works too. A `CLAUDE.md` takes
|
|
18
20
|
precedence over an `AGENTS.md` in the same directory.
|
|
19
21
|
|
|
20
|
-
To give One Code instructions that Claude Code
|
|
22
|
+
To give One Code instructions that Claude Code shouldn't read, add an
|
|
21
23
|
`ONECODE.md`. See [ONECODE.md](sessions-and-context.md#onecodemd).
|
|
22
24
|
|
|
23
25
|
To generate a `CLAUDE.md` for a project that lacks one, run `/init`. It has
|
|
24
26
|
the model survey the project (build, test, and lint commands, layout,
|
|
25
|
-
existing AI-tool configuration), ask you about what the code
|
|
27
|
+
existing AI-tool configuration), ask you about what the code can't answer,
|
|
26
28
|
and write the file. It never overwrites an existing `CLAUDE.md` silently.
|
|
27
29
|
|
|
28
30
|
## Skills, commands, and agents
|
|
@@ -74,7 +76,7 @@ The keys One Code honors:
|
|
|
74
76
|
| Key | Scopes | Notes |
|
|
75
77
|
|---|---|---|
|
|
76
78
|
| `permissions.allow`, `permissions.deny`, `permissions.ask` | All | Project allow rules need one-time approval. See [Permissions](permissions-modes-and-auto-mode.md#permission-rules). |
|
|
77
|
-
| `permissions.defaultMode` | All | A project file
|
|
79
|
+
| `permissions.defaultMode` | All | A project file can't select `auto` or `bypassPermissions`. |
|
|
78
80
|
| `permissions.disableBypassPermissionsMode` | All | `"disable"` refuses bypass mode from any source. |
|
|
79
81
|
| `autoMode.*` | User, managed | Never read from project files. See [Configure auto mode](permissions-modes-and-auto-mode.md#configure-auto-mode). |
|
|
80
82
|
| `hooks` | All | Project hooks need one-time approval. See [Hooks](hooks.md). |
|
|
@@ -120,7 +122,7 @@ See [Where settings live](configuration.md#where-settings-live).
|
|
|
120
122
|
|
|
121
123
|
## What does not carry over
|
|
122
124
|
|
|
123
|
-
Features that need Claude Code's own hosted or desktop services
|
|
125
|
+
Features that need Claude Code's own hosted or desktop services aren't
|
|
124
126
|
available. For the full list of tools, commands, and skills that are
|
|
125
127
|
missing or different, see
|
|
126
128
|
[Differences from Claude Code](differences-from-claude-code.md).
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Configure One Code
|
|
2
2
|
|
|
3
|
+
[← One Code user guide](README.md)
|
|
4
|
+
|
|
3
5
|
Use this page to find the right settings file, learn what One Code stores
|
|
4
6
|
and where, change the terminal appearance, and set up language-server
|
|
5
7
|
diagnostics. Provider keys are covered in
|
|
@@ -36,7 +38,7 @@ atomically; a malformed file is reported rather than overwritten.
|
|
|
36
38
|
| `PI_CODING_AGENT_DIR` | pi's agent directory. The bundled app sets it to `~/.onecode/agent`. |
|
|
37
39
|
| `CLAUDE_CONFIG_DIR` | Where Claude Code's user configuration is read from (default `~/.claude`). |
|
|
38
40
|
|
|
39
|
-
Setting one
|
|
41
|
+
Setting one doesn't move the others.
|
|
40
42
|
|
|
41
43
|
## What is stored under ~/.onecode
|
|
42
44
|
|
|
@@ -123,7 +125,7 @@ Set the subagent default with `/subagent`, or apply a preset with
|
|
|
123
125
|
## Permission settings
|
|
124
126
|
|
|
125
127
|
`/permissions` shows the mode and rules, `/allow` adds a rule, and
|
|
126
|
-
`/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
|
|
127
129
|
start a session in a given mode:
|
|
128
130
|
|
|
129
131
|
```bash
|
|
@@ -142,7 +144,7 @@ be installed and on the `PATH` used to launch One Code.
|
|
|
142
144
|
|
|
143
145
|
| Language | Server | Install |
|
|
144
146
|
|---|---|---|
|
|
145
|
-
| 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) |
|
|
146
148
|
| Python | `pyright-langserver` | `npm install -g pyright` |
|
|
147
149
|
| Go | `gopls` | `go install golang.org/x/tools/gopls@latest` |
|
|
148
150
|
| Rust | `rust-analyzer` | `rustup component add rust-analyzer` |
|
|
@@ -154,7 +156,7 @@ its files, from the nearest directory that has a project marker such as
|
|
|
154
156
|
server that crashes is restarted twice, then disabled for the session.
|
|
155
157
|
|
|
156
158
|
If the project's TypeScript installation lacks `lib/tsserver.js`
|
|
157
|
-
(TypeScript 7's native compiler), the server
|
|
159
|
+
(TypeScript 7's native compiler), the server can't start; One Code
|
|
158
160
|
reports this. Install a TypeScript 5.x development dependency in that
|
|
159
161
|
project.
|
|
160
162
|
|
|
@@ -163,7 +165,7 @@ precedence over the built-in table for the file extensions it claims.
|
|
|
163
165
|
|
|
164
166
|
Run `/lsp` to see each server's status and diagnostic count, start
|
|
165
167
|
failures, and plugin configuration problems. `/doctor report` lists the
|
|
166
|
-
servers your project needs and whether they
|
|
168
|
+
servers your project needs and whether they're installed.
|
|
167
169
|
|
|
168
170
|
## Environment variables
|
|
169
171
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Differences from Claude Code
|
|
2
2
|
|
|
3
|
+
[← One Code user guide](README.md)
|
|
4
|
+
|
|
3
5
|
One Code recreates Claude Code's workflow on the pi agent harness with your
|
|
4
6
|
choice of model. Most of what you know carries over. This page lists what
|
|
5
|
-
is deliberately different, what
|
|
7
|
+
is deliberately different, what isn't provided, and the known limitations,
|
|
6
8
|
so nothing surprises you.
|
|
7
9
|
|
|
8
10
|
## What is the same
|
|
@@ -26,7 +28,7 @@ so nothing surprises you.
|
|
|
26
28
|
|---|---|---|
|
|
27
29
|
| Models | Anthropic models. | Any provider pi supports, switchable mid-session, with a different model per role. |
|
|
28
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. |
|
|
29
|
-
| 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. |
|
|
30
32
|
| Task-list key | ctrl+t. | `/tasks show` and `/tasks hide`. pi reserves ctrl+t for thinking blocks. |
|
|
31
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. |
|
|
32
34
|
| Bypass mode | Protected paths stay protected. | Bypass mode bypasses everything, including protected paths. |
|
|
@@ -46,9 +48,9 @@ have no equivalent here: `Artifact`, `ReportFindings`,
|
|
|
46
48
|
`ShareOnboardingGuide`, `PushNotification`, `RemoteTrigger`, `DesignSync`,
|
|
47
49
|
`CronCreate`, `CronList`, `CronDelete`, `EndConversation`, and
|
|
48
50
|
`SendFeedback`. Scheduling within a session is available through `/loop`
|
|
49
|
-
and `schedule_wakeup`; scheduled cloud sessions
|
|
51
|
+
and `schedule_wakeup`; scheduled cloud sessions aren't.
|
|
50
52
|
|
|
51
|
-
The `Agent` tool's remote isolation option
|
|
53
|
+
The `Agent` tool's remote isolation option isn't implemented.
|
|
52
54
|
|
|
53
55
|
## Commands that are not provided
|
|
54
56
|
|
|
@@ -81,17 +83,17 @@ action but never pre-approve one. See [Hooks](hooks.md).
|
|
|
81
83
|
|
|
82
84
|
## Settings keys that are ignored
|
|
83
85
|
|
|
84
|
-
`permissions.additionalDirectories`
|
|
86
|
+
`permissions.additionalDirectories` isn't honored. The `env` block is read
|
|
85
87
|
only for `CLAUDE_CODE_SUBAGENT_MODEL`, and only from user and managed
|
|
86
88
|
scope. `includeCoAuthoredBy`, `apiKeyHelper`, `forceLoginMethod`,
|
|
87
|
-
`cleanupPeriodDays`, and `spinnerTipsEnabled`
|
|
89
|
+
`cleanupPeriodDays`, and `spinnerTipsEnabled` aren't read. Run
|
|
88
90
|
`/doctor report` to see, per file, which keys were used, ignored, or
|
|
89
91
|
refused.
|
|
90
92
|
|
|
91
93
|
## Prompt layout on Anthropic models
|
|
92
94
|
|
|
93
95
|
Claude Code delivers part of its reminder stack to Opus and Sonnet as a
|
|
94
|
-
system-role message after the first user message. pi's message model
|
|
96
|
+
system-role message after the first user message. pi's message model can't
|
|
95
97
|
express that, so One Code uses the layout Claude Code uses for Haiku on
|
|
96
98
|
every model. The content is the same; only the placement differs.
|
|
97
99
|
|
|
@@ -99,9 +101,18 @@ every model. The content is the same; only the placement differs.
|
|
|
99
101
|
|
|
100
102
|
- **macOS and Linux** are developed and verified. **WSL** works the same
|
|
101
103
|
way.
|
|
102
|
-
- **Native Windows**
|
|
103
|
-
|
|
104
|
-
|
|
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).
|
|
105
116
|
|
|
106
117
|
## Provider notes
|
|
107
118
|
|
|
@@ -110,7 +121,7 @@ every model. The content is the same; only the placement differs.
|
|
|
110
121
|
- Some models reject options that others accept. One Code sends minimal
|
|
111
122
|
options to its side calls (classifier, recap, reader) for this reason. A
|
|
112
123
|
provider incompatibility in a side call fails closed: a classifier that
|
|
113
|
-
|
|
124
|
+
can't answer blocks the action.
|
|
114
125
|
- Prompt-cache lifetime and pricing are the provider's. The extended
|
|
115
126
|
one-hour cache applies to Anthropic; other providers use their own
|
|
116
127
|
values.
|
|
@@ -119,7 +130,7 @@ every model. The content is the same; only the placement differs.
|
|
|
119
130
|
|
|
120
131
|
- A write or edit tool can reach a file that only a `Bash` deny rule
|
|
121
132
|
protects, because in-project writes take the deterministic fast path in
|
|
122
|
-
auto mode and
|
|
133
|
+
auto mode and aren't classified. Write `deny` rules for the write tools
|
|
123
134
|
as well. This is documented and accepted rather than fixed.
|
|
124
135
|
- GLM-5.3 and GLM-5.3 Flash, used as the classifier, approve a request to
|
|
125
136
|
back up the project to an unnamed outside location that the ruleset says
|
|
@@ -127,7 +138,7 @@ every model. The content is the same; only the placement differs.
|
|
|
127
138
|
- Running a skill in a one-shot run (`-p '/simplify'`) delivers the skill
|
|
128
139
|
but starts no model turn, so the process exits without doing anything.
|
|
129
140
|
Interactive sessions are unaffected.
|
|
130
|
-
- The reasoning effort set with `/effort`
|
|
141
|
+
- The reasoning effort set with `/effort` doesn't persist across
|
|
131
142
|
restarts; the model chosen with `/model` does. To save a level, open
|
|
132
143
|
pi's `/thinking` picker and press **ctrl+s**, or pass `--thinking`.
|
|
133
144
|
- A subagent spawn that is blocked before it starts can leave its requested
|
|
@@ -145,6 +156,6 @@ every model. The content is the same; only the placement differs.
|
|
|
145
156
|
has had limited live testing.
|
|
146
157
|
- Plugin marketplaces support git and local sources only; npm and pip
|
|
147
158
|
sources, version pinning, dependency resolution, and enterprise
|
|
148
|
-
blocklists
|
|
159
|
+
blocklists aren't implemented.
|
|
149
160
|
|
|
150
161
|
Open work is tracked in the project's issue tracker on GitHub.
|