# Agent Installation Instructions This file is the canonical source for the full agent-driven onboarding sequence: evaluation, installation, activation, and tooling configuration. Short stable URL for site snippets: `install.md` at repo root. ## Design principle The canonical onboarding sequence is: **evaluation → installation → activation → tooling config** The activation phase follows: **detect context → discover → propose → preview → ingest → reconstruct → query → correct** Not: - install first without checking fit or tool constraints - scan everything → ingest everything → hope value appears - configure every integration before the user has seen first value - assume the install directory is a personal-data directory when it may be a developer/projects directory The agent optimizes for reaching the Installation Aha: a reconstructed timeline from the user's own files, with every event traced to a specific source. The first visible post-ingest output is never a file count -- it is a timeline with provenance. When the install directory is developer-oriented (multiple git repositories present), activation may branch from "detect context" into a [repo-integration path](#activation-branch-developer--repo-integration) that outputs a written integration plan instead of proceeding to ingest. ## Workflow ### Phase 1: Evaluation Start by deciding whether Neotoma is a fit and what the first successful path should be. 1. Assess fit from available context before asking broad questions. 2. Determine the user's current tool and environment constraints: - local agent environment vs hosted chat product - MCP support level - whether the current tool can support robust Neotoma usage 3. Identify the likely first data to store if the user proceeds. 4. Determine whether the user is already installed: - if no, proceed to installation after confirmation - if yes, skip directly to activation 5. If the current tool is constrained, say so explicitly and recommend the best-supported path. **Tooling guidance during evaluation:** - **ChatGPT hosted**: If the user lacks the plan/features for strong MCP support, recommend more robust options such as Cursor, Claude, Claude Code, or Codex for primary Neotoma usage. - **ChatGPT with suitable support**: Plan for either remote MCP or a Custom GPT, depending on the user's account and preference. - **Claude**: Plan for Project-based usage plus connector configuration and project instructions. - **Cursor / Claude Code / Codex**: prioritize local install and activation first; after activation, offer help configuring additional remote access points if useful. - **OpenClaw**: prioritize the native plugin install path first (`openclaw plugins install clawhub:neotoma`). Use manual MCP wiring only as fallback when the plugin path is unavailable or unsuitable. Data evaluation can happen here before installation if the user already has enough context available in the current tool. If not, perform that evaluation during activation after installation. Do not ingest anything before explicit confirmation. ### Phase 2: Installation The installation phase is optimized for agent harnesses with directory-scoped permissions. The agent MUST use the canonical `neotoma` commands below and MUST NOT improvise shell introspection (`python3 -c`, `grep -r`, `ls`, `cat`, `jq`, `find`, `which`, `node -e`). Each such command typically triggers a separate permission prompt; the canonical commands collapse the entire flow into two approvals: `neotoma *` (wildcard) and a one-time `npm install -g neotoma`. **Step 2.1 — Permissions pre-flight (user action)** Before running any command, ask the user to paste the allowlist snippet for their current harness from the [Permissions pre-flight](https://neotoma.io/install#permissions-preflight) block into the appropriate file: - Claude Code: `.claude/settings.local.json` (project) or `~/.claude/settings.json` (user) - Cursor: `.cursor/allowlist.json` (project) - Codex: `~/.codex/config.toml` (user) - OpenClaw: handled by the native plugin; no allowlist needed If the user declines the preflight, every command below may prompt individually. **Step 2.2 — Install the binary (if needed)** If the user is not already installed: - OpenClaw: `openclaw plugins install clawhub:neotoma` - All other harnesses: `npm install -g neotoma` (global install is required so the binary resolves on the agent's PATH without per-repo `npx` prompts; an opt-in local-install path is documented at the bottom of this file) **Step 2.3 — Inspect state with a single call** Run `neotoma doctor --json`. This returns a consolidated snapshot covering: - install state (installed, version, `path_fix_hint` when PATH is wrong) - data/init state (config_dir, data_dir, db_exists, initialized) - API runtime state (running, env, port) - detected MCP server configs per harness - CLI instruction files per harness (project + user scope) - permission-file status per harness - `current_tool_hint` and `suggested_next_step` Do NOT run shell introspection commands to recover any of this state. Every field above is available from `doctor --json`. **Step 2.4 — Apply the full setup in one call** Run `neotoma setup --tool --yes`. This composes: - `neotoma init --yes --idempotent` (safe to re-run; no-op when already initialized) - MCP configuration for the current tool - CLI instructions installation for the current tool - permission-file patches (merge-preserving; adds `neotoma *` wildcard and `npm install -g neotoma` allow entries) Use `--dry-run` first if the harness is strict; `--json` returns a structured report of every step, including changed files. For the full flag surface (`--install-scope` for MCP + CLI instruction files, permission `--scope`, `--mcp-transport`, `--rewrite-neotoma-mcp`, `--skip-hooks`, `--all-harnesses`, `--dry-run`, and `--skip-permissions`), see [`docs/developer/cli_reference.md#harness-setup`](docs/developer/cli_reference.md#harness-setup). The default MCP transport is **B**: local stdio for normal npm onboarding, with transport **A** available when you want signed HTTP `/mcp` proxy entries and the API is already running. **If the user is already installed** Run `neotoma doctor --json` to verify, then `neotoma setup --tool --yes` (idempotent) to bring any missing pieces into compliance. Do not improvise shell introspection to confirm state. **Forbidden during installation** - Do NOT run `python3 -c`, `grep -r`, `ls`, `cat`, `jq`, `find`, `which`, `node -e` to introspect Neotoma state. Use `neotoma doctor --json`. - Do NOT run arbitrary `npm run