Configuration
Customize how Forage indexes your project and runs its servers.
Config files
Forage uses two config files:
- Global config —
~/.forage/config.json— applies to all workspaces. Created automatically on first run. - Workspace config —
{workspace}/.forage/config.json— per-project overrides. Most fields arenullby default, meaning they inherit the global value.
The easiest way to edit these is through the Forage web UI at http://localhost:9988 → Settings. Forage automatically generates its API key on first run — do not edit the apiKey field manually.
Global config template with all available options:
{
"port": 9988,
"mcpPort": 9989,
"listenOnAllInterfaces": false,
"corsOrigins": "",
"apiKey": "<auto-generated>",
"ollama": {
"url": "http://localhost:11434",
"apiKey": "",
"model": "llama3",
"reasoningEffort": "medium",
"codingModel": "",
"codingUrl": "",
"codingApiKey": "",
"codingReasoningEffort": "medium",
"modelParams": {},
"codingModelParams": {}
},
"chat": {
"autoCompactAt": 75,
"keepFirstMessages": 2,
"keepLastMessages": 6
},
"snapshots": {
"heartbeatIntervalMinutes": 30
},
"annotations": {
"heartbeatIntervalMinutes": 0,
"batchSize": 5
},
"agentAutonomy": "supervised",
"workspacesDir": "",
"services": {
"watchFiles": true,
"mcpServer": true,
"startOnBoot": false
},
"proxy": {
"enabled": false,
"protocol": "http",
"host": "",
"port": 0,
"username": "",
"password": ""
},
"google": {
"clientId": "",
"clientSecret": ""
}
}
Options reference
Servers
| Option | Type | Default | Description |
|---|---|---|---|
port |
number | 9988 |
Port for the Forage web UI. |
mcpPort |
number | 9989 |
Port for the MCP server. Update your agent configs when changing this. |
listenOnAllInterfaces |
boolean | false |
Bind servers to 0.0.0.0 instead of 127.0.0.1. Required if you need to reach Forage from another machine on your network. |
corsOrigins |
string | "" |
Comma-separated list of allowed CORS origins. Leave blank to restrict to same-origin requests only. |
AI providers
Forage talks to four kinds of model backends: a local Ollama server, or the hosted OpenAI, Anthropic (Claude), and Google Gemini APIs. chatProvider and codingProvider each independently select which one serves the Chat Model (Graph page AI chat, the ask MCP tool) and the Coding Model (Editor code assistant, the code_task MCP tool) — you can mix them, e.g. Claude for chat and a local Ollama model for coding.
| Option | Type | Default | Description |
|---|---|---|---|
chatProvider | string | "ollama" | Which provider serves the Chat Model: "ollama", "openai", "anthropic", or "gemini". |
codingProvider | string | "ollama" | Which provider serves the Coding Model. Set independently from chatProvider. |
Ollama
| Option | Type | Default | Description |
|---|---|---|---|
ollama.url | string | http://localhost:11434 | Ollama server URL for the Chat Model. |
ollama.apiKey | string | "" | API key for the Chat Model server (required if using a hosted Ollama-compatible endpoint). |
ollama.model | string | "llama3" | Ollama model name for the Chat Model. |
ollama.reasoningEffort | string | "medium" | Reasoning effort for gpt-oss models: "low", "medium", or "high". Ignored for other models. |
ollama.codingModel | string | "" | Model name for the Coding Model. Falls back to model if blank. |
ollama.codingUrl | string | "" | Server URL for the Coding Model. Falls back to url if blank. |
ollama.codingApiKey | string | "" | API key for the Coding Model server. Falls back to apiKey if blank. |
ollama.codingReasoningEffort | string | "medium" | Reasoning effort for the Coding Model. Falls back to reasoningEffort if blank. |
ollama.modelParams | object | {} | Extra Ollama options for the Chat Model (e.g. { "temperature": 0.7, "top_p": 0.9, "top_k": 40, "repeat_penalty": 1.1, "num_predict": 2048, "seed": 42 }). Leave empty to use model defaults. |
ollama.codingModelParams | object | {} | Extra Ollama options for the Coding Model. Independent of modelParams. |
OpenAI / Anthropic / Gemini
These three are API-key-only providers (no OAuth/login flow) and share the same shape: apiKey and model for the Chat Model, plus optional codingModel / codingApiKey overrides for the Coding Model — same fallback behavior as the Ollama block above.
| Option | Type | Default | Description |
|---|---|---|---|
openai.apiKey / anthropic.apiKey / gemini.apiKey | string | "" | API key for that provider's Chat Model. |
openai.model / anthropic.model / gemini.model | string | "" | Model name, e.g. "gpt-4.1", "claude-sonnet-5", "gemini-2.0-flash". |
*.codingModel | string | "" | Separate model for the Coding Model. Falls back to model if blank. |
*.codingApiKey | string | "" | Separate API key for the Coding Model. Falls back to apiKey if blank. |
{
"chatProvider": "anthropic",
"codingProvider": "ollama",
"anthropic": {
"apiKey": "sk-ant-...",
"model": "claude-sonnet-5"
},
"ollama": {
"url": "http://localhost:11434",
"codingModel": "gpt-oss:32b"
}
}
Chat
| Option | Type | Default | Description |
|---|---|---|---|
chat.autoCompactAt | number | 75 | Percentage of context window used before Forage auto-compacts the chat history. |
chat.keepFirstMessages | number | 2 | Number of opening messages to preserve when compacting. |
chat.keepLastMessages | number | 6 | Number of most-recent messages to preserve when compacting. |
Snapshots & Annotations
| Option | Type | Default | Description |
|---|---|---|---|
snapshots.heartbeatIntervalMinutes | number | 30 | How often Forage automatically creates a snapshot (in minutes). Set to 0 to disable. |
annotations.heartbeatIntervalMinutes | number | 0 | How often Forage runs AI annotation of source files (in minutes). 0 = disabled (LLM calls have a cost). |
annotations.batchSize | number | 5 | Number of files annotated per annotation run. |
Agent & Services
| Option | Type | Default | Description |
|---|---|---|---|
agentAutonomy | string | "supervised" | "supervised" — the Editor's coding agent queues jobs and waits for your approval before writing to disk. "auto" — agent completes jobs end-to-end without pausing. |
workspacesDir | string | "" | Default directory suggested when cloning a new workspace. |
services.watchFiles | boolean | true | Watch workspace directories for file changes and update the graph incrementally. |
services.mcpServer | boolean | true | Run the MCP server alongside the web UI. |
services.startOnBoot | boolean | false | Register Forage as a system startup item. |
Proxy
| Option | Type | Default | Description |
|---|---|---|---|
proxy.enabled | boolean | false | Route outbound requests through a proxy. |
proxy.protocol | string | "http" | "http" or "https". |
proxy.host | string | "" | Proxy hostname or IP. |
proxy.port | number | 0 | Proxy port. |
proxy.username | string | "" | Proxy username (if required). |
proxy.password | string | "" | Proxy password (if required). |
Google (optional)
Required only if you want to export documentation to Google Docs. Obtain credentials from the Google Cloud Console.
| Option | Type | Default | Description |
|---|---|---|---|
google.clientId | string | "" | Google OAuth 2.0 Client ID. |
google.clientSecret | string | "" | Google OAuth 2.0 Client Secret. |
Workspace config
Each workspace can override a subset of the global config. A null value means "inherit from global".
{
"name": "my-project",
"ollama": null,
"chatProvider": null,
"codingProvider": null,
"openai": null,
"anthropic": null,
"gemini": null,
"testCommand": null,
"agentAutonomy": null,
"snapshots": null,
"annotations": null
}
| Option | Description |
|---|---|
name | Display name for this workspace in the Forage UI. |
ollama | Per-workspace Ollama override. Same shape as the global ollama object. null = inherit global. |
chatProvider / codingProvider | Per-workspace override of which provider (ollama/openai/anthropic/gemini) serves that role. null = inherit the global default. |
openai / anthropic / gemini | Per-workspace override for that provider, same shape as the matching global block. null = inherit global. |
testCommand | Shell command to run after the coding agent applies changes (e.g. "npm test"). Output streams into the editor chat. null = skip. |
agentAutonomy | Per-workspace override for "supervised" / "auto". null = inherit global. |
snapshots | Per-workspace snapshot interval override. null = inherit global. |
annotations | Per-workspace annotation settings override. null = inherit global. |
Using a local AI model
Ollama remains the default provider and the only fully local, zero-data-egress option — Forage also supports hosted OpenAI, Anthropic, and Gemini models (see AI providers above) for teams that prefer them, but those send code context to that provider's API. For a fully air-gapped setup, leave chatProvider/codingProvider at "ollama", set ollama.url to your Ollama server, and choose a model:
{
"ollama": {
"url": "http://localhost:11434",
"model": "gpt-oss:120b",
"codingModel": "gpt-oss:32b"
}
}
.forageIgnore
You can also create a .forageIgnore file in your project root (same syntax as .gitignore) to exclude paths from indexing without editing the config file:
# Vendor code
vendor/
third_party/
# Generated files
*.pb.go
*.generated.ts
# Large data files
fixtures/
testdata/large/