Skip to main content

Configuration

OpenOrca configuration is stored at ~/.openorca/config.json. Edit it directly, or use /config in the REPL for an interactive editor.

Default Configuration

{
"lmStudio": {
"baseUrl": "http://localhost:1234/v1",
"apiKey": "lm-studio",
"model": null,
"temperature": 0.7,
"maxTokens": null,
"timeoutSeconds": 120,
"streamingTimeoutSeconds": 120,
"nativeToolCalling": false,
"promptProfile": null
},
"permissions": {
"autoApproveAll": false,
"autoApproveReadOnly": true,
"autoApproveModerate": false,
"alwaysApprove": [],
"disabledTools": [],
"allowPatterns": [],
"denyPatterns": []
},
"context": {
"contextWindowSize": 8192,
"autoCompactThreshold": 0.8,
"compactPreserveLastN": 4,
"autoCompactEnabled": true,
"charsPerToken": 3.5
},
"session": {
"autoSave": true,
"maxSessions": 100
},
"agent": {
"maxIterations": 15,
"timeoutSeconds": 300
},
"hooks": {
"preToolHooks": {},
"postToolHooks": {}
},
"memory": {
"autoMemoryEnabled": true,
"maxMemoryFiles": 20
}
}

LM Studio Settings (lmStudio)

SettingTypeDefaultDescription
baseUrlstringhttp://localhost:1234/v1LLM server endpoint. Works with LM Studio, Ollama, or any OpenAI-compatible API.
apiKeystringlm-studioAPI key. LM Studio doesn't require a real key — any string works. Change this if your server requires authentication.
modelstringnullModel ID to use. If null, auto-detects (uses the only loaded model, or the first one). Set this explicitly when multiple models are loaded.
temperaturefloat0.7Sampling temperature. Lower = more focused, higher = more creative. 0.7 is a good default for coding tasks.
maxTokensint?nullMax tokens per response. null lets the server decide. Set this if responses are being cut off.
timeoutSecondsint120HTTP request timeout. Increase for slower hardware or larger models.
streamingTimeoutSecondsint120Idle timeout per streaming response. Resets on each token received. Increase for models that pause during generation.
nativeToolCallingboolfalseSend tool definitions via OpenAI function calling protocol. Set to true for models that support it (e.g., Mistral). See Model Setup.
promptProfilestring?nullOverride which prompt template to use. See Model Setup.

Permission Settings (permissions)

SettingTypeDefaultDescription
autoApproveAllboolfalseAuto-approve all tool calls regardless of risk level. Use with caution — this includes shell execution and git push.
autoApproveReadOnlybooltrueAuto-approve ReadOnly tools (file reading, searching, thinking). Safe to leave on.
autoApproveModerateboolfalseAuto-approve Moderate tools (file writing, git commit, mkdir). Useful for trusted workflows.
alwaysApprovestring[][]List of specific tool names to always auto-approve, regardless of risk level. Example: ["bash", "write_file"]
disabledToolsstring[][]List of tool names to completely disable. These tools won't appear in the system prompt or be callable.
allowPatternsstring[][]Glob patterns for auto-approving specific tool+argument combinations. Format: ToolName(argGlob). Example: Bash(git *) auto-approves all git commands.
denyPatternsstring[][]Glob patterns for blocking specific tool+argument combinations. Deny takes priority over allow. Example: Bash(rm -rf *) blocks all rm -rf commands.

Permission Glob Patterns

Permission glob patterns provide fine-grained control over tool approvals based on the command or file path being used. Patterns use the format ToolName(argGlob).

Pattern syntax:

  • * matches any characters within a single path segment
  • ** matches any characters across path segments (for file paths)
  • Tool names are matched case-insensitively

How it works:

  1. Deny patterns are checked first — if any match, the tool call is blocked
  2. Allow patterns are checked next — if any match, the tool call is auto-approved
  3. If no pattern matches, the standard permission flow applies

Argument extraction by tool type:

ToolArgument used for matching
bashThe command property
write_file, edit_file, read_file, delete_file, copy_file, move_file, multi_editThe path property

Examples:

{
"permissions": {
"allowPatterns": [
"Bash(git *)",
"Bash(dotnet *)",
"write_file(src/**)",
"edit_file(src/**)"
],
"denyPatterns": [
"Bash(rm -rf *)",
"Bash(sudo *)",
"write_file(.env*)"
]
}
}

