one-code-extension 0.1.3 → 0.3.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/LICENSE +20 -0
- package/README.md +200 -172
- package/agents/explore.md +9 -6
- package/agents/general-purpose.md +1 -1
- package/agents/plan.md +6 -4
- package/docs/guide/README.md +52 -0
- package/docs/guide/bring-your-claude-code-setup.md +126 -0
- package/docs/guide/configuration.md +171 -0
- package/docs/guide/differences-from-claude-code.md +150 -0
- package/docs/guide/doctor.md +86 -0
- package/docs/guide/hooks.md +109 -0
- package/docs/guide/installation.md +124 -0
- package/docs/guide/permissions-modes-and-auto-mode.md +450 -0
- package/docs/guide/providers-and-models.md +194 -0
- package/docs/guide/reference.md +224 -0
- package/docs/guide/sessions-and-context.md +190 -0
- package/docs/guide/skills-plugins-and-mcp.md +176 -0
- package/docs/guide/subagents-and-workflows.md +193 -0
- package/docs/guide/tasks-and-background-work.md +111 -0
- package/docs/guide/terminal-interface.md +155 -0
- package/docs/guide/tools.md +175 -0
- package/docs/guide/troubleshooting.md +175 -0
- package/extensions/ask-user/index.ts +65 -71
- package/extensions/ask-user/questions.ts +15 -28
- package/extensions/ask-user/widget.ts +533 -0
- package/extensions/auto-mode/actions.ts +9 -26
- package/extensions/auto-mode/classifier-prompt.ts +127 -0
- package/extensions/auto-mode/classifier.ts +305 -227
- package/extensions/auto-mode/config.ts +279 -77
- package/extensions/auto-mode/defaults.ts +17 -60
- package/extensions/auto-mode/instructions.ts +2 -1
- package/extensions/auto-mode/model-picker.ts +53 -31
- package/extensions/auto-mode/model-select.ts +153 -82
- package/extensions/auto-mode/paths.ts +13 -1
- package/extensions/auto-mode/pause.ts +8 -0
- package/extensions/auto-mode/prompt.ts +205 -238
- package/extensions/auto-mode/recoverability.ts +229 -0
- package/extensions/auto-mode/rules.ts +92 -75
- package/extensions/auto-mode/safety-floor.ts +43 -12
- package/extensions/auto-mode/sensitive.ts +11 -0
- package/extensions/auto-mode/setup-run.ts +245 -0
- package/extensions/auto-mode/setup.ts +235 -0
- package/extensions/auto-mode/shell-analysis.ts +332 -26
- package/extensions/auto-mode/transcript.ts +102 -0
- package/extensions/background/index.ts +256 -43
- package/extensions/background/monitor-batch.ts +58 -0
- package/extensions/background/registry.ts +9 -0
- package/extensions/background/wakeup.ts +45 -0
- package/extensions/bash/background.ts +47 -22
- package/extensions/bash/guards.ts +229 -0
- package/extensions/bash/index.ts +81 -19
- package/extensions/branding/index.ts +44 -18
- package/extensions/branding/startup.ts +23 -8
- package/extensions/claude-compat/index.ts +17 -2
- package/extensions/claude-context/index.ts +41 -12
- package/extensions/clear/index.ts +27 -0
- package/extensions/compaction/fit.ts +121 -0
- package/extensions/compaction/index.ts +176 -71
- package/extensions/compaction/prompt.ts +21 -1
- package/extensions/context-budget/budget.ts +61 -0
- package/extensions/context-budget/index.ts +66 -0
- package/extensions/context-management/index.ts +40 -16
- package/extensions/doctor/build.ts +226 -0
- package/extensions/doctor/cli.ts +99 -0
- package/extensions/doctor/compat.ts +532 -0
- package/extensions/doctor/dependencies.ts +186 -0
- package/extensions/doctor/fix-prompt.ts +125 -0
- package/extensions/doctor/index.ts +308 -0
- package/extensions/doctor/models.ts +231 -0
- package/extensions/doctor/presets.ts +208 -0
- package/extensions/doctor/report.ts +189 -0
- package/extensions/doctor/update-lookup.ts +46 -0
- package/extensions/doctor/viewer.ts +124 -0
- package/extensions/effort/index.ts +41 -4
- package/extensions/effort/slider.ts +33 -2
- package/extensions/file-tracker/index.ts +143 -20
- package/extensions/file-tracker/replay.ts +46 -0
- package/extensions/file-tracker/tracker.ts +51 -4
- package/extensions/footer/footer-line.ts +207 -0
- package/extensions/footer/index.ts +152 -0
- package/extensions/footer/pr.ts +53 -0
- package/extensions/hooks/executor.ts +57 -20
- package/extensions/hooks/formatter-notice.ts +76 -0
- package/extensions/hooks/index.ts +314 -73
- package/extensions/hooks/matcher.ts +35 -1
- package/extensions/hooks/plugin-hooks.ts +3 -3
- package/extensions/hooks/protocol.ts +58 -0
- package/extensions/hooks/subagent-bridge.ts +77 -0
- package/extensions/hooks/trust.ts +15 -4
- package/extensions/init/index.ts +26 -0
- package/extensions/init/prompt.ts +40 -0
- package/extensions/interrupted/index.ts +35 -0
- package/extensions/interrupted/line.ts +9 -0
- package/extensions/lib/abort.ts +15 -0
- package/extensions/lib/agent-loader.ts +183 -0
- package/extensions/lib/anthropic-payload.ts +15 -0
- package/extensions/lib/atomic-write.ts +56 -0
- package/extensions/lib/bridge-watch.ts +20 -0
- package/extensions/lib/cache-retention.ts +60 -0
- package/extensions/lib/capability-index.ts +466 -0
- package/extensions/lib/claude-context.ts +318 -27
- package/extensions/lib/claude-settings.ts +64 -0
- package/extensions/lib/consent-preview.ts +30 -0
- package/extensions/lib/deferred.ts +144 -13
- package/extensions/lib/favorites.ts +43 -0
- package/extensions/lib/fetch-timeout.ts +15 -0
- package/extensions/lib/frontmatter.ts +31 -0
- package/extensions/lib/git.ts +44 -2
- package/extensions/lib/hook-gate.ts +90 -0
- package/extensions/lib/interrupt.ts +94 -0
- package/extensions/lib/mcp-overrides.ts +61 -0
- package/extensions/lib/mcp-share.ts +25 -0
- package/extensions/lib/mcp-status.ts +34 -0
- package/extensions/lib/memory.ts +41 -6
- package/extensions/lib/model-facts.generated.json +2480 -0
- package/extensions/lib/model-facts.ts +162 -0
- package/extensions/lib/model-policy.ts +145 -189
- package/extensions/lib/model-tier.ts +480 -64
- package/extensions/lib/model-unusable.ts +37 -0
- package/extensions/lib/notifications.ts +320 -1
- package/extensions/lib/one-code-settings.ts +63 -0
- package/extensions/lib/original-command.ts +71 -0
- package/extensions/lib/package-version.ts +31 -0
- package/extensions/lib/paths.ts +39 -4
- package/extensions/lib/permission-gate.ts +192 -0
- package/extensions/lib/persisted-output.ts +18 -0
- package/extensions/lib/pi-ai-estimate.ts +160 -0
- package/extensions/lib/pi-version.ts +1 -1
- package/extensions/lib/plan-mode-channels.ts +11 -0
- package/extensions/lib/plugin-overrides.ts +24 -0
- package/extensions/lib/plugin-root.ts +44 -0
- package/extensions/lib/plugins.ts +233 -54
- package/extensions/lib/prefix-warm-gate.ts +157 -0
- package/extensions/lib/process-tree.ts +56 -0
- package/extensions/lib/reminders.ts +321 -68
- package/extensions/lib/scratchpad.ts +11 -8
- package/extensions/lib/session-lifecycle.ts +28 -0
- package/extensions/lib/settings-channels.ts +14 -0
- package/extensions/lib/shell-tasks.ts +54 -0
- package/extensions/lib/skill-overrides.ts +86 -0
- package/extensions/lib/skill-scan.ts +110 -0
- package/extensions/lib/text-width.ts +267 -0
- package/extensions/lib/tui-render.ts +281 -54
- package/extensions/lib/usage-bus.ts +75 -0
- package/extensions/lib/usage-tracker.ts +67 -0
- package/extensions/lib/worktree-isolation.ts +170 -0
- package/extensions/lsp/client.ts +69 -12
- package/extensions/lsp/format.ts +12 -2
- package/extensions/lsp/index.ts +273 -84
- package/extensions/lsp/install-hints.ts +43 -0
- package/extensions/lsp/keep-alive.ts +19 -0
- package/extensions/lsp/plugin-servers.ts +331 -0
- package/extensions/lsp/watcher.ts +157 -0
- package/extensions/mcp/announce.ts +99 -0
- package/extensions/mcp/client.ts +181 -22
- package/extensions/mcp/config.ts +55 -24
- package/extensions/mcp/index.ts +586 -86
- package/extensions/mcp/oauth/browser.ts +26 -0
- package/extensions/mcp/oauth/callback.ts +104 -0
- package/extensions/mcp/oauth/flow.ts +68 -0
- package/extensions/mcp/oauth/provider.ts +147 -0
- package/extensions/mcp/oauth/store.ts +86 -0
- package/extensions/mcp/panel/keys.ts +34 -0
- package/extensions/mcp/panel/model.ts +62 -0
- package/extensions/mcp/panel/render.ts +141 -0
- package/extensions/mcp/panel/state.ts +108 -0
- package/extensions/mcp/schema.ts +83 -6
- package/extensions/mcp/trust.ts +340 -0
- package/extensions/memory/entries.ts +163 -0
- package/extensions/memory/index.ts +119 -2
- package/extensions/memory/open-external.ts +97 -0
- package/extensions/memory/panel.ts +124 -0
- package/extensions/model-default/index.ts +74 -0
- package/extensions/notebook/index.ts +36 -18
- package/extensions/notebook/notebook.ts +110 -17
- package/extensions/permissions/index.ts +1012 -247
- package/extensions/permissions/matcher.ts +488 -57
- package/extensions/permissions/modes.ts +55 -7
- package/extensions/permissions/project-trust.ts +81 -0
- package/extensions/permissions/protected-paths.ts +16 -3
- package/extensions/permissions/rule-prose.ts +79 -0
- package/extensions/permissions/session-grant.ts +91 -0
- package/extensions/permissions/settings.ts +112 -33
- package/extensions/permissions/subagent-gate.ts +57 -0
- package/extensions/plan-mode/index.ts +143 -33
- package/extensions/plan-mode/reminder.ts +16 -19
- package/extensions/plan-mode/viewer.ts +40 -31
- package/extensions/plugins/counts.ts +68 -0
- package/extensions/plugins/index.ts +496 -32
- package/extensions/plugins/install/install.ts +167 -0
- package/extensions/plugins/install/paths.ts +23 -0
- package/extensions/plugins/install/registry.ts +72 -0
- package/extensions/plugins/marketplace/git.ts +103 -0
- package/extensions/plugins/marketplace/official.ts +36 -0
- package/extensions/plugins/marketplace/parse.ts +94 -0
- package/extensions/plugins/marketplace/registry.ts +60 -0
- package/extensions/plugins/marketplace/sync.ts +146 -0
- package/extensions/plugins/marketplace/types.ts +128 -0
- package/extensions/plugins/panel/keys.ts +52 -0
- package/extensions/plugins/panel/render.ts +315 -0
- package/extensions/plugins/panel/rows.ts +230 -0
- package/extensions/plugins/panel/state.ts +333 -0
- package/extensions/recap/index.ts +215 -0
- package/extensions/recap/prompt.ts +44 -0
- package/extensions/recap/scheduler.ts +87 -0
- package/extensions/search-tools/index.ts +0 -0
- package/extensions/search-tools/tools.ts +7 -5
- package/extensions/skill/index.ts +360 -34
- package/extensions/skill/invoke.ts +185 -0
- package/extensions/skill/listing.ts +21 -0
- package/extensions/skill/panel/keys.ts +41 -0
- package/extensions/skill/panel/render.ts +91 -0
- package/extensions/skill/panel/state.ts +115 -0
- package/extensions/spinner/index.ts +110 -0
- package/extensions/spinner/line.ts +51 -0
- package/extensions/spinner/verbs.ts +201 -0
- package/extensions/subagents/agents.ts +88 -44
- package/extensions/subagents/default-model.ts +62 -32
- package/extensions/subagents/delegation-steer.ts +23 -0
- package/extensions/subagents/hand-back-review.ts +67 -0
- package/extensions/subagents/index.ts +1545 -346
- package/extensions/subagents/live-runs.ts +293 -0
- package/extensions/subagents/model-select.ts +252 -82
- package/extensions/subagents/outcome.ts +90 -0
- package/extensions/subagents/panel-keys.ts +41 -0
- package/extensions/subagents/panel-render.ts +357 -0
- package/extensions/subagents/panel-widget.ts +330 -0
- package/extensions/subagents/pending-claim.ts +45 -0
- package/extensions/subagents/prose.ts +105 -0
- package/extensions/subagents/runner.ts +674 -0
- package/extensions/subagents/runs.ts +68 -1
- package/extensions/subagents/send-to-main-tool.ts +55 -0
- package/extensions/subagents/session-turns.ts +138 -0
- package/extensions/subagents/shell-panel.ts +198 -0
- package/extensions/subagents/usage.ts +16 -4
- package/extensions/subagents/worktree.ts +13 -0
- package/extensions/system-prompt/environment.ts +5 -3
- package/extensions/system-prompt/git-status.ts +93 -0
- package/extensions/system-prompt/index.ts +23 -1
- package/extensions/system-prompt/template.ts +34 -4
- package/extensions/system-prompt/tiers/common.ts +31 -6
- package/extensions/system-prompt/tiers/low.ts +13 -3
- package/extensions/system-prompt/tiers/mid.ts +21 -8
- package/extensions/system-reminder/index.ts +53 -9
- package/extensions/tasks/index.ts +65 -16
- package/extensions/tasks/store.ts +76 -3
- package/extensions/tool-search/announce.ts +42 -0
- package/extensions/tool-search/index.ts +136 -13
- package/extensions/turn-duration/index.ts +60 -0
- package/extensions/turn-duration/line.ts +22 -0
- package/extensions/turn-duration/span.ts +41 -0
- package/extensions/turn-duration/verbs.ts +24 -0
- package/extensions/web/backends.ts +421 -0
- package/extensions/web/index.ts +178 -21
- package/extensions/web-fetch/index.ts +74 -18
- package/extensions/web-fetch/summarize.ts +1 -1
- package/extensions/workflow/agent-session.ts +182 -112
- package/extensions/workflow/globals.ts +129 -106
- package/extensions/workflow/index.ts +343 -28
- package/extensions/workflow/records.ts +118 -0
- package/extensions/workflow/run-manager.ts +80 -31
- package/extensions/workflow/saved-workflows.ts +2 -1
- package/extensions/workflow/script-worker.mjs +110 -0
- package/extensions/workflow/types.ts +74 -8
- package/extensions/workflow/viewer.ts +562 -0
- package/extensions/workflow/vm-runtime.ts +118 -22
- package/extensions/workflow/widget.ts +126 -18
- package/extensions/worktree/guards.ts +240 -0
- package/extensions/worktree/index.ts +30 -5
- package/extensions/worktree/rewrite.ts +32 -16
- package/package.json +20 -10
- package/skills/code-review/SKILL.md +165 -0
- package/skills/fewer-permission-prompts/SKILL.md +61 -0
- package/skills/security-review/SKILL.md +178 -0
- package/skills/simplify/SKILL.md +70 -0
- package/themes/{one-code-light.json → onecode-light.json} +6 -1
- package/themes/{one-code.json → onecode.json} +6 -1
- package/types/app.d.ts +8 -1
- package/types/community-packages.d.ts +45 -2
- package/docs/decisions/auto-mode.md +0 -526
- package/docs/decisions/branding.md +0 -127
- package/docs/decisions/code-review-remediation.md +0 -106
- package/docs/decisions/compaction.md +0 -140
- package/docs/decisions/distribution.md +0 -168
- package/docs/decisions/hooks.md +0 -64
- package/docs/decisions/lsp.md +0 -58
- package/docs/decisions/mcp.md +0 -104
- package/docs/decisions/memory-state.md +0 -170
- package/docs/decisions/model-policy.md +0 -126
- package/docs/decisions/modes.md +0 -178
- package/docs/decisions/skills-plugins.md +0 -56
- package/docs/decisions/subagents-workflows.md +0 -225
- package/docs/decisions/system-prompt.md +0 -98
- package/docs/decisions/tools.md +0 -407
- package/docs/decisions/tui.md +0 -202
- package/docs/decisions.md +0 -148
- package/extensions/subagents/child.ts +0 -414
- package/extensions/subagents/rpc-turns.ts +0 -123
- package/extensions/todo/index.ts +0 -133
- package/extensions/workflow/permission-gate.ts +0 -71
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Install One Code
|
|
2
|
+
|
|
3
|
+
One Code ships as two npm packages from one repository. Choose the one that
|
|
4
|
+
fits how you already work.
|
|
5
|
+
|
|
6
|
+
| You | Install | What you get |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| New to this, or you want the simplest setup | `npm install -g @one-ai/one-code` | The bundled app: its own `onecode` command, a pinned version of the pi coding agent inside it, and its state kept in `~/.onecode`. It coexists with any `pi` you already have. |
|
|
9
|
+
| Already running [pi](https://github.com/earendil-works/pi) | `pi install npm:one-code-extension` | The extensions only. They run on your existing pi. One Code's own state still goes to `~/.onecode`; pi's own files stay under your pi agent directory (`~/.pi/agent`). |
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
- Node.js 22.19 or later. The app refuses to start on older versions,
|
|
14
|
+
because pi crashes at import time there.
|
|
15
|
+
- macOS or Linux. Windows Subsystem for Linux (WSL) works the same way.
|
|
16
|
+
Native Windows is untested and unsupported.
|
|
17
|
+
- `git`. Optional: `rg` (ripgrep) for faster search, the GitHub CLI for the
|
|
18
|
+
pull-request marker in the footer, and a language server for your
|
|
19
|
+
language (see
|
|
20
|
+
[Language-server diagnostics](configuration.md#language-server-diagnostics)).
|
|
21
|
+
|
|
22
|
+
## Install the app with npm
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g @one-ai/one-code
|
|
26
|
+
cd your-project
|
|
27
|
+
onecode
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
On the first run there is no provider yet: the banner shows `model none`.
|
|
31
|
+
Run `/login` inside One Code to connect a provider, or set a provider key
|
|
32
|
+
in your environment before launching. For a free option, see
|
|
33
|
+
[Providers and models](providers-and-models.md).
|
|
34
|
+
|
|
35
|
+
The first run also seeds pi's settings under `~/.onecode/agent/` with the
|
|
36
|
+
`onecode` theme, quiet startup, and full-screen mode. It never overrides a
|
|
37
|
+
value you change later.
|
|
38
|
+
|
|
39
|
+
## Install with Homebrew
|
|
40
|
+
|
|
41
|
+
Homebrew installs Node for you, so this route has no separate Node step:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
brew install isurumaduranga/one-ai/one-code
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The formula is named `one-code`; the command it installs is `onecode`.
|
|
48
|
+
Homebrew refuses npm packages published less than a day ago, so a release
|
|
49
|
+
becomes installable this way about a day after it appears on npm.
|
|
50
|
+
|
|
51
|
+
## Install the extension on your own pi
|
|
52
|
+
|
|
53
|
+
If you already run pi, add One Code as an extension:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pi install npm:one-code-extension
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Use `pi` in place of `onecode` for every command in this guide. The
|
|
60
|
+
extension is tested against pi 0.83 through 0.85 and warns at startup when
|
|
61
|
+
your pi is outside that range. Full-screen mode is opt-in on your own pi;
|
|
62
|
+
see [Full-screen mode and themes](configuration.md#full-screen-mode-and-themes).
|
|
63
|
+
|
|
64
|
+
A few interface refinements are applied only by the bundled app, because
|
|
65
|
+
they patch pi internals the extension API cannot reach: a clean exit that
|
|
66
|
+
erases the screen in regular mode, and suppression of pi's "Operation
|
|
67
|
+
aborted" line when you interrupt a reply. Everything else is identical.
|
|
68
|
+
|
|
69
|
+
## Install from source
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
git clone https://github.com/IsuruMaduranga/one-code
|
|
73
|
+
cd one-code
|
|
74
|
+
npm install
|
|
75
|
+
cd ..
|
|
76
|
+
pi install ./one-code
|
|
77
|
+
pi list
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Run `npm install` before the path install so the dependencies are present.
|
|
81
|
+
`pi list` confirms the package registered.
|
|
82
|
+
|
|
83
|
+
## Check the installation
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
onecode --version # prints the app version and the pi version inside it
|
|
87
|
+
onecode doctor # prints the setup report; exits 1 when no provider is ready
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Inside a session, `/doctor` runs the full checkup. See
|
|
91
|
+
[Check your setup with doctor](doctor.md).
|
|
92
|
+
|
|
93
|
+
## Update
|
|
94
|
+
|
|
95
|
+
The bundled app checks npm once a day when a session starts and shows a
|
|
96
|
+
notice with the matching upgrade command when a newer version exists:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npm install -g @one-ai/one-code # npm installs
|
|
100
|
+
brew upgrade one-code # Homebrew installs
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Set `ONECODE_NO_UPDATE_CHECK=1` to skip the check; `--offline` skips it too.
|
|
104
|
+
On your own pi, update with `pi update --extensions`.
|
|
105
|
+
|
|
106
|
+
Both packages are released together with the same version number.
|
|
107
|
+
|
|
108
|
+
## Uninstall
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm uninstall -g @one-ai/one-code # or: brew uninstall one-code
|
|
112
|
+
rm -rf ~/.onecode # One Code's state, including pi's under the app
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
On your own pi, run `pi remove one-code-extension` (or remove the package
|
|
116
|
+
entry from pi's settings). Removing `~/.onecode` deletes One Code's
|
|
117
|
+
settings, approvals, plan files, and, under the bundled app, pi's sessions
|
|
118
|
+
and credentials. Memory files stay in `~/.claude/projects/`, because they
|
|
119
|
+
are shared with Claude Code.
|
|
120
|
+
|
|
121
|
+
## Next step
|
|
122
|
+
|
|
123
|
+
Connect a provider and choose a model in
|
|
124
|
+
[Providers and models](providers-and-models.md).
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
# Permissions, modes, and auto mode
|
|
2
|
+
|
|
3
|
+
Every tool call the model makes passes through One Code's permission gate
|
|
4
|
+
before it runs. This page explains the permission modes, how to switch
|
|
5
|
+
between them, how to write rules, what the approval prompt offers, and how
|
|
6
|
+
plan mode and auto mode change what needs your approval.
|
|
7
|
+
|
|
8
|
+
For the security guarantees and the known gaps, read
|
|
9
|
+
[A boundary, not a promise](#a-boundary-not-a-promise) at the end of this
|
|
10
|
+
page before you rely on auto mode for unattended work.
|
|
11
|
+
|
|
12
|
+
## How a decision is made
|
|
13
|
+
|
|
14
|
+
For each tool call, the gate checks the following in order:
|
|
15
|
+
|
|
16
|
+
1. **Protected paths.** A write to a protected file or directory (see
|
|
17
|
+
[Protected paths](#protected-paths)) is never approved automatically. In
|
|
18
|
+
auto mode it goes to the classifier; in other modes it prompts you.
|
|
19
|
+
Allow rules do not cover protected paths.
|
|
20
|
+
2. **`deny` rules.** A matching `deny` rule blocks the call. `deny` always
|
|
21
|
+
wins.
|
|
22
|
+
3. **`ask` rules.** A matching `ask` rule prompts you, even in a mode that
|
|
23
|
+
would otherwise approve the call.
|
|
24
|
+
4. **`allow` rules.** A matching `allow` rule approves the call without a
|
|
25
|
+
prompt.
|
|
26
|
+
5. **The mode's default.** Anything no rule covers is decided by the current
|
|
27
|
+
permission mode.
|
|
28
|
+
|
|
29
|
+
A handful of tools are always allowed because other tools sit behind them:
|
|
30
|
+
`tool_search`, `skill`, `Agent`, `SendMessage`, `list_agents`, `workflow`,
|
|
31
|
+
`ask_user_question`, `lsp_diagnostics`, `list_mcp_resources`, the task-list
|
|
32
|
+
tools, `schedule_wakeup`, and the plan-mode tools. The tool calls these
|
|
33
|
+
tools make in turn (a subagent's own edits, for example) are still gated.
|
|
34
|
+
|
|
35
|
+
## Permission rules
|
|
36
|
+
|
|
37
|
+
One Code reads `allow`, `deny`, and `ask` rules from the same files Claude
|
|
38
|
+
Code uses, plus its own:
|
|
39
|
+
|
|
40
|
+
| File | Scope |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `~/.claude/settings.json` | Your user-wide Claude Code rules. Read only. |
|
|
43
|
+
| `~/.onecode/settings.json` | Your user-wide One Code rules. `/allow … global` writes here. |
|
|
44
|
+
| `.claude/settings.json` and `.claude/settings.local.json` | The project's rules. Read only. Allow rules from these files need your approval once; see [Trusting a project](#trusting-a-project). |
|
|
45
|
+
| `~/.onecode/projects/<slug>/settings.json` | One Code's per-repository rules. `/allow` writes here. |
|
|
46
|
+
| Managed settings | Organization-wide rules, when present. Read only. |
|
|
47
|
+
|
|
48
|
+
Rules match tools by name and, optionally, by argument. Claude Code's
|
|
49
|
+
PascalCase tool names (`Bash`, `Read`, `Edit`, `WebFetch`, `Task`, and the
|
|
50
|
+
rest) work in these rules, so a setup you wrote for Claude Code applies as
|
|
51
|
+
it is. For the mapping from Claude Code names to One Code's tool names, see
|
|
52
|
+
[Tools](tools.md#claude-code-tool-names).
|
|
53
|
+
|
|
54
|
+
A rule naming an MCP server, such as `mcp__github`, covers every tool that
|
|
55
|
+
server provides. A rule naming a single MCP tool, such as
|
|
56
|
+
`mcp__github__create_issue`, covers only that tool.
|
|
57
|
+
|
|
58
|
+
### Bash rule patterns
|
|
59
|
+
|
|
60
|
+
Bash rules follow Claude Code's matching rules:
|
|
61
|
+
|
|
62
|
+
- `Bash(npm test)` matches that exact command line.
|
|
63
|
+
- `Bash(npm test:*)` matches `npm test` and any command that starts with
|
|
64
|
+
`npm test` followed by a space. It does not match `npm tests` or
|
|
65
|
+
`npm test:unit`; write `Bash(npm test:unit:*)` for the latter.
|
|
66
|
+
- `Bash(git * --dry-run)` uses `*` as a wildcard anywhere in the line. Write
|
|
67
|
+
`\*` for a literal asterisk and `\\` for a literal backslash.
|
|
68
|
+
|
|
69
|
+
`deny` and `ask` rules are matched against every form of a command line, so
|
|
70
|
+
they are hard to sidestep. They apply when they match the raw line, any
|
|
71
|
+
subcommand of a compound line (`&&`, `||`, `;`, `|`, `&`, or a newline), or
|
|
72
|
+
the payload of a wrapper. Wrappers such as `env`, `command`, `nice`,
|
|
73
|
+
`timeout`, and `xargs` are peeled, `sh -c '…'` and the other shells are
|
|
74
|
+
expanded, and the command word is reduced to its lowercased basename, so
|
|
75
|
+
`/bin/rm`, `\rm`, and `RM` all match a rule written for `rm`.
|
|
76
|
+
|
|
77
|
+
`allow` rules are matched against the literal spelling only, and a compound
|
|
78
|
+
command line is allowed only when an `allow` rule covers every one of its
|
|
79
|
+
subcommands, or when an exact rule matches the whole line. A line that
|
|
80
|
+
contains command substitution (`$(…)` or backticks), `eval`, `exec`, a pipe
|
|
81
|
+
into an interpreter, or a base64 decode is never covered by a prefix or
|
|
82
|
+
wildcard `allow` rule.
|
|
83
|
+
|
|
84
|
+
### Add a rule during a session
|
|
85
|
+
|
|
86
|
+
To add an allow rule for the current repository, run:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
/allow Bash(npm test:*)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Add `global` at the end to save it for every repository instead:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
/allow Bash(npm test:*) global
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
To review the current mode and every loaded rule, including which project
|
|
99
|
+
rules are trusted and which rules could not be parsed, run `/permissions`.
|
|
100
|
+
|
|
101
|
+
Rules One Code adds are saved under `~/.onecode`, never under `~/.claude`.
|
|
102
|
+
|
|
103
|
+
## Permission modes
|
|
104
|
+
|
|
105
|
+
A mode sets the default answer for actions no rule covers. **Auto is the
|
|
106
|
+
default**, matching Claude Code: a classifier approves routine actions and
|
|
107
|
+
stops risky ones, so you are not prompted for every step.
|
|
108
|
+
|
|
109
|
+
| Mode | Badge | What it does |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| Manual | `⏸ manual mode on` | Prompts for anything not already allowed. The `--permission-mode` value is `default`. |
|
|
112
|
+
| Accept edits | `⏵⏵ accept edits on` | File edits inside the working directory run without a prompt. Everything else still prompts. The flag value is `acceptEdits`. |
|
|
113
|
+
| Plan | `⏸ plan mode on` | Read-only investigation plus one plan file. See [Plan mode](#plan-mode). The flag value is `plan`. |
|
|
114
|
+
| Auto | `⏵⏵ auto mode on` | A classifier screens each action. See [Auto mode](#auto-mode). The flag value is `auto`. |
|
|
115
|
+
| Bypass permissions | `⏵⏵ bypass permissions on` | Runs everything without prompts, including writes to protected paths. The flag value is `bypassPermissions`; `--dangerously-skip-permissions` also selects it. |
|
|
116
|
+
| Don't ask | `⏵⏵ don't ask on` | Never prompts. Anything that would have prompted is denied instead. The flag value is `dontAsk`. |
|
|
117
|
+
|
|
118
|
+
The current badge appears in the banner and is announced when the mode
|
|
119
|
+
changes.
|
|
120
|
+
|
|
121
|
+
### Cycle modes with ctrl+q
|
|
122
|
+
|
|
123
|
+
Press **ctrl+q** to cycle through manual, accept edits, plan, and auto.
|
|
124
|
+
Two modes join the cycle only under conditions:
|
|
125
|
+
|
|
126
|
+
- **Auto** appears only when a model that can run the classifier is
|
|
127
|
+
available. With no provider connected, the cycle skips it.
|
|
128
|
+
- **Bypass permissions** appears only when the session started in it.
|
|
129
|
+
|
|
130
|
+
**Don't ask** is never in the cycle; reach it with the `--permission-mode`
|
|
131
|
+
flag or a settings file.
|
|
132
|
+
|
|
133
|
+
Claude Code cycles modes with shift+tab. One Code cannot use that key
|
|
134
|
+
because pi reserves it for the reasoning-effort dial. On Windows and WSL,
|
|
135
|
+
pi's own default keybindings also use ctrl+q to queue a follow-up message.
|
|
136
|
+
If the two conflict there, change pi's binding in its keybindings file.
|
|
137
|
+
|
|
138
|
+
### Choose the starting mode
|
|
139
|
+
|
|
140
|
+
To start one session in a different mode, pass `--permission-mode`:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
onecode --permission-mode plan
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For a reusable shortcut, add an alias to your shell configuration:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
alias onecode-manual='onecode --permission-mode default'
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
For a persistent default, One Code reads `permissions.defaultMode` from your
|
|
153
|
+
Claude Code settings files. Merge this into the existing object:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"permissions": {
|
|
158
|
+
"defaultMode": "default"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The scopes are not equal:
|
|
164
|
+
|
|
165
|
+
- **User scope** (`~/.claude/settings.json`) and **managed settings** can
|
|
166
|
+
set any mode.
|
|
167
|
+
- **Project scope** (`.claude/settings.json` and `.claude/settings.local.json`)
|
|
168
|
+
can set `default`, `acceptEdits`, `plan`, or `dontAsk`. It cannot set
|
|
169
|
+
`auto` or `bypassPermissions`; a checked-in file must not be able to turn
|
|
170
|
+
off approvals for whoever clones it.
|
|
171
|
+
- A `defaultMode` in `~/.onecode/settings.json` has no effect.
|
|
172
|
+
|
|
173
|
+
The `--permission-mode` flag takes precedence over every configured default.
|
|
174
|
+
|
|
175
|
+
To make bypass mode impossible from any source, set
|
|
176
|
+
`permissions.disableBypassPermissionsMode` to `"disable"` in any scope. One
|
|
177
|
+
Code then refuses bypass whether it was requested by flag or by settings.
|
|
178
|
+
|
|
179
|
+
The mode you choose during a session persists across `/clear`. A session
|
|
180
|
+
you resume later starts in the configured default, not in the mode it was
|
|
181
|
+
in when it ended.
|
|
182
|
+
|
|
183
|
+
## The approval prompt
|
|
184
|
+
|
|
185
|
+
When an action needs your decision, a prompt shows the tool, its arguments,
|
|
186
|
+
and these choices:
|
|
187
|
+
|
|
188
|
+
- **Yes.** Run it this once.
|
|
189
|
+
- **Yes, and don't ask again … this session.** Approve this action and
|
|
190
|
+
similar ones until the session ends. The scope of "similar" depends on the
|
|
191
|
+
action:
|
|
192
|
+
- A command: only that exact command line, never a pattern.
|
|
193
|
+
- A file inside the working directory: that tool anywhere in the working
|
|
194
|
+
directory.
|
|
195
|
+
- A file outside the working directory: that tool within the file's
|
|
196
|
+
directory only.
|
|
197
|
+
- A URL: that host.
|
|
198
|
+
- **No, tell the agent what to do differently.** Deny it, with an optional
|
|
199
|
+
note that is passed to the model as the reason.
|
|
200
|
+
|
|
201
|
+
The "don't ask again" option is not offered for protected paths, for writes
|
|
202
|
+
that the auto-mode safety floor caught, or in auto mode. Session grants never
|
|
203
|
+
apply in auto mode and are cleared when the session ends.
|
|
204
|
+
|
|
205
|
+
In non-interactive runs (`-p` and `--mode json`) nothing can prompt, so an
|
|
206
|
+
action that would have prompted is denied and the model is told why.
|
|
207
|
+
|
|
208
|
+
## The working directory boundary
|
|
209
|
+
|
|
210
|
+
Reads and edits are confined to the working directory by default:
|
|
211
|
+
|
|
212
|
+
- Reading a file inside the working directory is allowed in every mode.
|
|
213
|
+
Reading outside it prompts in manual mode, goes to the classifier in auto
|
|
214
|
+
mode, and is denied in don't-ask mode.
|
|
215
|
+
- Accept-edits mode approves edits only inside the working directory.
|
|
216
|
+
- The harness's own session directories count as inside: the auto-memory
|
|
217
|
+
folder, the session scratchpad, persisted tool output, and the plan file.
|
|
218
|
+
|
|
219
|
+
Paths are compared after resolving symlinks, so a symlink inside the project
|
|
220
|
+
that points outside it counts as outside.
|
|
221
|
+
|
|
222
|
+
In auto mode, a shell command that reads outside the working directory, a
|
|
223
|
+
bare `env`, or a `printenv` is never treated as safe by the deterministic
|
|
224
|
+
check and always goes to the classifier.
|
|
225
|
+
|
|
226
|
+
## Protected paths
|
|
227
|
+
|
|
228
|
+
Writes to these paths are never approved automatically in any mode other
|
|
229
|
+
than bypass, and allow rules do not cover them.
|
|
230
|
+
|
|
231
|
+
Protected directories, including everything inside them:
|
|
232
|
+
|
|
233
|
+
`.git`, `.config/git`, `.vscode`, `.idea`, `.husky`, `.cargo`,
|
|
234
|
+
`.devcontainer`, `.yarn`, `.mvn`, `.claude`, `.onecode`,
|
|
235
|
+
`Library/LaunchAgents`, `.config/fish`, `.local/bin`.
|
|
236
|
+
|
|
237
|
+
`.claude/worktrees` and `.onecode/plans` are ordinary working space and are
|
|
238
|
+
exempt.
|
|
239
|
+
|
|
240
|
+
Protected files:
|
|
241
|
+
|
|
242
|
+
Shell startup files (`.bashrc`, `.bash_profile`, `.bash_login`,
|
|
243
|
+
`.bash_aliases`, `.bash_logout`, `.zshrc`, `.zprofile`, `.zshenv`, `.zlogin`,
|
|
244
|
+
`.zlogout`, `.profile`, `.envrc`), git files (`.gitconfig`, `.gitmodules`),
|
|
245
|
+
package-manager files (`.npmrc`, `.yarnrc`, `.yarnrc.yml`, `.pnp.cjs`,
|
|
246
|
+
`.pnp.loader.mjs`, `.pnpmfile.cjs`, `bunfig.toml`, `.bunfig.toml`), build
|
|
247
|
+
files (`.bazelrc`, `.bazelversion`, `.bazeliskrc`, `gradle-wrapper.properties`,
|
|
248
|
+
`maven-wrapper.properties`), hook runners (`.pre-commit-config.yaml`,
|
|
249
|
+
`lefthook.yml`, `lefthook.yaml`, `.lefthook.yml`, `.lefthook.yaml`), and
|
|
250
|
+
tool configuration (`.devcontainer.json`, `.ripgreprc`, `pyrightconfig.json`,
|
|
251
|
+
`.mcp.json`, `.claude.json`, `managed-settings.json`).
|
|
252
|
+
|
|
253
|
+
pi's agent directory, Claude Code's configuration directory, and One Code's
|
|
254
|
+
state directory are protected wherever they are, including when relocated
|
|
255
|
+
by an environment variable.
|
|
256
|
+
|
|
257
|
+
## Trusting a project
|
|
258
|
+
|
|
259
|
+
Some project-provided configuration can run code or widen permissions, so
|
|
260
|
+
One Code asks you once per project before using it. Each approval is
|
|
261
|
+
remembered under `~/.onecode` together with a hash of the configuration, so
|
|
262
|
+
a change to the configuration asks again. Declining is remembered for the
|
|
263
|
+
current session only.
|
|
264
|
+
|
|
265
|
+
| What | When you are asked | Stored in |
|
|
266
|
+
|---|---|---|
|
|
267
|
+
| Hooks in `.claude/settings.json` or `.claude/settings.local.json` | At startup: "Run this project's hooks?", listing each command. | `~/.onecode/hooks/project-approvals.json` |
|
|
268
|
+
| MCP servers in `.mcp.json` | At startup, for each new server. See [MCP servers](skills-plugins-and-mcp.md#mcp-servers). | `~/.onecode/mcp/project-approvals.json` |
|
|
269
|
+
| `permissions.allow` rules in the project's settings files | The first time such a rule would decide a call: "Trust this repository's allow rules?" | `~/.onecode/permissions/project-allow-approvals.json` |
|
|
270
|
+
|
|
271
|
+
`deny` and `ask` rules from a project never prompt; they only tighten the
|
|
272
|
+
gate. Hooks and servers from your user settings, managed settings, or an
|
|
273
|
+
installed plugin never prompt either, because installing them was the
|
|
274
|
+
consent.
|
|
275
|
+
|
|
276
|
+
## Plan mode
|
|
277
|
+
|
|
278
|
+
Plan mode lets the model investigate and write a plan without changing your
|
|
279
|
+
code. Only read-only tools and edits to one plan file are available.
|
|
280
|
+
|
|
281
|
+
- The plan file lives at `~/.onecode/plans/<name>.md`, where the name is a
|
|
282
|
+
random three-word slug. The same file is reused when you resume the
|
|
283
|
+
session or switch branches in `/tree`.
|
|
284
|
+
- The model is reminded to explore with the `explore` agent, design with the
|
|
285
|
+
`plan` agent, and then write the plan.
|
|
286
|
+
- You can read and edit the plan file yourself while the model works.
|
|
287
|
+
|
|
288
|
+
Enter plan mode by cycling to it with **ctrl+q**, by starting with
|
|
289
|
+
`--permission-mode plan`, or by asking the model to plan first (it can call
|
|
290
|
+
`enter_plan_mode` itself).
|
|
291
|
+
|
|
292
|
+
When the model finishes, it calls `exit_plan_mode` and an approval dialog
|
|
293
|
+
shows the plan. Nothing runs until you choose. The choices are:
|
|
294
|
+
|
|
295
|
+
1. **Approve and return to the mode you were in** before planning, when that
|
|
296
|
+
mode is available.
|
|
297
|
+
2. **Approve into auto mode**, when a classifier model is available.
|
|
298
|
+
3. **Approve into accept-edits mode.**
|
|
299
|
+
4. **Approve into manual mode.**
|
|
300
|
+
5. **Keep planning.** No mode change; the model refines the plan file.
|
|
301
|
+
|
|
302
|
+
The initial highlight is the option that restores your previous mode, or
|
|
303
|
+
manual mode when that is not offered. It never lands on a more permissive
|
|
304
|
+
option by default. Press the number of a choice to pick it directly, or
|
|
305
|
+
**Esc** to keep planning.
|
|
306
|
+
|
|
307
|
+
In a non-interactive run there is no one to approve, so `exit_plan_mode`
|
|
308
|
+
refuses and the session stays in plan mode with the plan on disk.
|
|
309
|
+
|
|
310
|
+
## Auto mode
|
|
311
|
+
|
|
312
|
+
Auto mode removes routine approval prompts without removing the boundary.
|
|
313
|
+
It combines a deterministic first pass with Claude Code's own two-stage
|
|
314
|
+
classifier.
|
|
315
|
+
|
|
316
|
+
### What is approved without a classifier call
|
|
317
|
+
|
|
318
|
+
- Actions a deterministic analysis proves safe. Read-only shell commands
|
|
319
|
+
inside the working directory are the common case. This analysis can only
|
|
320
|
+
ever conclude "safe"; anything it cannot parse or recognize goes to the
|
|
321
|
+
classifier rather than through.
|
|
322
|
+
- Edits and writes to files inside the project that are not credential
|
|
323
|
+
files, not protected paths, and not files that run code on their own
|
|
324
|
+
(build wrappers, CI workflows, editor auto-run configuration).
|
|
325
|
+
- Deleting or resetting files inside the project **when git can recover
|
|
326
|
+
them**. A tracked, committed file can be restored, so removing it is
|
|
327
|
+
approved. An untracked or modified file cannot, so removing it goes to
|
|
328
|
+
the classifier. Claude Code trusts the whole project directory here; One
|
|
329
|
+
Code checks recoverability first.
|
|
330
|
+
|
|
331
|
+
### What goes to the classifier
|
|
332
|
+
|
|
333
|
+
Everything else: destructive commands git cannot undo, anything that
|
|
334
|
+
reaches outside the project, network-affecting commands, writes to
|
|
335
|
+
protected paths, and reads outside the working directory.
|
|
336
|
+
|
|
337
|
+
The classifier is Claude Code's two-stage ruleset, embedded verbatim:
|
|
338
|
+
|
|
339
|
+
1. **Stage 1** grades harm only, on a 0 to 100 scale. Below 50 the action
|
|
340
|
+
is allowed and nothing more runs.
|
|
341
|
+
2. **Stage 2** runs when stage 1 scores 50 or above. It weighs the user's
|
|
342
|
+
stated intent and the allow list, and either approves or blocks with a
|
|
343
|
+
named rule.
|
|
344
|
+
|
|
345
|
+
Verdicts are checked before they are acted on. A block must cite a real
|
|
346
|
+
rule from the ruleset. An approval based on intent must quote your own
|
|
347
|
+
words from the conversation. A classifier that cannot be reached, times
|
|
348
|
+
out, or returns something unparseable blocks the action; a gate that cannot
|
|
349
|
+
consult its classifier approves nothing.
|
|
350
|
+
|
|
351
|
+
A blocked action is reported to the model with the reason so it can choose
|
|
352
|
+
a safer route. You are not prompted per action while auto mode runs. After
|
|
353
|
+
repeated blocks in a row, auto mode pauses and the next action prompts you;
|
|
354
|
+
approving it resumes auto mode.
|
|
355
|
+
|
|
356
|
+
Allow rules that are broad enough to pre-approve arbitrary execution, such
|
|
357
|
+
as `Bash(*)`, a wildcarded interpreter, or a rule that allows delegation to
|
|
358
|
+
subagents, are suspended in auto mode so they cannot bypass the classifier.
|
|
359
|
+
Session grants from the approval prompt do not apply in auto mode either.
|
|
360
|
+
|
|
361
|
+
### The classifier model
|
|
362
|
+
|
|
363
|
+
The classifier runs on a model from the same provider as your session,
|
|
364
|
+
chosen automatically as the cheapest model that is at least as capable as
|
|
365
|
+
the floor: a Sonnet-class model when your session runs a Sonnet-class or
|
|
366
|
+
stronger model, a Haiku-class model otherwise. A weak classifier is a
|
|
367
|
+
measurably weaker boundary; in testing, a Haiku-class classifier scored an
|
|
368
|
+
explicitly requested recursive delete far below the block threshold that a
|
|
369
|
+
Sonnet-class classifier applied to the same command.
|
|
370
|
+
|
|
371
|
+
To choose the classifier yourself, run `/auto-mode model <provider/model-id>`.
|
|
372
|
+
`/auto-mode model clear` returns to automatic selection. The choice is saved
|
|
373
|
+
to `~/.onecode/settings.json`. When auto mode is active, the banner shows
|
|
374
|
+
the classifier in use.
|
|
375
|
+
|
|
376
|
+
### The safety floor
|
|
377
|
+
|
|
378
|
+
A deterministic floor protects the gate's own configuration regardless of
|
|
379
|
+
what the classifier or the model decides. A write to any of these files
|
|
380
|
+
never reaches the classifier; it prompts you in an interactive session and
|
|
381
|
+
is blocked in a non-interactive one:
|
|
382
|
+
|
|
383
|
+
- `.claude/settings.json` and `.claude/settings.local.json` anywhere
|
|
384
|
+
- `~/.onecode/settings.json` and any `~/.onecode/projects/<slug>/settings.json`
|
|
385
|
+
- `~/.claude.json`
|
|
386
|
+
- Managed settings files
|
|
387
|
+
|
|
388
|
+
### Configure auto mode
|
|
389
|
+
|
|
390
|
+
Run `/auto-mode` (or `/auto-mode config`) to see the effective
|
|
391
|
+
configuration: the files it was read from, the environment description,
|
|
392
|
+
any extra rules, and which classifier model is in use.
|
|
393
|
+
|
|
394
|
+
Run `/auto-mode setup` to have a model draft a configuration for your
|
|
395
|
+
environment. It asks how you use One Code here, offers to scan recent shell
|
|
396
|
+
history for evidence, proposes an environment description and extra rules,
|
|
397
|
+
and saves them to `~/.onecode/settings.json` only when you approve. It also
|
|
398
|
+
audits your allow rules and offers to remove any that are broad enough to
|
|
399
|
+
bypass the classifier.
|
|
400
|
+
|
|
401
|
+
The configuration keys, under `autoMode`, follow Claude Code's own schema:
|
|
402
|
+
|
|
403
|
+
| Key | Type | Effect |
|
|
404
|
+
|---|---|---|
|
|
405
|
+
| `environment` | string array | Describes your environment to the classifier, replacing Claude Code's default description. Include `"$defaults"` to keep the defaults and add to them. |
|
|
406
|
+
| `hard_deny` | string array | Extra rules that always block. Appended to Claude Code's built-in list; the built-ins cannot be removed. |
|
|
407
|
+
| `soft_deny` | string array | Extra rules that block unless you explicitly asked for the action. |
|
|
408
|
+
| `allow` | string array | Extra rules that approve. |
|
|
409
|
+
| `classifyAllShell` | boolean | Send every shell command to the classifier, even ones a narrow allow rule covers. |
|
|
410
|
+
| `classifierModel` | string | The classifier model, as `provider/model-id`. |
|
|
411
|
+
| `logDecisions` | boolean | Append every gate decision to `auto-mode-decisions.jsonl` next to the session files. |
|
|
412
|
+
|
|
413
|
+
One Code reads `autoMode` from `~/.claude/settings.json`,
|
|
414
|
+
`~/.onecode/settings.json`, and managed settings. It never reads `autoMode`
|
|
415
|
+
from a project's `.claude/settings.json` or `.claude/settings.local.json`,
|
|
416
|
+
because a checked-in file must not be able to loosen the classifier for
|
|
417
|
+
whoever clones it. `classifierModel` is read only from `~/.onecode` and
|
|
418
|
+
managed settings.
|
|
419
|
+
|
|
420
|
+
To see the classifier's verdicts while you work, set `CC_AUTO_MODE_DEBUG=1`
|
|
421
|
+
before launching; each decision is printed to stderr with its stage,
|
|
422
|
+
severity, and rule.
|
|
423
|
+
|
|
424
|
+
## A boundary, not a promise
|
|
425
|
+
|
|
426
|
+
One Code's security model is the permission gate plus auto mode, not an
|
|
427
|
+
assumption that the model behaves. Read these facts before you leave a
|
|
428
|
+
session unattended:
|
|
429
|
+
|
|
430
|
+
- **There is no operating-system sandbox.** The gate decides whether a
|
|
431
|
+
command runs; nothing constrains what an approved command can touch. For
|
|
432
|
+
an OS-level wall, run One Code inside a container. The gate and the
|
|
433
|
+
container work together.
|
|
434
|
+
- **Bypass mode bypasses everything**, including protected paths. Claude
|
|
435
|
+
Code keeps its protected-path checks active even under
|
|
436
|
+
`--dangerously-skip-permissions`; One Code does not.
|
|
437
|
+
- **Auto mode is the default without a first-run consent step**, and
|
|
438
|
+
without the OS sandbox Claude Code pairs its own auto default with.
|
|
439
|
+
- **A weak classifier is a weaker boundary.** Automatic selection applies a
|
|
440
|
+
floor, but a provider whose catalog has nothing stronger is screened by
|
|
441
|
+
what it has. One tested model family (GLM-5.3 and GLM-5.3 Flash) approved a
|
|
442
|
+
request to back up the project to an unnamed outside location, which the
|
|
443
|
+
ruleset says to block.
|
|
444
|
+
- **A known, accepted gap:** a write or edit tool can reach a file that only
|
|
445
|
+
a `Bash` deny rule protects, because in-project writes take the
|
|
446
|
+
deterministic fast path and are never classified. Write a `deny` rule for
|
|
447
|
+
the write tools too if a path must stay untouched.
|
|
448
|
+
- The license carries an autonomous-execution notice: the permission rules,
|
|
449
|
+
classifier, and safety checks are best-effort measures, not guarantees.
|
|
450
|
+
Keep backups and version control of anything you care about.
|