Skip to content

Configuration reference ​

Every process-level variable (.env), plus the database-stored settings that other pages refer to by key. For the common settings, see the Configuration guide.

Where a value lives. Anything editable in Settings is stored in the database and has no environment variable (enforced by a test). .env holds only what must be known before the database is opened. Two exceptions, PRECURSOR_PLAYWRIGHT_BROWSER and PRECURSOR_WORKIQ_TENANT_ID, describe the machine or tenant: .env seeds them and a value saved in Settings → MCP servers wins.

All variables are optional. In a source checkout, copy .env.example to .env; an installed instance reads the .env in its data directory.

Server ​

VariableDefaultDescription
PRECURSOR_HOST127.0.0.1Bind address. Keep it on loopback unless an authenticating proxy fronts the app.
PRECURSOR_PORT8000The URL you open. A busy port bumps to the next free one; precursor service install writes the chosen port back. In --dev, Vite serves this port and the backend uses PORT + 1.
PRECURSOR_LOG_LEVELinfoApp and uvicorn log level.
PRECURSOR_LOG_FILE_MAX_BYTES5242880Rotation size of logs/precursor.log.
PRECURSOR_LOG_FILE_BACKUPS3Rotated generations kept.
PRECURSOR_SHUTDOWN_GRACE_SECONDS3Wait for in-flight requests (e.g. SSE streams) on Ctrl-C before force-closing.
PRECURSOR_CORS_ORIGINS(empty)Comma-separated extra origins. Empty = same-origin only.

CLI flags: --port, --api-port, --host, --strict-port (fail instead of bumping), --port 0 (any free port), --open, --dev, --no-frontend.

Database & data directory ​

VariableDefaultDescription
PRECURSOR_DATABASE_URLsqlite+aiosqlite:///./precursor.db (checkout) / <data dir>/precursor.db (installed)Async SQLAlchemy URL. PostgreSQL (postgresql+asyncpg://…) needs the postgres extra.
PRECURSOR_DATA_DIR.precursor (checkout) / user data dir (installed)Holds workspaces/, attachment blobs/, drawio/, agents/copilot-home/, runtime.json and logs/. Relative paths resolve against the working directory.
PRECURSOR_SKILLS_DIR(empty)Skills folder. Unset: COPILOT_HOME → $XDG_CONFIG_HOME/copilot → ~/.copilot.
PRECURSOR_DEFINITIONS_DIR<data dir>/workspaces/definitionsWIP. Folder of definition files (*.agent.yaml, *.workflow.yaml, *.summary.yaml). Replaces the built-in Definitions workspace.
PRECURSOR_DEFINITIONS_SOURCEdatabaseWIP. files forces files mode. Normally set by the migration wizard instead.
PRECURSOR_DEFINITIONS_WORKSPACE(empty)WIP. Keep definitions in a workspace: its slug, optionally with a subfolder (team-defs/precursor). Ignored when PRECURSOR_DEFINITIONS_DIR is set.

A source checkout keeps state beside the code (one sandbox per clone/worktree). An installed wheel uses the per-user data dir:

PlatformUser data dir
macOS~/Library/Application Support/Precursor
Linux$XDG_DATA_HOME/precursor, else ~/.local/share/precursor
Windows%APPDATA%\Precursor

Background app & updates ​

Used by the background app (supervisor, tray, updater).

VariableDefaultDescription
PRECURSOR_UPDATE_REPOlrivallain/precursorRepository whose releases the update check reads.
PRECURSOR_UPDATE_CHANNELstablestable or nightly. Empty = match the running build (dev → nightly). Settings → Updates wins.
PRECURSOR_UPDATE_EXTRASkanbanExtras kept across precursor service update, unioned with uv's install receipt. Add tray if you use the icon; -name drops one.
PRECURSOR_UPDATE_CHECK_TTL_SECONDS900Cache lifetime of an update-check result.
PRECURSOR_UPDATE_NOTIFYoffnotify posts a system notification when a background check finds a build. Settings → Updates wins.

Anonymous usage data ​

See Anonymous usage data. Nothing is sent until the user opts in from the app; these only turn it off or redirect it.

VariableDefaultDescription
PRECURSOR_TELEMETRY(empty)off sends nothing, whatever the user chose. DO_NOT_TRACK=1 and CI=true do the same.
PRECURSOR_TELEMETRY_CONNECTION_STRINGthe project's (Sweden Central)Application Insights connection string the data goes to. Empty disables telemetry.
PRECURSOR_TELEMETRY_POLL_SECONDS900How often queued error reports are sent and the daily heartbeat is checked.

Installer variables ​

Read by install.sh / install.ps1 (see Installation):

VariableDefaultEffect
PRECURSOR_CHANNELnightlystable installs the latest tagged release from PyPI.
PRECURSOR_EXTRASkanban,trayExtras to install; none for the lean core.
PRECURSOR_NO_START—1 installs the command without registering or starting anything.
PRECURSOR_WHEEL—Install this wheel (path or URL) instead of a channel build.
PRECURSOR_REPOlrivallain/precursorRepository whose nightly builds to install.