CLI Override: --allow

You can pre-approve tools from the command line without modifying your config. This is useful for CI/CD pipelines:

openorca --prompt "Run the tests" --allow bash,read_file,grep

The --allow flag appends to alwaysApprove for that session only — it doesn't modify config.json.

Permission Examples

Fully autonomous (trust everything):

{
"permissions": {
"autoApproveAll": true
}
}

Moderate trust (auto-approve file writes but confirm shell/push):

{
"permissions": {
"autoApproveReadOnly": true,
"autoApproveModerate": true
}
}

Specific tool trust:

{
"permissions": {
"alwaysApprove": ["write_file", "edit_file", "bash"]
}
}

Disable tools you don't want:

{
"permissions": {
"disabledTools": ["git_push", "spawn_agent"]
}
}

Context Settings (context)

SettingTypeDefaultDescription
contextWindowSizeint8192Total context window in tokens. Should match your model's actual window size. Common values: 4096, 8192, 16384, 32768.
autoCompactThresholdfloat0.8Trigger auto-compaction when context usage exceeds this percentage (0.0–1.0). At 0.8, compaction triggers at 80% usage.
compactPreserveLastNint4Number of recent conversation turns to keep when compacting. These are never summarized.
autoCompactEnabledbooltrueEnable automatic context compaction. If false, you must manually use /compact.
charsPerTokenfloat3.5Characters-per-token ratio for context usage estimation. Adjust if your model's tokenizer differs significantly.

Tip: Set contextWindowSize to match your model's actual context window (check LM Studio model card). If set too high, the model may receive truncated context without warning. If set too low, compaction triggers too often.

Session Settings (session)

SettingTypeDefaultDescription
autoSavebooltrueAutomatically save the conversation when exiting.
maxSessionsint100Maximum number of saved sessions. Oldest sessions are pruned when this limit is exceeded.

Agent Settings (agent)

SettingTypeDefaultDescription
maxIterationsint15Maximum iterations for sub-agent loops spawned via spawn_agent.
timeoutSecondsint300Timeout in seconds for sub-agent tasks.

Hook Settings (hooks)

SettingTypeDefaultDescription
preToolHooksobject{}Shell commands to run before a tool executes. Key is tool name or * for all. Non-zero exit blocks the tool.
postToolHooksobject{}Shell commands to run after a tool executes. Key is tool name or * for all. Fire-and-forget — exit code doesn't affect anything.

See Hooks & Extensibility for details and examples.

Memory Settings (memory)

SettingTypeDefaultDescription
autoMemoryEnabledbooltrueAutomatically save session learnings at session end and load them into the system prompt for future sessions.
maxMemoryFilesint20Maximum number of auto-generated memory files. Oldest files are pruned when this limit is exceeded.

When enabled, at the end of each session that includes meaningful tool usage, OpenOrca asks the LLM to summarize project-specific patterns and learnings. These are saved as .md files in:

  • Project memory: .orca/memory/ (takes priority)
  • Global memory: ~/.openorca/memory/

Memory content is loaded into the system prompt at session start. Manage memory with the /memory command:

  • /memory list — list all memory files
  • /memory auto on|off — toggle auto memory
  • /memory clear-auto — delete all auto-generated memory files

See Auto Memory for details.


Data Directory Structure

All OpenOrca data lives under ~/.openorca/:

~/.openorca/
├── config.json # Main configuration
├── logs/
│ └── openorca-2025-01-15.log # Daily log files
├── prompts/
│ ├── default.md # Default system prompt template
│ └── mistral-7b-instruct-v0.3.md # Auto-generated model-specific prompt
├── sessions/
│ ├── abc123.json # Saved conversation sessions
│ └── ...
├── checkpoints/ # File checkpoints (per session)
│ └── {sessionId}/
│ ├── manifest.json # Checkpoint manifest
│ └── *.bak # Original file snapshots
├── memory/ # Global auto-learned memory files
│ └── 20260221-a1b2c3.md
└── commands/ # Global custom slash commands
└── my-command.md

Project-Level Data

Projects can also have local data in .orca/:

.orca/
├── ORCA.md # Project instructions
├── commands/ # Project-level custom slash commands
│ └── review-pr.md
└── memory/ # Project-level auto-learned memory
└── 20260221-d4e5f6.md