opencode v2: the v2 unit and the v2 oc launcher skip every CLAUDE.md in prompts

Since 2.3.1 OpenCode 2 reads CLAUDE.md of every directory without AGENTS.md, and
~/.claude/CLAUDE.md as the global fallback, into every prompt (source v2.3.2:
packages/cli/src/server-process.ts reads OPENCODE_DISABLE_CLAUDE_CODE_PROMPT at server
start for instructions.claude; documented in docs/instructions and migrate-v1). Measured
on the pinned 2.3.2 in a sandbox (/var/tmp/ocv2-bac-e56, fake server, canary key): with
the project's CLAUDE.md and the HOME one in place, both markers land in the system
message of every request, for run and for serve; with
OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1 both are gone and /api/info answers 200 JSON. On a
box ~/.claude/CLAUDE.md is the owner's private file, which must not leave in every Agent
tab prompt.

So the v2 render of opencode-web (the CAP_LINE block of install-agent.sh, which the 1.x
render does not share) now carries Environment=OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1, and
the v2 oc launcher exports it with a :-1 default (0 is not truthy for opencode, so the
user can bring the files back by hand). The 1.x unit and launcher are byte-identical to
before. Tests red on the old code: the v2 unit carries the line, the v1 unit does not;
the v2 launcher exports it to the child and yields to an explicit 0, the v1 one does
not.

Generated by Mistral Vibe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hasan Basbunar committed 2026-11-20 07:37:31 +01:00
1 parent fcff9fa8e7
commit 65f3b962dc
5 files changed
+80

No files matched your search

+1
View File
@@ -134,6 +134,7 @@ What the 2.x server is, measured on 2.3.0 on this box (the binary, its answers a
- the generated 2.x config adds what the 2.x defaults would otherwise leave open: `policies` denying `provider.use` on the `opencode` provider (without it its free cloud models answer on `/api/model`, and an agent with no provider named goes there), `share: "disabled"`, `websearch: false`, `update: "disable"`, and the `permissions` array (this repo's exfiltration denies, last-match-wins, kept under `--auto`, measured 2026-11-14). Those v2 keys are written only under the v2 choice: 1.19.5 will not start with a `permissions` key in its config.
- the approvals the unit injects ride `OPENCODE_CONFIG_CONTENT`, which the server merges last (it is the document without a path in `/api/config`); the Agent panel reads the served documents, with the server's own matcher (`oc-permissions.py`, read in 2.3.0's bundle: `*` any run, `?` exactly one character, brackets and dot literal, whole-text match), and says in its guard line whether the exfiltration denies still deny.
- 2.x reads neither `OPENCODE_PERMISSION` nor `OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX` (dead names in the unit would lie): the output cap is the model's `limit.output`, which the table writes as 32,000, measured on the build's own requests.
- since 2.3.1, 2.x reads `CLAUDE.md` of every directory without an `AGENTS.md`, and `~/.claude/CLAUDE.md` as the global fallback, into every prompt (measured on 2.3.2 in a sandbox: both files land in the system message of each request). On a box that is the owner's private file leaving in every Agent tab prompt, so the 2.x unit and the 2.x `oc` launcher both set `OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1`, the documented switch read at server start (`packages/cli/src/server-process.ts` of 2.3.2; `0` is not truthy there, so it can be brought back by hand). The 1.x unit and launcher are unchanged.
- the first boot migrates 1.x's session store (`GET /api/experimental/migration/v1` follows it); going back to 1.x after a 2.x session is possible but the newer sessions are then unreadable by the older server, which is why the choice is yours.
## Opting out