Diagram editor ​

.drawio files open in a self-hosted draw.io editor, downloaded on first use into <data dir>/drawio/<version>/ (~53 MB download, ~150 MB on disk). See Workspaces → Editing diagrams.

VariableDefaultDescription
PRECURSOR_DRAWIO_VERSIONv31.3.1draw.io release to install; changing it replaces the old one on next use.
PRECURSOR_DRAWIO_DOWNLOAD_URLGitHub release draw.warArchive URL template ({version} substituted). Point it at a mirror when offline.

LLM provider ​

Providers, credentials, models and presets are set in Settings → Model and Settings → Presets; their stored keys are in the Models & presets reference.

VariableDefaultDescription
PRECURSOR_GITHUB_CLI_USER(empty)gh login that supplies the token (gh auth token --user …), for several signed-in accounts. The account picked in Settings → GitHub wins over it.

Prompt budgeting (Settings → Model → Prompt budgeting):

SettingDefaultDescription
llm_max_input_tokens600000Estimated prompt tokens per request; oldest turns are dropped first (/compact summarises them instead).
llm_max_tool_result_tokens20000Cap on one tool result entering the prompt.
llm_tool_result_keep_turns5Tool results over 2,000 characters older than this many user turns are sent as a preview. 0 = always in full. See automatic trimming.
llm_max_attachment_chars200000Extracted text kept per attached document (1,000–2,000,000); longer text is cut with a note. See Attachments.

The OpenAI-compatible endpoint (openai_proxy_enabled, off by default, and its API key) is set in Settings → Model; its URL follows PRECURSOR_HOST / PRECURSOR_PORT.

Tabs ​

Set in Settings → Appearance:

SettingDefaultDescription
tabs_max_mounted6How many tabs stay loaded (1–30). Older ones are unloaded to their link and reload when shown; pinned tabs never are.

Backup ​

Enabled, targeted and retained from Settings → Backup. Each run writes db/ snapshots, a blobs/ mirror and a definitions/definitions-<timestamp>.zip of the definitions folder; retention applies to snapshots and archives.

VariableDefaultDescription
PRECURSOR_BACKUP_INTERVAL_SECONDS86400Minimum time between successful backups.
PRECURSOR_BACKUP_POLL_SECONDS3600How often the ticker checks whether a backup is due.

Scheduler & reminders ​

Ticker for scheduled topics, agents and workflows and reminders. Each schedule's recurrence is stored in the database.

VariableDefaultDescription
PRECURSOR_SCHEDULER_ENABLEDtrueMaster switch for every background ticker: scheduler, reminders, retention sweeps, IQ indexer. false for a read-only or CI instance.
PRECURSOR_SCHEDULER_POLL_SECONDS30Scheduler poll interval.
PRECURSOR_SCHEDULER_CONCURRENCY2Scheduled runs executing at once.
PRECURSOR_REMINDER_POLL_SECONDS30Reminder poll interval.
PRECURSOR_WAKEUP_POLL_SECONDS10How often paused conversations are checked for a due self wakeup.

The per-run timeout is Settings → System → Scheduled run timeout (default 600 s).

Retention ​

Sweeps run at startup and daily (see Storage & retention). Windows are database settings:

SettingDefaultWhereDescription
tool_result_retention_days0 (forever)Settings → SystemReplace large tool-result content with a placeholder and drop the model's thinking.
live_transcript_retention_days7Settings → LiveDelete a Live session's transcript segments after it ends. Insights, notes, summary kept. 0 = forever.
workflow_step_retention_days30Settings → WorkflowsReplace a finished run's step inputs with a placeholder; such steps can't be replayed. Outputs kept. 0 = forever.
agent_event_retention_days30Settings → AgentsDelete archived agent timeline events. Running agents are never pruned; results, artifacts and messages kept. 0 = forever.
agent_event_max_per_session2000Settings → AgentsKeep only the newest N archived events per agent. 0 = unlimited.

Poll cadences: PRECURSOR_TOOL_RESULT_RETENTION_POLL_SECONDS, PRECURSOR_LIVE_TRANSCRIPT_RETENTION_POLL_SECONDS, PRECURSOR_AGENT_EVENT_RETENTION_POLL_SECONDS, all 86400, all gated by PRECURSOR_SCHEDULER_ENABLED.

Precursor IQ ​

