Advanced Usage
AI agent reading patterns, multi-workspace tracking, daemon execution modes, and large workspaces.
Advanced Usage
How Agents Should Read ODS Workspaces
- Start at the root
ods.toml. - Discover the target with
ods overview/ods find/ods tree(no folder index files). - Read the target frontmatter first.
- Load
dependstransitively up tocontext.max-depth(default 2). - Load
context.loadentries: Document.mdpaths first, then Resource paths. - Skip paths matching
context.ignoreand workspaceignore:. - Prefer
stableoverdraft, anddraftoverdeprecatedorarchived.
That gives agents a deterministic path instead of a broad scan.
Use the CLI to debug the resolution:
ods context path/to/doc.md
Global Multi-Workspace Tracking (ods workspaces)
ODS background daemons (ods start / ods serve) monitor multiple repositories registered in the user’s global machine configuration file (~/.ods/odsconfig.toml):
# Register a workspace for background tracking
ods workspaces add /path/to/my-project
# List all tracked workspaces and pack entries
ods workspaces list
# Remove a workspace from tracking
ods workspaces remove /path/to/my-project
# Print machine config file path (~/.ods/odsconfig.toml)
ods workspaces path
Daemon Execution Modes & Memory Tuning (ods serve)
ods serve supports three execution modes for handling filesystem updates across workspaces:
auto(default): Automatically selectswatchmode, unlessODS_LOW_MEMORY=1is set in the environment, in which case it usespollmode.watch: Real-time OS event watcher (fsnotify/kqueue/inotify) for immediate rename mapping and index regeneration.poll: Periodic polling interval (default 10s). Drops temporary workspace state between ticks for maximum RAM savings in low-memory containerized environments.
# Low-memory polling configuration with RSS memory diagnostics
ODS_LOW_MEMORY=1 ODS_POLL_SECS=30 ods serve --mode poll --memory-report --root .
Large Workspaces
Guidance for tens of thousands of Markdown files:
- Keep profiles small; register custom catalogs under
custom_profilesin rootods.toml. - Prefer path-derived IDs; pin explicit
id:only when renames must not break external refs. - Run
ods lintandods lintin CI rather than trusting hand-edited maps. - Use
ods lintwhile onboarding noisy trees; enable body-link and graph checks at lint when ready. - Tooling skips
node_modules,target, and similar trees by default and may honor.gitignore. - Exclude implementation trees with root
ignore:(for examplesrc).