Configuration
Config paths, storage requirements, and runtime options for annodex.
Writable home directory (important)
Annodex and Codex both write persistent data under the user home (unless you override the paths below). The web UI, model settings, project registry, extensions, optional password, server logs, and Codex chat history all depend on being able to create and update files there.
What gets written
| Location | Written by | Purpose |
|---|---|---|
~/.config/annodex/ | annodex | providers, projects, extensions, settings, auth, logs, runtime state |
~/.codex/ | Codex | CLI config and thread/session storage |
{project}/.annodex-uploads/ | annodex | pasted chat images for that project |
{project}/.codex/extensions.json | annodex (optional) | project-scoped extension definitions |
~/.config/annodex/memory/ | annodex | per-project working memory (JSONL) |
Linux and server deployments
Many Linux issues come from a non-writable or quota-limited $HOME:
- HPC / lab servers with small home partitions
- NFS home directories that are full or read-only
- Service accounts or containers where
$HOMEis missing or not writable sudosessions where$HOMEstill points at root's home
Check before starting:
echo "HOME=$HOME"
test -w "$HOME" && echo "home writable" || echo "home NOT writable"
mkdir -p "$HOME/.config/annodex" && echo "annodex config dir ok"Recommended fix — point annodex (and optionally Codex) at a writable directory on local or scratch disk:
export ANNODEX_CONFIG_DIR=/scratch/$USER/annodex-config
mkdir -p "$ANNODEX_CONFIG_DIR"
export CODEX_HOME=/scratch/$USER/codex-home
mkdir -p "$CODEX_HOME"
annodex --hostname 0.0.0.0Add those export lines to your shell profile or systemd unit so they persist across restarts.
Legacy env names ANNOVIBE_CONFIG_DIR / PIDEX_CONFIG_DIR are still accepted.
Configuration directory
Default annodex config root:
~/.config/annodex/Override with:
ANNODEX_CONFIG_DIR=/path/to/writable/configKey files
| File | Purpose |
|---|---|
providers.json | LLM provider API keys, base URLs, and model list |
annodex-projects.json | project registry, pin state, sort order |
extensions.json | global MCP / extension definitions (includes annodex-memory preset) |
settings.json | app preferences (e.g. auto-restart after update) |
app-settings.json | sandbox mode and other persisted settings |
web-auth.json | optional web UI password (set via annodex passwd) |
SOUL.md, HARNESS.md | optional global persona and harness prompts (seeded on first annodex start if missing) |
memory/ | per-project working memory (<sha1(cwd)>/entries.jsonl) |
im-secrets/ | per-project WeCom bot secrets (<sha1(cwd)>.json) |
im-sessions/ | persistent IM Codex thread id per project |
im-gateway.json | gateway auth token (created when IM is first saved in UI) |
annodex.json | runtime supervisor metadata while the server is running |
annodex.log | background server log (annodex logs) |
Older installs may still have annovibe-* or pidex-* filenames; annodex reads them for migration and writes new data under annodex-* names.
SOUL.md and HARNESS.md
On first start (annodex or annodex start), if SOUL.md or HARNESS.md is missing under the config directory, annodex copies neutral defaults from the package into that directory. Existing files are never overwritten on upgrade.
- SOUL.md — global tone and working style (persona). Edit
$ANNODEX_CONFIG_DIR/SOUL.mdor~/.config/annodex/SOUL.mdin your editor (not stored inside the project tree). - HARNESS.md — visualization and output constraints (e.g.
show-widgetcharts).
Each Linux user who runs annodex gets their own copy under $ANNODEX_CONFIG_DIR or ~/.config/annodex. If user A installs the npm package and user B runs annodex, B seeds into B's config dir on first start—not A's home.
Annodex runtime rules in code still override conflicting persona language in SOUL.md.
Providers and models
See Models for provider setup. Configured through Settings → Models or by editing providers.json.
Project registry and switcher
Projects you open are recorded in annodex-projects.json. In the workspace:
- The project switcher (top of the left sidebar) lists all unpinned projects. Pinned projects do not appear in the dropdown.
- Pin a project to keep it as an expandable Projects folder in the sidebar with chat history; drag pinned folders to reorder.
- The active unpinned project also appears as a temporary sidebar folder while selected.
Add projects from the switcher dropdown (Add project…) using the folder browser dialog.
File API (preview and download)
Project files are served under /api/files/{path}:
| Query | Purpose |
|---|---|
type=list | Directory listing |
type=read | Inline preview (text JSON, images, documents) |
type=download | Raw file stream with Content-Disposition: attachment (500MB cap) |
type=watch | SSE live sync while a file tab is open |
The FileViewer Download button uses type=download. See Usage — Preview files.
Project workspace files
Inside each project directory annodex may create:
| Path | Purpose |
|---|---|
.annodex-uploads/ | images pasted into chat (served back via the file API) |
.annodex/im.json | optional WeCom IM config (bot id, pairing, allowlist — no secret) |
.codex/extensions.json | project-scoped extensions (Settings → Extensions → Scope: Project) |
Ensure the project directory itself is writable if you paste images or save project-scoped extension config.
Project memory files
Annodex loads these from the project root into the system prompt at thread start:
| File | Purpose |
|---|---|
AGENTS.md / CLAUDE.md | project instructions (first match wins) |
MEMORY.md / memory.md | durable analysis log and long-term notes |
CONTEXT.md / context.md | stable facts, conventions, directory layout |
Working memory (agent retain / recall / reflect) is stored under config, not in the repo:
~/.config/annodex/memory/<sha1(project-cwd)>/entries.jsonlPromote candidates from the Tools → Memory panel into MEMORY.md or CONTEXT.md, or use the promote API. Full design and MCP setup: Project Memory.
Project IM (WeCom)
Optional one WeCom bot per project — configured in Settings → Project → WeCom IM (credentials and pairing in the UI only):
| Path | Purpose |
|---|---|
{project}/.annodex/im.json | enable flag, bot id, pairing code, allowlist, group options |
~/.config/annodex/im-secrets/<sha1(cwd)>.json | bot secret (server-side; gateway fetches via API) |
~/.config/annodex/im-sessions/<sha1(cwd)>.json | IM Codex session id |
~/.config/annodex/im-gateway.json | gateway auth token (created when IM is first saved) |
Run the sidecar in the same Linux account as annodex: annodex im-gateway or annodex-im-gateway. Users must send the pairing code first before the agent runs. See Project IM for the full setup flow, group @mention rules, streaming replies, and API details.
Codex integration
Annodex uses your existing Codex CLI installation:
- Config:
~/.codex(orCODEX_HOME) - History: threads and turns from Codex session storage
- Engine:
codex app-serverfor live chat
No separate migration step — install annodex alongside Codex and configure providers in annodex if needed.
Extensions
Settings → Extensions manages MCP-style extension definitions:
- Global scope →
~/.config/annodex/extensions.json - Project scope →
{cwd}/.codex/extensions.json
The panel shows a simple default view for each extension: name, description, Saved for project, and Enabled in current chat. Open Advanced for ID, transport (stdio/http), command/URL, scope, install notes, and Install/Remove MCP actions.
Quick-add presets: Annodex Memory, Browser Use, and Custom MCP. Use Inspect local Codex to view MCP servers, plugin marketplaces, and installed plugins discovered from the Codex CLI.
Enable annodex-memory both in Extensions settings and from the chat bar Extensions menu before using retain/recall/reflect. See Project Memory.
CLI commands
| Command | Purpose |
|---|---|
annodex | Start the server (seeds default SOUL/HARNESS on first run) |
annodex stop | Stop the Next.js server and clean orphaned codex app-server processes; does not stop annodex-im-gateway |
annodex restart | Stop then start |
annodex doctor | Diagnose Codex path, config dir, transport, orphaned app-server processes |
annodex logs | Tail annodex.log |
annodex passwd | Set optional web UI password (for remote access auth) |
annodex im-gateway | Run the WeCom IM sidecar (same Linux account as annodex) |
Runtime behavior
- Default port 30121 (
--port,PORT) - Bind address
127.0.0.1locally; useannodex --hostname 0.0.0.0on Linux servers - Connects to
codex app-server(WebSocket on Linux/macOS by default) - SSE streaming for live chat events; idle in-process sessions expire after ~10 minutes
- Optional web password via
annodex passwd. When enabled, non-localhost requests are redirected to a login page. localhost requests to/api/im/*,/api/memory/*, and/api/tunnel/*bypass login so the IM gateway, memory MCP, and tunnel management continue working. - Package updates can auto-restart the server when sessions are idle (
ANNODEX_AUTO_RESTART=0to disable)
Environment variables (common)
| Variable | Purpose |
|---|---|
ANNODEX_CONFIG_DIR | Writable config root (default ~/.config/annodex) |
CODEX_HOME | Codex data root (default ~/.codex) |
ANNODEX_PASSWORD | Set web password on start (non-interactive) |
ANNODEX_AUTO_RESTART | 0 disables post-update auto-restart |
ANNODEX_CODEX_TRANSPORT | ws, stdio, or auto for app-server transport |
PORT / --port | HTTP listen port |
--hostname | HTTP bind address |
Legacy ANNOVIBE_* and PIDEX_* names are still read for compatibility.