The Precursor IQ index (⌘K ranking, Ask, /api/iq/*, the retrieve / ask MCP tools).

VariableDefaultDescription
PRECURSOR_IQ_ENABLEDtruefalse: ⌘K uses substring search and /api/iq/* returns 404.
PRECURSOR_IQ_INDEX_POLL_SECONDS20Indexer interval for queued changes and missing embeddings (min 5 s).
PRECURSOR_IQ_RECONCILE_POLL_SECONDS3600Interval of the check for bulk edits that bypassed the queue.

Settings → Precursor IQ:

SettingDefaultDescription
iq_embeddings_enabledfalseEmbed every passage (uses quota) and add vector similarity to ranking.
iq_embedding_provider""Provider id for embeddings; empty = default provider. An unconfigured provider disables semantic matching.
iq_embedding_modeltext-embedding-3-smallModel or Azure deployment name, at 256 dimensions.
iq_ask_provider""Provider for Ask answers (with iq_ask_model); empty = default.
iq_ask_model""Model for Ask answers; empty = chat model.

Agents ​

Agents mode is switched on in Settings → Agents (no env default).

VariableDefaultDescription
COPILOT_CLI_PATH(empty)copilot binary to use. Otherwise: the SDK's download cache, then PATH. The probe never downloads (details).
PRECURSOR_AGENTS_MAX_CONCURRENT3Agents executing a turn at once; others queue. ≤ 0 = unbounded.
PRECURSOR_AGENTS_RETRY_BACKOFF_SECONDS60Base delay of auto-retry, doubling per attempt, up to the agent's max_retries.
SettingDefaultDescription
agents_file_change_trackingtrueNew sessions record changed files so a rewind can restore them.

Token budget and max retries are per agent (settings drawer or blueprint).

MCP tool servers ​

Built-in MCP servers are toggled in Settings → MCP servers.

VariableDefaultDescription
PRECURSOR_MCP_IDLE_TTL_SECONDS600Idle time before an MCP client session is closed (reattached on next call).
PRECURSOR_MCP_WARMUP_ENABLEDtrueConnect enabled servers one by one in the background after startup. Never blocks, never starts an interactive sign-in. false = connect on first use.
PRECURSOR_MCP_WARMUP_DELAY_SECONDS5Delay before warm-up starts.
PRECURSOR_MCP_WARMUP_GAP_SECONDS1Pause between servers during warm-up.
PRECURSOR_GITHUB_MCP_TOOLSETScontext,repos,issues,pull_requests,usersToolsets of the bundled GitHub server. Fewer toolsets = smaller schemas sent every turn.
PRECURSOR_PLAYWRIGHT_BROWSERmsedgeplaywright browser: msedge (rides corporate SSO), chromium, chrome, firefox, webkit, or default (omit --browser, for builds that reject it). Settings wins.
PRECURSOR_PLAYWRIGHT_PROFILE_DIR(empty)--user-data-dir. Empty = @playwright/mcp's shared profile, so existing SSO sign-ins carry over.
PRECURSOR_WORKIQ_TENANT_ID(empty)Tenant GUID for the Agent 365 servers (common/organizations are rejected). Settings wins; if both are empty, read from an existing WorkIQ sign-in.

mcp_expose sections of the built-in server, all off by default except canvas: iq (retrieve), iq_ask (ask), workspaces (read), workspaces_write (create and write; opt-in even for Precursor's agents), canvas (canvases: on by default, writes only to the built-in Canvas workspace), tools (get_datetime, calculate, date_math, …).

WorkIQ / Agent 365 sign-in ​

Defaults suit an unattended instance (e.g. a scheduled workflow).

VariableDefaultDescription
PRECURSOR_WORKIQ_KEEPALIVE_ENABLEDtrueRefresh tokens in the background before they expire.
PRECURSOR_WORKIQ_KEEPALIVE_POLL_SECONDS60Keep-alive check interval. Renewal starts a quarter of the token's lifetime (≥ 5 min) before expiry; not configurable.
PRECURSOR_WORKIQ_KEEPALIVE_IDLE_AFTER_SECONDS21600Stop refreshing a credential no server has used for this long. 0 = refresh forever.
PRECURSOR_WORKIQ_KEEPALIVE_SURFACE_IDLE_LAPSEtrueWhen an idle credential has really expired and can't refresh, raise the sign-in banner instead of waiting for your next request.
PRECURSOR_WORKIQ_SILENT_REAUTH_ENABLEDtrueTry no-browser re-authentication before prompting.
PRECURSOR_WORKIQ_AUTO_REAUTH_ENABLEDtrueStart re-authentication automatically when a credential lapses.
PRECURSOR_WORKIQ_CHAIN_REAUTH_ENABLEDtrueAfter one sign-in, silently renew the other Entra credential too (one prompt instead of two).
PRECURSOR_WORKIQ_LOOPBACK_PORT_FALLBACKtrueIf the OAuth callback port (12798–12800) is busy, use an ephemeral one. false = fail instead.
PRECURSOR_WORKIQ_AUTH_LOG_LEVELdebugLevel of the precursor.mcp.auth trace channel, independent of PRECURSOR_LOG_LEVEL. GET /api/mcp/auth/diagnostics keeps the full trace regardless.

Released under the MIT License.