Expand description
Permission compatibility — partial port of grok-build
xai-grok-workspace/src/permission/ (Apache-2.0).
Two pieces are ported at MVP depth:
-
Bash command splitter — a lightweight, regex-based variant of grok’s
bash_command_splitting.rs(which uses tree-sitter-bash). Detects&&,||,;,|boundaries and splits into individual commands. -
.claude/settings.jsonimporter — translates Claude’spermissions.allow/deny/askarrays into oxicodeAccessGaterule decisions viaClaudeRuleSet.
§Non-goals
- grok’s
auto_mode.rs(100 KB learning-based auto-approve) is intentionally NOT ported — it requires training data we don’t have. - grok’s
manager.rs/resolution.rs(255 KB) are layered on workspace hooks that oxicode doesn’t share.
Structs§
- Claude
Rule Set - Adapter that wires an
ImportResultinto anAccessGate-like check. - Claude
Settings - Subset of
.claude/settings.jsonwe read. - Import
Result - Outcome of importing
.claude/settings.json. - Imported
Rule - A rule extracted from a Claude permissions entry.
- Parsed
Permissions permissionsblock from Claude settings.- Split
Command - A single command extracted from a shell pipeline.
Enums§
- Command
Separator - Operators that can join commands in a shell pipeline.
Functions§
- load_
claude_ settings - Read
.claude/settings.jsonfromdir/.claude/settings.json. - parse_
claude_ settings - Parse the raw text of a
.claude/settings.jsonfile. - parse_
rule_ entry - Parse a single Claude permissions entry string.
- split_
bash - Split a shell command line on
&&,||,;,|. Quotes and backslash escapes are honored. ReturnsNoneon unbalanced quotes.