Summary
OpenCode runs outside Claude Code's own tool permission system. A project-level .claude/settings.json deny rule that blocks Claude from reading or editing a file may not stop /opencode:rescue from asking OpenCode to inspect or modify that same file.
This is a security-model gap rather than a transport bug.
Local evidence
/opencode:rescue forwards user text to opencode-companion.mjs task, which sends a prompt to the OpenCode HTTP server. OpenCode then uses its own agent/tool permissions, not Claude Code's Read(...), Edit(...), or deny-list enforcement.
Read/write task defaults are also broad:
handleTask() defaults isWrite to true.
buildTaskPrompt() tells OpenCode: You have full read/write access. Make the necessary code changes.
Expected behavior
The plugin should either respect project-level Claude Code deny rules or document clearly that OpenCode has an independent permission boundary.
Suggested fix
At minimum:
- Document the permission boundary in README and
/opencode:setup output.
- Warn when
.claude/settings.json contains deny rules and the user starts a write-capable rescue task.
Potential stronger fix:
- Parse applicable deny rules from
.claude/settings.json.
- Inject explicit forbidden paths into the task prompt.
- For OpenCode tool configuration, disable or constrain tools when the requested task overlaps denied paths, if OpenCode exposes a suitable control surface.
Upstream reference
Derived from openai/codex-plugin-cc#75.
Summary
OpenCode runs outside Claude Code's own tool permission system. A project-level
.claude/settings.jsondeny rule that blocks Claude from reading or editing a file may not stop/opencode:rescuefrom asking OpenCode to inspect or modify that same file.This is a security-model gap rather than a transport bug.
Local evidence
/opencode:rescueforwards user text toopencode-companion.mjs task, which sends a prompt to the OpenCode HTTP server. OpenCode then uses its own agent/tool permissions, not Claude Code'sRead(...),Edit(...), or deny-list enforcement.Read/write task defaults are also broad:
handleTask()defaultsisWriteto true.buildTaskPrompt()tells OpenCode:You have full read/write access. Make the necessary code changes.Expected behavior
The plugin should either respect project-level Claude Code deny rules or document clearly that OpenCode has an independent permission boundary.
Suggested fix
At minimum:
/opencode:setupoutput..claude/settings.jsoncontains deny rules and the user starts a write-capable rescue task.Potential stronger fix:
.claude/settings.json.Upstream reference
Derived from openai/codex-plugin-cc#75.