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.
Files changed (113) hide show
  1. package/README.md +214 -147
  2. package/docs/guide/README.md +1 -0
  3. package/docs/guide/configuration.md +2 -2
  4. package/docs/guide/differences-from-claude-code.md +13 -4
  5. package/docs/guide/hooks.md +14 -2
  6. package/docs/guide/installation.md +54 -6
  7. package/docs/guide/permissions-modes-and-auto-mode.md +23 -7
  8. package/docs/guide/reference.md +5 -2
  9. package/docs/guide/sessions-and-context.md +18 -0
  10. package/docs/guide/terminal-interface.md +1 -1
  11. package/docs/guide/tools.md +24 -2
  12. package/docs/guide/troubleshooting.md +14 -4
  13. package/docs/guide/windows.md +189 -0
  14. package/extensions/auto-mode/actions.ts +3 -1
  15. package/extensions/auto-mode/paths.ts +21 -23
  16. package/extensions/auto-mode/safety-floor.ts +44 -6
  17. package/extensions/auto-mode/shell-analysis.ts +25 -10
  18. package/extensions/auto-mode/transcript.ts +15 -5
  19. package/extensions/background/index.ts +83 -34
  20. package/extensions/background/monitor-batch.ts +7 -5
  21. package/extensions/background/wakeup.ts +18 -24
  22. package/extensions/bash/background.ts +19 -10
  23. package/extensions/bash/guards.ts +36 -16
  24. package/extensions/bash/index.ts +36 -166
  25. package/extensions/branding/index.ts +35 -4
  26. package/extensions/btw/index.ts +207 -0
  27. package/extensions/btw/panel.ts +179 -0
  28. package/extensions/btw/prompt.ts +45 -0
  29. package/extensions/clear/index.ts +15 -0
  30. package/extensions/compaction/fit.ts +9 -6
  31. package/extensions/doctor/build.ts +22 -2
  32. package/extensions/doctor/dependencies.ts +63 -31
  33. package/extensions/doctor/fix-prompt.ts +12 -4
  34. package/extensions/doctor/index.ts +1 -0
  35. package/extensions/doctor/models.ts +2 -1
  36. package/extensions/doctor/report.ts +2 -3
  37. package/extensions/doctor/update-lookup.ts +19 -11
  38. package/extensions/effort/index.ts +2 -1
  39. package/extensions/footer/footer-line.ts +19 -0
  40. package/extensions/footer/index.ts +25 -5
  41. package/extensions/hooks/executor.ts +84 -18
  42. package/extensions/hooks/index.ts +1 -0
  43. package/extensions/hooks/matcher.ts +23 -9
  44. package/extensions/hooks/settings.ts +15 -0
  45. package/extensions/lib/branch-restore.ts +12 -0
  46. package/extensions/lib/claude-context.ts +2 -3
  47. package/extensions/lib/claude-settings.ts +19 -0
  48. package/extensions/lib/command-launch.ts +71 -0
  49. package/extensions/lib/deferred.ts +173 -33
  50. package/extensions/lib/git.ts +16 -0
  51. package/extensions/lib/keys.ts +38 -0
  52. package/extensions/lib/local-command.ts +112 -0
  53. package/extensions/lib/model-facts.generated.json +263 -68
  54. package/extensions/lib/model-policy.ts +13 -0
  55. package/extensions/lib/model-tier.ts +16 -5
  56. package/extensions/lib/notifications.ts +547 -53
  57. package/extensions/lib/paths.ts +130 -2
  58. package/extensions/lib/pi-ai-estimate.ts +57 -26
  59. package/extensions/lib/pi-version.ts +1 -1
  60. package/extensions/lib/process-tree.ts +131 -5
  61. package/extensions/lib/reminders.ts +80 -27
  62. package/extensions/lib/scratchpad.ts +11 -10
  63. package/extensions/lib/shell-spawn.ts +298 -0
  64. package/extensions/lib/shell-tool.ts +252 -0
  65. package/extensions/lib/shell-tools.ts +13 -0
  66. package/extensions/lib/side-call.ts +76 -0
  67. package/extensions/lib/tui-render.ts +62 -11
  68. package/extensions/lib/update-check.mjs +155 -0
  69. package/extensions/lib/usage-bus.ts +1 -1
  70. package/extensions/lib/which.ts +62 -0
  71. package/extensions/lib/worktree-channel.ts +18 -0
  72. package/extensions/lib/worktree-isolation.ts +2 -1
  73. package/extensions/lsp/client.ts +14 -3
  74. package/extensions/lsp/index.ts +12 -5
  75. package/extensions/lsp/install-hints.ts +33 -3
  76. package/extensions/lsp/plugin-servers.ts +2 -2
  77. package/extensions/lsp/servers.ts +29 -7
  78. package/extensions/mcp/index.ts +3 -2
  79. package/extensions/memory/entries.ts +9 -6
  80. package/extensions/memory/index.ts +3 -2
  81. package/extensions/memory/open-external.ts +4 -1
  82. package/extensions/model-default/index.ts +21 -2
  83. package/extensions/permissions/index.ts +57 -28
  84. package/extensions/permissions/matcher.ts +120 -33
  85. package/extensions/permissions/modes.ts +14 -6
  86. package/extensions/permissions/powershell-rules.ts +549 -0
  87. package/extensions/permissions/session-grant.ts +9 -9
  88. package/extensions/plugins/index.ts +3 -2
  89. package/extensions/plugins/install/install.ts +1 -1
  90. package/extensions/powershell/description.ts +139 -0
  91. package/extensions/powershell/guards.ts +91 -0
  92. package/extensions/powershell/index.ts +89 -0
  93. package/extensions/powershell/policy.ts +91 -0
  94. package/extensions/recap/index.ts +10 -24
  95. package/extensions/recap/prompt.ts +3 -3
  96. package/extensions/session-title/index.ts +120 -0
  97. package/extensions/session-title/title.ts +111 -0
  98. package/extensions/skill/index.ts +40 -18
  99. package/extensions/skill/invoke.ts +1 -0
  100. package/extensions/subagents/hand-back-review.ts +10 -12
  101. package/extensions/subagents/index.ts +221 -78
  102. package/extensions/subagents/model-select.ts +75 -7
  103. package/extensions/system-prompt/environment.ts +14 -1
  104. package/extensions/system-reminder/index.ts +9 -0
  105. package/extensions/tasks/index.ts +2 -1
  106. package/extensions/tool-search/index.ts +41 -20
  107. package/extensions/workflow/agent-session.ts +6 -4
  108. package/extensions/workflow/index.ts +28 -5
  109. package/extensions/worktree/guards.ts +5 -4
  110. package/extensions/worktree/index.ts +15 -2
  111. package/extensions/worktree/rewrite.ts +17 -0
  112. package/package.json +9 -5
  113. package/types/app.d.ts +18 -2
