Skip to content

feat: configurable permission_mode for Claude and opencode#181

Merged
mensfeld merged 1 commit intomasterfrom
feat/configurable-permission-mode
Mar 2, 2026
Merged

feat: configurable permission_mode for Claude and opencode#181
mensfeld merged 1 commit intomasterfrom
feat/configurable-permission-mode

Conversation

@mensfeld
Copy link
Owner

@mensfeld mensfeld commented Mar 2, 2026

Summary

Closes #165

  • Adds permission_mode option under [tool] config section with values "bypass" (default) and "interactive" (human-in-the-loop)
  • When "interactive": Claude omits --permission-mode bypassPermissions flag and bypass settings from settings.json; opencode returns empty sandbox settings
  • Effort level settings are always injected regardless of permission mode
  • Default behavior is unchanged for backward compatibility

Changes

  • internal/config/config.goPermissionMode field on ToolConfig + merge logic
  • internal/tool/tool.goToolWithPermissionMode interface, ClaudeTool.SetPermissionMode(), conditional bypass in BuildCommand() and GetSandboxSettings()
  • internal/tool/opencode.goSetPermissionMode(), conditional bypass in GetSandboxSettings()
  • internal/cli/shell.go — Wire config to tool via ToolWithPermissionMode interface
  • Tests for all three packages (10 new tests)
  • CHANGELOG.md — Feature entry

Test plan

  • go build ./... compiles
  • go vet ./... passes
  • golangci-lint run passes (no new issues)
  • go test ./internal/tool/... — 10 new tests pass
  • go test ./internal/config/... — 1 new table-driven test (4 cases) passes
  • All existing tests unchanged and still passing

Allow users to opt into interactive (human-in-the-loop) permission mode
instead of always bypassing permissions inside containers. Configured via
`permission_mode = "interactive"` under `[tool]` in .coi.toml.

When set to "interactive":
- Claude: omits --permission-mode bypassPermissions flag and bypass
  settings from settings.json (effort level settings still injected)
- opencode: returns empty sandbox settings (no permission bypass)

Default behavior ("bypass" or empty) is unchanged for backward compat.
@mensfeld mensfeld merged commit 5d15ee4 into master Mar 2, 2026
22 of 24 checks passed
@mensfeld mensfeld deleted the feat/configurable-permission-mode branch March 2, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to run Claude Code without bypassPermissions

1 participant