package/README.md CHANGED
@@ -1,50 +1,37 @@
1
1
  # One Code
2
2
 
3
+ [![CI](https://github.com/IsuruMaduranga/one-code/actions/workflows/ci.yml/badge.svg)](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
- Claude Code is a good harness. It just ships bolted to one model. One Code
6
- unbolts it, and runs the whole workflow (subagents, git worktrees, auto mode,
7
- ultracode workflows, plan mode) on the model you pick. Keep Claude Code for the
8
- work that earns its best model. Reach for One Code whenever a cheaper or
9
- different model fits the job.
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
- The parts that make the harness good (the steering, the permission gate, the
12
- context management) live in the harness, not the model. One Code brings all of
13
- them across, because the good part was never the logo.
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 switching models and running an agentic task" width="820">
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
- [Bring your Claude Code setup](docs/guide/bring-your-claude-code-setup.md) ·
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
- You need **Node.js 22.19+**. One Code is developed and verified on macOS and
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 pick a
56
- model. You can also pass a provider key through an environment variable such as
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
- Open a project that already has a `CLAUDE.md` or `.claude/` setup and One Code
60
- reuses it right away. Starting fresh? `/init` drafts a `CLAUDE.md` for you.
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
- Not sure what is wired up? Run `onecode doctor` (or `/doctor report` inside a
63
- session). It reports which providers have credentials, which model each role
64
- uses, what of your Claude Code configuration was picked up, and which programs
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 free. Model access, usage charges, and rate limits are between you
68
- and your provider. See [Providers and models](docs/guide/providers-and-models.md)
69
- for connection options.
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
- ### Other ways to install
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
- **Homebrew** installs Node for you:
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
- **Already on pi?** Add the extensions to your existing installation:
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 app package, [`@one-ai/one-code`](https://www.npmjs.com/package/@one-ai/one-code),
86
- bundles a pinned pi and gives you the `onecode` command. The extension package,
87
- [`one-code-extension`](https://www.npmjs.com/package/one-code-extension), runs on
88
- your own pi and is tested against pi 0.83 to 0.85; use `pi` in place of `onecode`
89
- for that install.
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
- ## 🎛️ Put different models to work
95
-
96
- A main conversation and a repository-wide investigation do not need the same
97
- model. Keep your preferred model in charge and let subagents use another
98
- provider for exploration, tests, or review.
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, for example:
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 name their own model, tools, and
109
- instructions. Use `/agents` to follow their progress and `/model` to change the
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
- This is where you decide where the money goes. Actual cost and quality depend on
113
- the models, the task, and how much you delegate.
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
- [Subagents and workflows →](docs/guide/subagents-and-workflows.md)
176
+ ## ♻️ Reuse your Claude Code setup
116
177
 
117
- ## ♻️ Reuse the setup you already have
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
- One Code reads Claude Code configuration directly. There is no import step.
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 their model, tools, and instructions. |
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. One Code keeps its own settings separately
132
- and treats `~/.claude` as read-only, so nothing you already have gets rewritten.
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
- Compatibility covers configuration and workflow surfaces. Features and skills
135
- that need Claude Code's own hosted or desktop services are not included.
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
- [Configuration details →](docs/guide/bring-your-claude-code-setup.md) ·
138
- [Skills, plugins, and MCP →](docs/guide/skills-plugins-and-mcp.md)
201
+ ## ⚙️ Plan and delegate work
139
202
 
140
- ## ⚙️ Workflows that scale with the task
203
+ ### Subagents and Git worktrees
141
204
 
142
- ### Subagents and git worktrees
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
- Give an investigation its own context window and bring the result back to the
145
- main conversation. Subagents run in the background, take follow-up messages, and
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 their own git worktrees. You can also move the
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
- Put **`ultracode`** in a request for a broad audit, migration, or review. The
156
- model writes a JavaScript workflow that coordinates agents in parallel, with
157
- progress visible in `/workflows`. Use `/effort ultracode` to keep this behavior
158
- on across turns.
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
- Resume an interrupted run to reuse completed agent calls whose inputs still
161
- match. Save reusable scripts in `.claude/workflows/` to call them by name.
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 judges actions that need review,
168
- while permission rules and deterministic checks enforce the rest. `deny` rules
169
- beat `allow` rules. Trust approval covers project-provided hooks, MCP servers,
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
- Press **ctrl+q** to cycle through manual, accept-edits, plan, and auto modes.
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
- The permission system is an application-level control. For OS-level isolation,
178
- run One Code inside a container. The guide spells out the guarantees and the
179
- known gaps.
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
- [Permissions and modes →](docs/guide/permissions-modes-and-auto-mode.md) ·
182
- [Hooks →](docs/guide/hooks.md)
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 | What you get |
253
+ | Capability | Included features |
187
254
  |---|---|
188
- | Code and files | Read, write, edit, shell commands, background processes, repository search, and notebook editing. |
189
- | Web | Search and fetch, with provider search or Brave, Tavily, and Exa fallbacks. |
190
- | Diagnostics | Language-server diagnostics after edits; install the relevant server on your `PATH`. |
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 | Deferred tools loaded when needed to keep prompt overhead down. |
194
- | Reasoning and appearance | `/effort` or **shift+tab** for reasoning effort; `onecode` and `onecode-light` themes. |
195
- | Customization | Extend One Code with pi extensions, themes, and settings. |
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
- The bundled skills include `simplify`, `code-review`, `security-review`, and
198
- `fewer-permission-prompts`. A project skill with the same name wins.
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 # continue the previous session
205
- onecode --mode json # JSON event output
206
- onecode --permission-mode plan # start in plan mode
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 every tool the model can call and the
210
- [command reference](docs/guide/reference.md) for every command, shortcut, flag,
211
- and environment variable.
212
-
213
- ## 📚 Documentation
214
-
215
- The [user guide](docs/guide/README.md) covers everything: installation,
216
- providers and models, the terminal interface, configuration, permissions and
217
- auto mode, hooks, subagents and workflows, skills, plugins, and MCP, tools,
218
- sessions and context, background work, the doctor, differences from Claude Code,
219
- troubleshooting, and a full reference.
220
-
221
- ## 💡 Good to know
222
-
223
- - **Providers:** end-to-end testing has focused on Anthropic, OpenAI, and
224
- OpenRouter. Other providers are less exercised, so expect the occasional rough
225
- edge.
226
- - **Web search:** set `BRAVE_SEARCH_API_KEY` or `TAVILY_API_KEY` on a provider
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
- This installs the local extensions into an existing pi installation:
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
- ## 🧠 Learn the ideas behind it
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
- One Code is the practical companion to the Harness Engineering 101 series, which
248
- builds these ideas up from first principles: what a coding harness actually does,
249
- and why the good parts are model-independent.
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.
@@ -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** is untested and unsupported. Hooks run through
105
- `/bin/sh`, background shells fall back to it when `SHELL` is unset, and
106
- no PowerShell tool exists. Use WSL.
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
 
@@ -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
- Hooks run through `/bin/sh`. On native Windows this path doesn't exist,
111
- which is one reason native Windows is unsupported; use WSL.
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).