Documentation
Everything you need to run and debug Scubiee.
Written so you — or any chatbot you paste this into — can install, wire MCP, and fix issues without eng notes. Local-first: your code stays on your machine.
How it works
Scubiee is a local context engine for AI coding tools (Cursor, Claude Code, Kiro, Copilot, and more). You need Python 3.10+. You do not need to clone the GitHub repo — install from PyPI.
It indexes your repository, embeds code with CodeRank (GPU when available), and exposes search / map / focus over MCP. Your source stays on your machine; only the embedding model downloads once during setup (~270 MB).
Scubiee runs a local daemon that maintains an index of each enrolled repository — parsed structure, chunks, embedding vectors, and graph relationships. A thin MCP server connects your AI tool. When the agent asks “where is billing handled?”, Scubiee returns ranked locations (map) and focused code spans (focus) — not guessed filenames. Incremental sync keeps the index fresh after edits and git pull.
The four layers
Most problems mean one layer is missing or stale. Why agents say managed: false: layer 3 or 4 is missing — not a broken index by itself.
| Layer | Question | Command | Marker |
|---|---|---|---|
| 1. Install | Is scubiee installed? | uv tool install scubiee | scubiee --version |
| 2. Machine setup | GPU/CPU + model ready? | scubiee setup --repair | ~/.scubiee/accel.json |
| 3. Repo enrollment | Is this folder indexed? | scubiee init . | <repo>/.scubiee/id.json |
| 4. IDE wiring | Does agent call MCP? | scubiee connect --cursor | MCP config + rules |
Your AI tool (Cursor / Kiro / Claude Code / …)
↓ MCP (stdio) — server name: scubiee
Scubiee MCP — status, map, focus, grep, glob, workspace
↓ HTTP localhost (default :8765)
Scubiee Engine — daemon + live re-indexing
↓
Your code index — vectors + graph + chunks under ~/.scubiee
Memorize this sequence
| Step | Command | What it does |
|---|---|---|
| 1 | uv tool install scubiee | Install the CLI |
| 2 | scubiee setup --repair | Machine setup — GPU/CPU/MLX, model, accel.json |
| 3 | scubiee init . | Enroll + index this repo — does not write MCP |
| 4 | scubiee connect --… | Write MCP + agent rules for your IDE |
| 5 | Reload MCP in the IDE | Agent status() → managed: true |
initdoes not write MCP. After init you still needconnect.setupalone does not make a repo managed. You still needinitinside the project.- Adding a second repo only needs
init(and Special-4connectinside that project).
Core concepts
| Operation | Scope | When |
|---|---|---|
| scubiee setup --repair | Machine: GPU/CPU/MLX, model, accel.json | Once per machine; after upgrade |
| scubiee init <path> | Per-repo enroll + index | Each searchable repo |
| scubiee connect --<tool> | MCP + agent rules | Each IDE; Special-4 inside each project |
Managed states
- Unmanaged — never initialized; use native tools
- Managed / active — enrolled and indexed; MCP tools available
- Paused — enrolled but sync blocked; run
scubiee activate . - Wiped — all Scubiee data removed; back to unmanaged
The problem without Scubiee
- Discovery noise — agents grep broadly, read wrong files, or hallucinate paths.
- Stale context — files changed since the chat started; the agent does not know.
- No shared index — every session re-explores the repo from scratch.
- Cloud search tradeoffs — uploading code raises privacy and compliance concerns.
- DIY RAG complexity — embeddings, chunking, incremental sync, and MCP wiring takes weeks.
Profile selection (why setup picks a profile)
| Machine | Typical profile | Why |
|---|---|---|
| Windows + discrete AMD/NVIDIA | dml | DirectML FP16 embed |
| Windows + Intel iGPU only | cpu | DML on iGPU hangs or fails — CPU is reliable |
| Apple Silicon | mlx | Metal FP16 path |
| Linux + NVIDIA | cuda | CUDA ORT |
| Everything else | cpu | Safe default |
What the daemon does
A local HTTP service (default http://127.0.0.1:8765) serves search, grep, and index operations to MCP and CLI. It runs background sync for enrolled repos, respects RAM admission and embed batching, and is restarted by a lightweight watchdog if it crashes. A small local service keeps your index warm and answers search requests in milliseconds.
Time expectations
| Step | Typical duration |
|---|---|
| Install | 1–3 minutes |
| Setup (incl. model download) | 3–10 minutes first time |
| Init small repo (~100 files) | 1–5 minutes |
| Init large monorepo | Minutes to tens of minutes; may need --confirm |
| Connect | Seconds |
Facts any assistant needs
Paste this page (or the topic you care about) into ChatGPT / Claude / etc. These facts prevent wrong advice:
- Product CLI + MCP server key =
scubiee(not “context-engine”). - Data lives under
~/.scubieeand<repo>/.scubiee. - Order is always
setup→init→connect→ reload MCP. Skipping connect leaves agents unmanaged. - Continue after pause/stop with
scubiee resume— there is nowakecommand. - Windows Access denied on upgrade →
scubiee unlock-tool, not Admin/reboot. machine_not_setup/ missing FastEmbed →scubiee setup --repair.- Share
scubiee diagnose --no-tests --desktop→Desktop/scubiee-diagnose.json(not your source tree).
Quick start
Correct order matters. init does not write MCP config — connect does. Then reload MCP in the IDE.
macOS / Linux
uv tool install --force scubiee --index-url https://pypi.org/simple --refreshuv tool update-shell# open a new terminalscubiee setupcd your-reposcubiee init .scubiee connect --cursor# reload MCP in your IDE
Windows (PowerShell)
uv tool install --force scubiee --index-url https://pypi.org/simple --refreshuv tool update-shell# open a NEW PowerShell windowscubiee setupcd C:\path\to\your\reposcubiee init .scubiee connect --cursor# Cursor → Settings → MCP → refresh
Prefer uv tool install over pip on Windows — clearer upgrades and fewer PATH collisions. Always pin --index-url https://pypi.org/simple on Windows. On Windows, shims usually live in %USERPROFILE%\.local\bin — run uv tool update-shell then open a new terminal.
What setup does
- Detects hardware (CUDA, DirectML for discrete AMD/NVIDIA, MLX on Apple Silicon, or CPU)
- Installs the correct ONNX Runtime + FastEmbed stack
- Downloads the CodeRank FP16 embedding model (~270 MB, cached)
- Calibrates embed batch size and saves
~/.scubiee/accel.json
After a broken / forced reinstall: always run scubiee setup --repair before init. First-time happy path can use plain scubiee setup; use --repair after upgrades or when deps look missing.
Verify
scubiee --versionscubiee setup --statusscubiee doctor .scubiee search "a symbol in your repo" .scubiee diagnose --no-tests --desktop
scubiee --version prints which Python runs Scubiee — prefer the uv tool path (…\uv\tools\scubiee\Scripts\python.exe on Windows). In the agent, call MCP status() once. Expect managed: true, ok: true after init + connect + reload.
Daily use
Once setup, init, and connect are done, these are the commands you use day to day.
Typical workflow
cd your-projectscubiee status . # index health + sync statescubiee sync . # after git pull / large editsscubiee search "AuthService" .
Keep the index fresh
| Command | When |
|---|---|
| scubiee sync . | After pulling changes or large local edits |
| scubiee sync . --confirm | When sync refuses with a >400 file count |
| scubiee rebuild . | Full re-index (slow; fixes corruption) |
| scubiee search "query" . | CLI search — query first, path second |
| scubiee search "query" . --local | In-process search, no HTTP daemon |
Multiple repos
scubiee listscubiee activate /path/to/reposcubiee pause /path/to/repo --reason "maintenance"scubiee remove /path/to/other --delete-store
Stop / resume (machine-wide)
scubiee stop # stop engine, free GPU / file locksscubiee resume # bring Scubiee back — NOT "wake"
Consent / auto modes
scubiee settings --showscubiee settings --mode automatic # IDE open → register + indexscubiee settings --mode mcp_cli # first MCP use asks consent
Prefs file: ~/.scubiee/prefs.json.
Engine & dashboard
scubiee engine status .scubiee engine ensure . --wait 45scubiee dashboard --statusscubiee dashboard --no-openscubiee resources
Engine logs: ~/.scubiee/engine.log, ~/.scubiee/watchdog.log. Dashboard port is dynamic — use --status for the URL.
Useful environment variables
| Variable | Effect |
|---|---|
| CTX_INCREMENTAL_MAX_TOUCH | File-count cap before --confirm (default 400) |
| CTX_FAST_ROOTS | Comma roots for --fast indexing |
| CTX_RM_DISABLE=1 | Disable RAM admission pauses |
| CTX_MLX=0 | Force non-MLX path on Mac |
Connect agents
Connect installs MCP configuration and agent rules so your coding tool uses Scubiee for retrieval instead of random greps. Prefer connect after every upgrade so rules and project pins stay current.
setup vs init vs connect
| Command | Writes |
|---|---|
| scubiee setup --repair | Machine GPU/CPU/MLX profile, model cache, optional supervisor paths |
| scubiee init . | Repo enrollment + index. Not MCP or agent rules |
| scubiee connect --cursor | Global ~/.cursor/mcp.json + rules AND project .cursor/mcp.json (absolute CTX_REPO) |
scubiee connect --cursorscubiee connect --claude-codescubiee connect --codexscubiee connect --cursor --dry-runscubiee connect --all --dry-runscubiee disconnect --cursor
Cursor workspace pin (critical)
Cursor does not expand ${workspaceFolder} in global ~/.cursor/mcp.json. A literal token makes MCP resolve to your home folder → managed: false.
- Always run
scubiee connect --cursorfrom the project you want managed. - That writes project
.cursor/mcp.jsonwith an absoluteCTX_REPOpin. - Global MCP entry should not use unexpanded workspace tokens for
CTX_REPO. - After connect: Cursor → Settings → MCP → refresh (or restart Cursor) until the
scubieeserver shows green. - On Windows, MCP should run via the uv tool shim (
%APPDATA%\uv\tools\scubiee\Scripts\…), not a random conda Python.
Multiple repos in one Cursor app
One MCP process is shared across chats. A pin must not make an unindexed sidebar repo look managed.
- On
status()(and later locate tools), passroot= that chat’s Workspace Path. - Managed is true only if that folder (walking up) has
.scubiee/id.jsonand is in the registry. - Other chats:
managed: falseafter onestatus()— use native tools; do not keep calling Scubiee. - After a successful
status(), you may passproject_id(ce_…) instead of the full path.
Special-4 (per-repo connect)
These hosts do not resolve the open folder from user-global MCP alone. Run connect inside each project:
| Tool | Command | Typical local file |
|---|---|---|
| Kiro | scubiee connect --kiro | .kiro/settings/mcp.json |
| GitHub Copilot / VS Code | scubiee connect --copilot | .vscode/mcp.json |
| Cline | scubiee connect --cline | .cline/mcp.json |
| Roo Code | scubiee connect --roo-code | .roo/mcp.json |
All supported tools (13)
- Cursor--cursor
- Claude Code--claude-code
- Codex--codex
- Kiro--kiroper-repo
- Windsurf--windsurf
- GitHub Copilot--copilotper-repo
- Cline--clineper-repo
- Roo Code--roo-codeper-repo
- Continue--continue
- Zed--zed
- OpenCode--opencode
- Amp--amp
- Pi--pi
Disconnect with scubiee disconnect --<flag>. MCP cannot start or wrong Python? Re-run connect for that tool, or setup --repair, then reload MCP.
Full integrations reference
| Tool | Flag | Notes |
|---|---|---|
| Cursor | --cursor | Global MCP + project .cursor/mcp.json pin |
| Claude Code | --claude-code | User-global MCP |
| Codex | --codex | — |
| Kiro | --kiro | Run connect inside each repo (Special-4) |
| GitHub Copilot | --copilot | Workspace .vscode/mcp.json (Special-4) |
| Cline | --cline | Workspace-local MCP (Special-4) |
| Roo Code | --roo-code | Workspace-local MCP (Special-4) |
| Continue | --continue | — |
| Zed | --zed | — |
| OpenCode | --opencode | — |
| Amp | --amp | — |
| Pi | --pi | — |
| Windsurf | --windsurf | — |
| Devin Desktop | --devin-desktop | — |
Connect commands
| Command | What it does |
|---|---|
| scubiee connect --<tool> | Install MCP config + AI rules for a tool |
| scubiee connect --all | Connect all supported tools |
| scubiee connect --all --dry-run | Preview what would be written |
| scubiee disconnect --<tool> | Remove MCP config + rules |
| scubiee disconnect --all | Disconnect all tools |
Agent rule behavior
connect installs rules that: (1) call status() once at session start; (2) if managed + ok → use Scubiee tools; (3) if warming → use tools, do not poll status() every turn; (4) if unmanaged → native tools; retry status() only after user runs init/connect. Paused/stopped → user runs scubiee resume.
MCP tools
Agents should call status() once at session start — not every turn. The MCP server key in mcp.json is scubiee. It talks to the local daemon (default http://127.0.0.1:8765).
What the agent rule expects
- Call
status()once at session start (passroot= workspace path when several repos share one MCP) - If
managed+ok→ use Scubiee tools for discovery (map / grep / focus), not native Grep / find by default - If
warming→ use tools; wait ~5s and retry the tool once; do not busy-loop onstatus() - If unmanaged → native tools; retry
status()only after you run init/connect - If paused/stopped → run
scubiee resume(not wake)
| status() field | Meaning |
|---|---|
| managed: true | This workspace is enrolled (after init) |
| ok: true | Daemon healthy — use Scubiee tools |
| warming: true | Managed but not ready — use tools; retry tool once; do not poll status() |
| managed: false | Use native tools for now; retry status() after init/connect |
| should_retry_status: true | User likely just ran init/connect — call status() once more |
Tool catalog (phase surface)
| Tool | Purpose | Typical args |
|---|---|---|
| status | Health + managed flag | root= or project_id= |
| gate | Tiny is-this-repo-ready check | automatic at chat start |
| map | Ranked overview of relevant chunks/symbols | query + root/project_id |
| focus | Deepen context around a hit | handle / span from map |
| grep | Exact / regex search of indexed content | pattern, optional glob= |
| glob | Find files by path pattern | pattern + root/project_id |
| workspace | Session / workspace context | root/project_id |
| expand | Re-open a previous code span | follow-up without re-searching |
| register_project | Explicit consent registration | path when prompted |
Recommended agent flow
1. status(root=<workspace path>) # once2. map(query="auth middleware") # find areas3. focus(...) # deepen a hit4. grep(pattern="AuthService") # exact text if needed5. Read/Edit only the lines you need
- Empty
grep/globwithtruncated: falsemeans no match in indexed scope — not “file missing on disk.” - After mid-session
init, ask the agent to callstatus()once again. - Stale results after large edits: run
scubiee sync .(or wait for background refresh), then search again. - Tip: put a unique string in a
.pyfile in scope, sync, then search to verify the index. - If the agent ignores MCP forever: MCP green? →
scubiee connect --cursor(refreshes rules) → reload MCP → ask it to callstatus()once.
What connect writes for the agent
connect / setup install a Cursor rule at ~/.cursor/rules/scubiee.mdc that encodes the status → managed → Scubiee tools policy above. Re-run connect after upgrades so the rule matches the installed CLI.
Windows
Most Windows failures are file locks from Cursor MCP / the daemon holding %APPDATA%\uv\tools\scubiee — not ACL permissions. Admin PowerShell does not help. Reboot only works because it kills the locker — use unlock-tool instead.
Access denied on upgrade / reinstall
Symptom: uv tool install --force cannot overwrite Scripts; later No module named 'pipeline'.
scubiee unlock-tooluv tool install --force scubiee --index-url https://pypi.org/simple --refreshscubiee setup --repairscubiee connect --cursor
unlock-tool turns MCP off (so Cursor cannot respawn), stops lockers, and frees the tool directory. Prefer scubiee upgrade when the CLI still works — it unlocks before swapping the package.
CLI already broken
If scubiee itself cannot start, use the repair scripts from the repo (or download them), then reinstall:
powershell -ExecutionPolicy Bypass -File scripts/uninstall-uv-scubiee.ps1# or:powershell -ExecutionPolicy Bypass -File scripts/repair-uv-scubiee.ps1uv tool install --force scubiee --index-url https://pypi.org/simple --refreshscubiee setup --repair
Do not lead with reboot or raw Remove-Item while Cursor is open — partial deletes leave No module named 'pipeline'.
Important paths
| Path | Role |
|---|---|
| %APPDATA%\uv\tools\scubiee\ | Tool virtualenv |
| …\Scripts\python.exe | Python used by MCP |
| …\Scripts\scubiee.exe | CLI entry |
| %USERPROFILE%\.local\bin\scubiee.exe | uv shim on PATH |
| %USERPROFILE%\.scubiee\ | Indexes, registry, accel |
GPU & platforms
Embedding model: nomic-ai/CodeRankEmbed (~270 MB FP16 on GPU, ~132 MB INT8 on CPU). Requirements: Python 3.10+, ~500 MB–1 GB disk. Network only for install + model download. HuggingFace is only needed once — MCP works offline after.
| Hardware | Profile |
|---|---|
| Windows discrete NVIDIA / AMD GPU | dml (DirectML) |
| Intel UHD / Iris / Arc iGPU only | cpu |
| AMD laptop “Radeon Graphics” APU (no discrete) | cpu |
| Linux NVIDIA | cuda |
| Apple Silicon | mlx |
| Intel Mac | coreml or cpu |
| No GPU | cpu |
Current Scubiee ignores Intel iGPU / AMD APU for DirectML so setup does not hang. Apple Silicon should show mlx after repair — not stay on CPU.
scubiee setup --statusscubiee setup --profile cpu --repair # force CPUscubiee setup --profile dml --repair # discrete AMD escape hatchscubiee setup --profile mlx --repair # Apple Siliconscubiee setup --profile cuda --repair # Linux NVIDIA
Provider profiles
Embedding model: nomic-ai/CodeRankEmbed (FP16 on GPU paths). Setup auto-detects the best profile; force one only when auto-detection is wrong.
| Profile | When to use |
|---|---|
| dml | Windows discrete AMD/NVIDIA GPU |
| cpu | Windows Intel iGPU / AMD APU / no discrete GPU; any CPU fallback |
| cuda | Linux NVIDIA |
| mlx | Apple Silicon (default — should not stay on CPU) |
| coreml | Intel Mac when viable |
Model files by profile
| Profile | Model file | Size |
|---|---|---|
| dml / cuda / mlx / coreml | model_fp16.onnx | ~260 MB |
| cpu | model_int8.onnx | ~132 MB (quantized from FP16) |
CPU profiles use a dual thread budget: 35% of cores for bootstrap/full reindex, 15% for background sync — so indexing stays invisible during active coding.
Indexing & lifecycle
Always cd into the project root before init. Scubiee uses the current directory as the root — do not run bare init from your home folder. Indexes stay on your machine under ~/.scubiee (never leave the device except the one-time embedding model download during setup).
Where data lives
| Path | Role |
|---|---|
| <repo>/.scubiee/id.json | Binds this folder to a project_id (often gitignored) |
| <repo>/.cursor/mcp.json | Cursor project MCP pin (absolute CTX_REPO) |
| ~/.scubiee/registry.json | All managed roots + lifecycle state |
| ~/.scubiee/projects/<id>/ | Index store (chunks, graph, vectors) |
| ~/.scubiee/accel.json | GPU/CPU/MLX profile + calibrated batch size |
| ~/.scubiee/engine.log | Engine / daemon logs (also watchdog.log) |
| ~/.cursor/mcp.json | Cursor global MCP entry for scubiee |
| ~/.cursor/rules/scubiee.mdc | Cursor agent rule from connect / setup |
| %APPDATA%\uv\tools\scubiee\ | Windows: uv tool env (CLI + MCP Python) |
MCP key is scubiee. Fresh installs do not use or migrate .context-engine. Daemon HTTP is localhost-only; MCP is stdio to your IDE.
Init flags
cd your-reposcubiee init .scubiee init . --fast # .py under common rootsscubiee init . --fast --roots packages,src # large monoreposcubiee init . --confirm # when >400 filesscubiee init . --no-index # register onlyscubiee sync . # after git pull / editsscubiee search "query" .scubiee list
Fast mode indexes only .py under common roots (packages, src, lib, app, …) or your --roots list. Use it for a first pass on large monorepos. Default full index still skips vendor, node_modules, .git, etc.
Refusing to index home / drive root
Cause: Safety — Scubiee will not silently index C:\\Users\\you, /Users/you, C:\\, or /
cdinto your project, thenscubiee init .. Only use--confirmon a broad path if you truly mean it.>400 files need indexing
Cause: Safety gate on large first index / sync
Re-run with
--confirm, or scope with--fast --roots …. Power users can raise the cap withCTX_INCREMENTAL_MAX_TOUCH.never_index error
Cause: Path was blocked with scubiee never-index
Clear via dashboard forget / lifecycle remove. Block intentionally with
scubiee never-index . --reason "…".project_id_mismatch / stale home registration
Cause: Home folder was enrolled earlier by mistake
scubiee listscubiee remove C:\Users\YOUR_USER --delete-store# delete leftover id.json under home if presentSearch misses fresh edits
Run
scubiee sync .. Test with a unique token in a.pyfile that is in scope, then search for that token.
Repo lifecycle
Wipe removes Scubiee's index and config, not your Git working tree.
| Intent | Command | Deletes index? | Deletes source? |
|---|---|---|---|
| Pause background work | scubiee pause . | No | No |
| Resume paused repo | scubiee activate . | No | No |
| Stop everything | scubiee stop / resume | No | No |
| Unmanage + delete data | scubiee wipe . --confirm | Yes | No |
| Registry removal | scubiee remove . [--delete-store] | Optional | No |
| Full machine wipe | scubiee wipe --all --confirm | Yes (all) | No |
scubiee resume is machine-wide. scubiee activate . unpause a single repo. There is no wake command.
Troubleshooting
When anything fails, run this triage order before guessing. Share Desktop/scubiee-diagnose.json when opening an issue.
scubiee --versionscubiee setup --statusscubiee preflight .scubiee doctor .scubiee listscubiee diagnose --no-tests --desktop
If semantic preflight fails: scubiee setup --repair, then retry. If the daemon is cold: scubiee engine ensure . --wait 45.
Commands that matter for install health
| Command | When |
|---|---|
| unlock-tool | Windows Access denied / free uv tool locks |
| upgrade | Upgrade with unlock/stop path |
| setup --repair | After broken reinstall or missing FastEmbed |
| stop / resume | Pause globally / continue (not wake) |
| connect --… | After install, upgrade, or unmanaged agent |
| engine ensure . --wait 45 | Daemon not warm |
| wipe --all --confirm --package | Nuclear uninstall |
Then match your symptom below.
Windows install & upgrade
Access denied on uv tool install --force (os error 5)
Cause: Cursor (or another IDE) keeps scubiee-mcp alive — locks python.exe and DLLs under %APPDATA%\uv\tools\scubiee\. Not fixed by Admin PowerShell or reboot alone.
scubiee unlock-tooluv tool install --force scubiee==0.3.14 --index-url https://pypi.org/simple --refreshscubiee setup --repairscubiee connect --cursor# Reload MCP in IDEVerify:
scubiee --version,python -c "import pipeline; print('ok')",scubiee doctor .. Do not delete Scripts manually while Cursor is open — partial delete makes breakage worse. Conda pip install does not fix the uv tool CLI (two separate installs).No module named 'pipeline'
Cause: Interrupted uv tool install left half-deleted env: shim exists, package missing.
powershell -ExecutionPolicy Bypass -File scripts/repair-uv-scubiee.ps1 0.3.14scubiee setup --repairscubiee connect --cursor
Install sequence mistakes
Agent status() → managed: false
Cause: Never ran init and/or connect, or wrong folder
cdinto the project →scubiee init .→scubiee connect --cursor→ reload MCP → ask the agent to callstatus()once again. For Cursor, confirm project.cursor/mcp.jsonhas an absoluteCTX_REPO.Index exists but MCP missing
Cause: Ran init only
Run
scubiee connect --…then reload MCP.Kiro / Copilot / Cline / Roo MCP empty
Cause: Connected only globally
cdinto that project →scubiee connect --kiro(or --copilot / --cline / --roo-code).Agent polls status() every turn
Cause: Old rule template
Re-run
scubiee connectto refresh rules.Hint says scubiee wake
Cause: Old build / old rule
Use
scubiee resume. There is no wake command. Upgrade + reconnect.
machine_not_setup on init
Symptom: {"ok": false, "error": "machine_not_setup"} — no saved profile in ~/.scubiee/accel.json.
scubiee setup --repairscubiee setup --statusscubiee init .
Diagnose looks healthy but init still fails
After a broken reinstall: acceleration.profile looks fine but fastembed / onnxruntime are null. Stale accel.json while packages were wiped.
scubiee setup --repairscubiee diagnose --no-tests --desktopscubiee init .
Setup & dependencies
No module named 'fastembed' / missing onnxruntime / not_configured
scubiee setup --repairscubiee preflight .Stuck on DirectML with only Intel UHD / AMD APU
Expected profile is
cpu. Force withscubiee setup --profile cpu --repair.Apple Silicon stuck on cpu
Not expected. Run
scubiee setup --repairorscubiee setup --profile mlx --repair.onnxruntime has no attribute SessionOptions
Cause: Conflicting / partial ORT install
Quit Cursor,
scubiee stop, remove leftover onnxruntime under the uv tool site-packages, thenscubiee setup --repair.faiss cannot import name 'class_wrappers'
Cause: Incomplete faiss-cpu extract (Windows uv)
Run
scripts/repair-uv-scubiee.ps1thensetup --repair.failed to locate pyvenv.cfg
Cause: Broken uv tool directory
Quit Cursor → uninstall/repair script → reinstall →
setup --repair.Two Pythons on PATH (pip ≠ scubiee)
Read
scubiee --version— use that Python’s pip/uv, not conda’s. Prefer the uv tool…\uv\tools\scubiee\Scripts\python.exe.
Enrollment & indexing
Refusing to index home directory
Cause: Safety gate — prevents indexing entire $HOME or drive root by accident
cd /path/to/your/project→scubiee init .confirm_required / >400 files
Cause: Safety — large index needs explicit consent
scubiee init . --confirmor narrow scope:scubiee init . --fast --roots packages,srcproject_id_mismatch
Cause: Folder has id.json for project A but registry thinks it should be B (copy/paste repo, partial wipe)
scubiee listscubiee wipe . --confirmscubiee init .Search misses fresh edits
Cause: Index stale — sync not run; or file outside index scope (fast mode non-.py)
scubiee sync .— test with a unique string in an indexed.py, thenscubiee search "UNIQUE_TOKEN" .
MCP, agent status, pause
MCP red / not connecting
scubiee engine ensure . --wait 45scubiee connect --cursor# reload MCP in the IDEscubiee stop # then retry if zombies remainstatus(): warming: true, ok: false
Cause: Daemon starting or temporarily down
Use MCP tools (they may return warming once). Wait ~5s and retry the tool once. Do not call
status()every turn. When healthy:managed: true,ok: true,warming: false.Agent fell back to native Grep forever
Confirm MCP is green → re-run
scubiee connect --cursor(refreshes rules) → after mid-sessioninit, ask the agent to callstatus()once again.Paused / stopped
Global stop:
scubiee resume. Per-repo pause:scubiee activate .(notresume .).Engine not warm
scubiee engine ensure . --wait 45scubiee init . --no-indexCursor wrong repo / home folder managed
Cause: Global MCP had literal ${workspaceFolder} or missing project .cursor/mcp.json pin
cd correct-project→scubiee connect --cursor. Verify project.cursor/mcp.jsoncontains absoluteCTX_REPOpath.sync-now blocked while paused
Cause: Per-repo pause (0.3.13+) blocks sync-now
scubiee activate .scubiee sync-now .
Lifecycle, wipe & dashboard
Wipe refused — exit code 2
Cause: Confirm gate — intentional safety in scripts
Add
--confirmor answer TTY prompt. Non-TTY wipe without confirm always exits 2 by design.Full uninstall leftovers (Windows)
Cause: Cursor holds MCP file locks; audit lists remaining paths
scubiee stop# quit Cursorscubiee wipe --all --confirm --package# re-run if audit.remaining non-emptyscubiee unlock-toolDashboard failed to start
Cause: Historical Windows PID mismatch (fixed 0.3.13+); port/firewall issues
Upgrade to 0.3.14;
scubiee dashboard --no-open;scubiee dashboard --statusfor the URL.
Upgrade
scubiee upgrade# or manually:scubiee unlock-tool # Windows if Access denieduv tool install --force scubiee --index-url https://pypi.org/simple --refreshscubiee setup --repairscubiee connect --cursor # refresh MCP + rules after every bump
After every upgrade: setup --repair if FastEmbed/ORT look missing, then connect again.
Error codes reference
When JSON shows error or exit code is non-zero, match the code below. Full context: symptom → why → fix.
Setup & machine
| Error | Meaning | Fix |
|---|---|---|
| machine_not_setup | No accel.json / setup incomplete | scubiee setup --repair |
| not_configured | Preflight: embed stack missing | setup --repair |
Enrollment & path
| Error | Meaning | Fix |
|---|---|---|
| unmanaged | Repo not enrolled | scubiee init . |
| requires_initialize | Action needs prior init | scubiee init . |
| path_too_broad | Tried to index home/root | cd into project |
| inside_ce_home | Cannot init inside CTX_HOME | Use normal repo path |
| confirm_required | >400 files or wipe without confirm | Add --confirm |
| never_index | Path on block list | Clear never-index or pick other path |
| unknown_project | project_id not in registry | init or list to reconcile |
| project_id_mismatch | id.json ≠ registry | wipe --confirm + re-init |
| registry_conflict | Concurrent registry mutation | Retry; check daemon |
| path_missing | Registry path gone | remove or locate |
Lifecycle
| Error | Meaning | Fix |
|---|---|---|
| paused | Repo paused; sync-now blocked | scubiee activate . |
| confirmation_mismatch | Dashboard forget wrong id | Re-type exact ce_… |
| forget_not_allowed | Retention: repo still present | Wait or CLI wipe |
| store_delete_failed | Could not rm project store | Close locks; retry wipe |
MCP / engine status fields
| Field | Values | Meaning |
|---|---|---|
| managed | true / false | MCP: safe to use Scubiee tools |
| ok | true / false | Daemon healthy |
| warming | true / false | Starting — retry tool once, don't poll status |
| enrolled | bool | Repo in registry |
| state | active, paused, unmanaged… | Lifecycle state |
| should_use_mcp | bool | Agent guidance |
| next_action | string | CLI command user should run |
Doctor install identity (0.3.13+)
| Field | Good | Problem |
|---|---|---|
| binaries_match | true | Wrong scubiee binary invoked |
| multiple_installs | false | Extra scubiee on PATH — pick one install |
| expected_binary | Matches uv Scripts path | Use one install method only |
Diagnose JSON — what to check
| Section | If bad |
|---|---|
| acceleration.profile | setup --repair |
| libraries.fastembed / onnxruntime | setup --repair |
| capabilities.missing_required | install missing deps |
| install.multiple_installs | consolidate PATH to one scubiee |
| mcp.connected | connect --cursor + reload MCP |
FAQ
What is Scubiee?
A local code context engine that indexes your repositories and connects to AI coding tools via MCP — semantic search, graph-aware retrieval, and live re-indexing on your hardware.
Do I need to clone the GitHub repo?
No. Install from PyPI with uv tool install scubiee.
What Python version?
3.10 or newer.
What's MCP?
Model Context Protocol — a standard way for AI assistants to call external tools like semantic search. Scubiee registers as server name scubiee in mcp.json.
Which AI tools work?
Cursor, Claude Code, Copilot, Kiro, Cline, Roo Code, Continue, Zed, OpenCode, Amp, Pi, Windsurf, Devin Desktop, and more — see Connect agents.
Does init connect Cursor?
No. connect writes MCP + rules. init only enrolls/indexes the repo.
uv or pip?
Prefer uv tool install — isolated CLI, clearer upgrades on Windows.
Why setup --repair?
Safest after fresh install, upgrade, or broken reinstall. Installs missing FastEmbed/ORT extras and refreshes accel.json.
Where is the embedding model?
Downloaded during setup (~270 MB FP16 CodeRank). Cached under FastEmbed cache dirs (~/.cache/fastembed/ and related).
Does my code leave the machine?
No — indexing and search are local. Only the embedding model downloads during setup.
Does MCP work offline?
Yes after setup. HuggingFace is only needed once for the model download.
How do I remove a repo from Scubiee?
scubiee wipe . --confirm — deletes Scubiee data (index, .scubiee, repo MCP/rules), not your source files.
How do I uninstall completely?
scubiee stop → quit IDE → unlock-tool (Windows) → wipe --all --confirm --package. Re-run until audit.remaining is empty.
Why does Cursor say managed: false?
Run scubiee init . and scubiee connect --cursor from the project, then reload MCP.
How do I share diagnostics?
scubiee diagnose --no-tests --desktop → send Desktop/scubiee-diagnose.json.
Agent still uses native Grep?
Confirm MCP is green, re-run connect to refresh rules, then ask the agent to call status() once.
Access denied on Windows upgrade?
scubiee unlock-tool → reinstall → setup --repair. Not Admin/reboot.
No module named 'pipeline'?
Half-deleted uv tool env — unlock-tool or scripts/repair-uv-scubiee.ps1, then reinstall + setup --repair.
Windows laptop with only Intel UHD / AMD APU?
Use cpu profile (not DirectML). Discrete AMD/NVIDIA → dml. Verify with setup --status.
Apple Silicon stuck on CPU?
Default should be mlx (Metal). Run setup --profile mlx --repair.
status() shows warming?
Daemon is starting. Retry the MCP tool once after a few seconds — do not poll status() every turn.
What does --fast / --confirm do?
--fast indexes .py under common roots (or --roots). --confirm is required when >400 files would be touched.
CLI reference
Run scubiee <subcommand> --help for flags on your installed version.
Setup & indexing
scubiee setupscubiee setup --repairscubiee setup --statusscubiee setup --profile cpu --repairscubiee init <path>scubiee init . --fast --roots packages,srcscubiee init . --confirmscubiee init . --no-indexscubiee search "query" <path>scubiee sync <path>scubiee sync . --confirmscubiee rebuild .scubiee status <path>scubiee list
Connect & lifecycle
scubiee connect --cursorscubiee connect --all --dry-runscubiee disconnect --cursorscubiee stopscubiee resumescubiee pause .scubiee activate .scubiee upgradescubiee unlock-toolscubiee remove <path> --delete-storescubiee never-index . --reason "…"
Diagnostics & engine
scubiee doctor <path>scubiee doctor . --fixscubiee doctor --allscubiee preflight .scubiee preflight . --lexical-onlyscubiee diagnose --no-tests --desktopscubiee engine ensure . --wait 45scubiee engine status .scubiee dashboard --statusscubiee resourcesscubiee migrate --check-all
Mental model — three programs, four layers
Scubiee is local software — not a cloud API and not an IDE extension. Three processes share one Python package (pipeline module from uv tool or pip):
scubiee CLI (you run) · scubiee-mcp (IDE runs) · Scubiee engine (daemon)
↓ all use ~/.scubiee + <repo>/.scubiee
| Layer | Question | Command | On-disk proof |
|---|---|---|---|
| 1. Install | Is scubiee on PATH? | uv tool install scubiee | scubiee --version works |
| 2. Machine setup | GPU/CPU + model ready? | scubiee setup --repair | ~/.scubiee/accel.json |
| 3. Repo enrollment | Is this folder indexed? | scubiee init . | <repo>/.scubiee/id.json |
| 4. IDE wiring | Does agent call MCP? | scubiee connect --cursor | ~/.cursor/mcp.json + rules |
init = layer 3 only. Without connect (layer 4), agents show managed: false. connect without setup + init leaves MCP with nothing to search.
Recommended workflows
First-time install
uv tool install --force scubiee==0.3.14 --index-url https://pypi.org/simple --refreshscubiee setup --repaircd /path/to/your/reposcubiee init .scubiee connect --cursor# Reload MCP in IDEscubiee doctor .scubiee status .
Daily development
Usually nothing — daemon and background sync keep indexes fresh. When needed:
scubiee sync . # after git pull or large editsscubiee status . # freshness / chunk countsscubiee search "auth middleware" .
After every upgrade
scubiee upgradescubiee setup --repair # if doctor shows missing ORT/fastembedscubiee connect --cursor # refresh MCP env + rules# Reload MCPscubiee doctor .
CI / automation
scubiee preflight . || exit 1scubiee init /repo --confirm --fast --roots packages,srcscubiee certify /repo --skip-daemonscubiee test quick /repo
Exit codes & JSON output
| Code | Meaning | What to do |
|---|---|---|
| 0 | Success | — |
| 1 | Hard failure | Read JSON error / stderr; run doctor |
| 2 | Confirm required | Re-run with --confirm or answer TTY prompt |
Piped/non-TTY commands emit JSON on stdout. Use scubiee status --json to force JSON on a terminal. Common fields: ok, error, hint, needs_confirm, deferred.
Safety gates (--confirm)
Scubiee refuses to silently index home, drive root, or trees with >25,000 indexable files (counts indexable files with skip rules — not raw disk count). Commands: init, sync, sync-now, register. Narrow scope with init . --fast --roots packages,src.
Command categories
| Category | Commands | Layer / purpose |
|---|---|---|
| Install & machine | setup, preflight, resources | Layer 2 — GPU, model, accel.json |
| Project lifecycle | init, register, initialize, remove, list, activate, pause | Layer 3 — enrollment |
| Index & search | search, sync, sync-now, rebuild, status | Index freshness + CLI search |
| Connect | connect, disconnect | Layer 4 — MCP + rules |
| Engine | engine start|stop|ensure|status, serve, dashboard | Daemon control |
| Global control | stop, resume, halt, unlock-tool | Machine-wide pause / Windows locks |
| Diagnostics | doctor, diagnose, certify, test | Readiness + support bundle |
| Upgrade | upgrade, migrate | Package swap + schema migration |
| Cleanup | wipe, never-index | Repo or machine removal |
| Settings | settings --show, settings --mode | Consent / automatic vs mcp_cli |
Global stop vs per-repo pause
| stop / resume | pause / activate | |
|---|---|---|
| Scope | Entire machine | One repo |
| Engine | Stopped | May still run |
| MCP globally | Torn down / blocked | Still connected |
| Data | Kept | Kept |
| Use when | Upgrade, uninstall prep | Maintenance on one repo |
Common mistake: per-repo pause but agent says run resume — that is global. Per-repo needs activate .. connect and setup --repair auto-resume if globally stopped.
Full command index
setup · init · register · initialize · connect · disconnect
search · sync · sync-now · rebuild · status · list
pause · activate · remove · never-index · wipe
stop · resume · halt · unlock-tool · upgrade · migrate
doctor · preflight · diagnose · certify · test · resources
engine · serve · dashboard · settings · mcp
Environment variables
Connect writes most MCP env vars into IDE config — you rarely set them manually.
| Variable | Set by | Purpose |
|---|---|---|
| CTX_HOME | You (optional) | Override ~/.scubiee data directory |
| CTX_REPO | mcp, setup, connect MCP entry | Default repo for engine/MCP |
| CTX_ENGINE_URL | setup, MCP config | Daemon URL (default http://127.0.0.1:8765) |
| CTX_TOKEN_MODE | MCP config | Token budget mode (savings) |
| CTX_BACKGROUND_SYNC | MCP config | Enable background sync from MCP |
| CTX_REGISTRATION_MODE | MCP config / settings | automatic or mcp_cli |
| CTX_MCP_SURFACE | MCP config | Tool surface (phase) |
| CTX_FAST_ROOTS | You (optional) | Default fast-index roots |
| CTX_WATCHDOG | You | 0 disables watchdog restarts |
| CTX_RM_DISABLE | You | 1 disables RAM-pressure throttling |
Command relationships
Enrollment: init vs register vs initialize
| Command | Audience | UX |
|---|---|---|
| init | Humans, first time | Progress bar, prompts, repeat-init handling |
| register | MCP parity / scripts | Thin registration API |
| initialize | Internal/advanced | Same core as init without UX |
Indexing: index vs sync vs sync-now vs rebuild
| Command | Scope | Incremental? |
|---|---|---|
| index | Full pipeline + register | No (full walk) |
| sync | Changed files only | Yes |
| sync-now | Lifecycle freshness pass | Daemon-oriented |
| rebuild | Force full re-index | No |
Rule: daily edits → sync. Corruption / model change → rebuild. First time → init.
Cleanup: remove vs wipe
| remove | wipe --confirm | |
|---|---|---|
| Registry | Yes | Yes |
| Index store | Optional (--delete-store) | Always |
| VectorDB | No | Yes |
| .scubiee/ in repo | No | Yes |
| Repo MCP/rules | No | Yes |
| Confirmation | No | Yes |
Lifecycle decision matrix
| Goal | Command | Notes |
|---|---|---|
| First-time machine setup | scubiee setup | Once per machine |
| Enroll + index a repo | scubiee init . | Then connect |
| Wire Cursor/IDE | scubiee connect --cursor | Reload MCP |
| Pause indexing one repo | scubiee pause . | MCP stays |
| Resume one repo | scubiee activate . | Not resume |
| Stop everything (MCP off) | scubiee stop | Then resume |
| Unmanage repo fully | scubiee wipe . --confirm | Index + .scubiee + rules |
| Fix broken deps | scubiee setup --repair | |
| Upgrade version | scubiee upgrade | Then connect + doctor |
| Windows file lock | scubiee unlock-tool | Then reinstall |
| Pre-wipe safe stop | scubiee halt | Cursor can stay open |
Commands allowed when globally stopped
| Allowed | Blocked (examples) |
|---|---|
| doctor, preflight, diagnose, gate, list, resume, stop, halt, unlock-tool, wipe, connect, disconnect, upgrade, engine status | init, index, search, sync, engine start, engine ensure, setup (except --repair) |
connect and setup --repair auto-resume if globally stopped. Help (-h / --help) always works.
Symptom → command FAQ
Install & setup
| Symptom | Why | Fix |
|---|---|---|
| scubiee: command not found | Layer 1 missing | uv tool install scubiee |
| machine_not_setup on init | Layer 2 missing | scubiee setup --repair |
| Doctor multiple_installs: true | conda + uv on PATH | Keep uv tool only |
| Setup hangs on Windows | iGPU + DML | setup --profile cpu --repair |
| not_configured in preflight | Embed stack incomplete | setup --repair |
IDE / MCP / index
| Symptom | Why | Fix |
|---|---|---|
| managed: false | Layer 3 or 4 missing | init . then connect --cursor, reload MCP |
| MCP red in Cursor | Daemon down or bad JSON | engine ensure ., doctor ., fix JSON |
| Kiro/Copilot/Cline/Roo broken | Special-4 needs per-repo connect | connect inside each project |
| warming: true forever | Cold runtime or crash loop | engine ensure . --wait 45; check engine.log |
| Search misses new files | Index stale | scubiee sync . |
| sync-now blocked | Repo paused | scubiee activate . |
| Wipe exit 2 | No --confirm in script | Add --confirm |
| uv install Access denied | Cursor holds python.exe | unlock-tool, retry install |
Uninstall
Full machine cleanup when you want Scubiee gone. Indexing and search are local — your code never leaves the machine; wipe only deletes local state (and optionally the package). On Windows, free locks first — raw uv tool uninstall while MCP is running often fails with Access denied and can leave a half-deleted env (No module named 'pipeline').
What wipe removes
- Machine home
~/.scubiee(registry, indexes, accel, logs) - Per-repo
<repo>/.scubiee/markers - Cursor MCP + rules (
~/.cursor/mcp.json,~/.cursor/rules/scubiee.mdc, project pins) - With
--package: the uv/pipscubieeinstall - With
--keep-models: keep the CodeRank / FastEmbed download cache
Recommended (all platforms)
scubiee stop# quit Cursor / disable MCPscubiee unlock-tool # Windows — free uv tool locksscubiee wipe --all --confirm --package
Read JSON audit.remaining. Re-run until clean. Then reload Cursor so MCP picks up the new state. --yes is an alias of --confirm.
Wipe flags
| Flag | Meaning |
|---|---|
| --all --confirm | Delete all Scubiee state (indexes, registry, MCP, rules) |
| --package | Also uninstall the scubiee package |
| --keep-package | Wipe state but keep the CLI |
| --keep-models | Keep CodeRank / FastEmbed download cache |
Repo-only wipe
cd /path/to/reposcubiee wipe .# orscubiee remove . --delete-store
CLI already broken (Windows)
powershell -ExecutionPolicy Bypass -File scripts/uninstall-uv-scubiee.ps1# or repair + reinstall:powershell -ExecutionPolicy Bypass -File scripts/repair-uv-scubiee.ps1uv tool install --force scubiee --index-url https://pypi.org/simple --refreshscubiee setup --repair
Mac / Linux if CLI is gone
rm -rf ~/.scubiee# edit ~/.cursor/mcp.json — remove "scubiee" from mcpServersuv tool uninstall scubiee
Share diagnostics (not your code)
scubiee diagnose --no-tests --desktop# → Desktop/scubiee-diagnose.json (machine/profile health only)# optional: short tail of ~/.scubiee/engine.log
Architecture & internals
Scubiee 0.3.14 is a local repository-context service with three faces: a CLI for setup and lifecycle, a daemon/runtime that owns indexing and retrieval, and an MCP adapter your IDE talks to. The central contract: a coding tool may use Scubiee when the repo is managed and healthy; otherwise it falls back to native tools. Your code never leaves your machine for search — only the embedding model downloads once during setup (~270 MB FP16 or ~132 MB INT8 on CPU).
System diagram
Your AI IDE (Cursor / Copilot / Kiro / Claude Code / …)
↓ MCP stdio — server key: scubiee
scubiee-mcp — thin adapter; session + repo binding
↓ HTTP localhost (default :8765)
Scubiee Engine — daemon + watchdog
IndexManager · ResourceManager · RuntimeManager
↓
Vectors (FAISS/TurboQuant) + Graph/chunks + Merkle manifest
stored under ~/.scubiee/ and <repo>/.scubiee/
Repository lifecycle states
| State | Registry | Index | Agent should |
|---|---|---|---|
| Unmanaged | absent / not this path | absent or orphaned | Native tools; run init |
| Active | managed | present | Scubiee MCP tools |
| Paused | managed, paused flag | present | Native tools until activate |
| After wipe | removed | deleted | Native tools; re-init to return |
What connect writes
| Artifact | Purpose |
|---|---|
| User/global MCP config | Tells IDE how to spawn scubiee-mcp |
| Project MCP config (Cursor, Special-4) | Absolute CTX_REPO pin — Cursor won't expand ${workspaceFolder} in global MCP |
| Agent rules (.cursor/rules/scubiee.mdc) | Teaches: gate/status once, use map/focus when managed |
Machine setup — what it does
- Detects hardware — CUDA, DirectML, MLX, or CPU fallback
- Installs runtime wheels — FastEmbed, ONNX Runtime for profile
- Downloads CodeRankEmbed (~270 MB FP16) via HuggingFace/FastEmbed cache
- Calibrates embed throughput → batch size in accel.json
- Does not scan repos, write MCP, or index without init
Why setup --repair: upgrades and broken Windows reinstalls leave stale accel.json while ORT wheels were deleted. Repair re-runs detection and pip installs.
Init — what it does
- Validates path — refuses $HOME, C:\, / (safety)
- Assigns or reads project_id (ce_…) in id.json
- Updates registry.json
- Runs index pipeline: scan → parse → graph → chunk → embed → FAISS
- Starts or attaches daemon for this repo
Fast mode: only .py under standard roots or --roots. Confirm gate: >400 indexable files. One project id can map to multiple checkout paths (worktrees).
Search stages (MCP phase surface)
| Stage | Tool | Returns |
|---|---|---|
| Overview | map(query) | Ranked cards — paths, symbols — no bodies |
| Depth | focus(target, mode=…) | Outline, span, neighbors, call_sites |
| Literal | grep(pattern) | Line matches in indexed files |
| Paths | glob(pattern) | Indexed file paths matching pattern |
| Session | workspace(show|pin|clear) | What agent already explored |
grep/glob search the index, not every file on disk if never indexed. Why search misses new code: file out of scope, sync not run, or wrong repo in multi-root Cursor.
Upgrades (0.3.14+)
scubiee upgrade: unlocks Windows locks → stops processes → swaps package → runs migration plan → restarts daemon. Always follow with setup --repair if diagnose shows missing libs, and connect to refresh MCP/rules.
Features in depth
Semantic code search
Search by meaning, not exact text: “session validation middleware” finds relevant handlers even without those exact words. Powered by CodeRankEmbed + FAISS. CLI: scubiee search "query" . MCP: map(query) for overview, focus(target) for code bodies.
Graph-aware retrieval
Understands imports, callers, callees, and file structure — not isolated text blobs. focus(mode=neighbors) and focus(mode=call_sites) expose relationships. Helps agents follow real code flow instead of random adjacent files.
Live incremental indexing
Merkle sync detects changed files efficiently. scubiee sync . or background daemon refresh after edits and git pull. Reduces “the AI is reading stale code” failures.
Hybrid retrieval
Combines dense vectors, lexical BM25 match, and graph signals. Exact literals still available via MCP grep and CLI search modes. Not similarity-only RAG.
Multi-tool MCP connectivity
One product wires many AI tools via scubiee connect --<tool>. Clean removal via disconnect. Agent rules teach when to use Scubiee vs native tools.
GPU-aware acceleration
Picks best backend per machine automatically. Windows discrete GPU → DirectML. Windows CPU-only / iGPU → CPU (avoids DML hang). Apple Silicon → MLX Metal. Linux NVIDIA → CUDA.
Multi-repository support
scubiee init per repo; registry tracks many projects. Project id (ce_…) stable across moves when identity file travels with repo. Dashboard lists repos; pause/activate per repo.
Operator dashboard
scubiee dashboard — local web UI for repo list, pause/activate, hardware status. Complements CLI; not required for daily use.
Diagnostics & self-healing
scubiee doctor — readiness + install identity (duplicate PATH binaries on Windows). scubiee diagnose --desktop — shareable JSON for support. scubiee setup --repair — fix broken ORT/FastEmbed. scubiee unlock-tool — Windows file-lock recovery.
Safe lifecycle & wipe
Repo wipe requires confirmation (scubiee wipe . --confirm). Removes enrollment, index, VectorDB, .scubiee, repo MCP/rules — not your source code. Full machine wipe with audit of leftover paths.
Global stop / resume
scubiee stop — machine-wide pause of engine + MCP surfaces (e.g. before upgrade). scubiee resume — bring Scubiee back. There is no wake command.
One-command upgrade
scubiee upgrade — stop processes, swap package, migrate data, restart. Critical on Windows where file locks cause Access denied during naive pip upgrade.
Full index sequence
repository admission → capability/provider validation → Merkle scan and diff baseline → Graphify parsing and RepoIR → graph construction → symbol/file chunk generation → metadata enrichment and compression → CodeRankEmbed embeddings → FAISS/TurboQuant vector write → chunks + Merkle + metadata + manifest publication
Each phase has a different failure boundary. Admission and capability checks happen before expensive work. Embedding is performed only after the chunk set is known. Artifacts are published as a coherent index generation.
Retrieval path
query → capability/search readiness → BM25 lexical candidates → dense FAISS candidates → Graphify structural affinity → RRF or min-rank fusion → graph/context expansion → final hits
WarmSearchEngine is the readiness boundary. A cold dense index surfaces through status/ capability info instead of being mistaken for healthy semantic search.
Product identity
| Item | Value |
|---|---|
| Product name | Scubiee |
| PyPI / CLI package | scubiee |
| MCP server key in mcp.json | scubiee |
| User data directory | ~/.scubiee |
| Per-repo marker | <repo>/.scubiee/id.json |
| Embedding model | nomic-ai/CodeRankEmbed |
| Version | 0.3.14 |
| Legacy names | Do not use context-engine in user-facing copy |
Engineering components
| Area | Primary modules | Responsibility |
|---|---|---|
| CLI | __main__.py | setup, lifecycle, search, daemon, connect, wipe |
| Hardware setup | accel.py, embedder.py, preflight.py | Detect capabilities, CodeRankEmbed, ORT profiles |
| Registration | repo_lifecycle.py, settings.py | Enrollment, consent, pause/resume, sync, rebuild, removal |
| Project identity | project_id.py, git_family.py | Stable ce_… ID across moves and worktrees |
| Full indexing | indexer.py | Admission, Merkle, Graphify, embed, vector persistence |
| Incremental | incremental.py, sync_loop.py | Dirty files, republish generation, escalate to full rebuild |
| Retrieval | ce_service.py | Lexical + dense + graph fusion and expansion |
| Runtime | daemon.py, server.py, lifecycle_runtime.py | HTTP serving, idle/standby, autostart |
| Watchdog | watchdog.py | Monitor runtime, wake/restart on crash |
| MCP surface | mcp_locate.py | Surface selection, managed gating, tool forwarding |
| MCP install | mcp_install.py, rules_installer.py | connect/disconnect, client-specific configs |
| Vector storage | vectordb.py | FAISS + TurboQuant under ~/.scubiee/vectordb/ |
MCP surfaces
Selected via CTX_MCP_SURFACE. Default is phase — optimized for map → focus → grep workflow.
| Surface | Tools |
|---|---|
| phase (default) | map, focus, grep, glob, workspace, status |
| read | search, read, status |
| nav | search, files, read, recall, expand, status |
| graph | search, neighbors, graph, status |
| rich | search, read, outline, status |
| search | search, status |
| grep | grep, status |
MCP tools — agent benefits
| Tool | Benefit | Example question |
|---|---|---|
| gate / status | Is this repo ready? | Can I use Scubiee in this workspace? |
| map | Ranked map of where to look | Where is OAuth handled? |
| focus | Actual code span/neighbors | Show the login handler and its callers |
| grep | Exact string/regex in indexed files | Find every API_KEY reference |
| glob | Files by path pattern | List all *test*.py under packages/ |
| workspace | Session memory — pins, heatmap | What did we already look at? |
| expand | Re-open a previous code span | Follow-up without re-searching |
| register_project | Enroll repo from chat with consent | Index this folder for me |
Global rule contract
call status() onceif managed == true and ok == true:use Scubiee discovery toolselse:ignore this Scubiee rule for the rest of the sessionuse native search/read tools
The rule does not authorize indexing or writes — only discovery routing. Enrollment and destructive lifecycle actions remain explicit CLI operations.
Model precision & CPU thread budget
| Profile | Model | Size / notes |
|---|---|---|
| dml / cuda / mlx / coreml | model_fp16.onnx | ~260 MB — GPUs have native FP16 |
| cpu | model_int8.onnx | ~132 MB — INT8 uses VNNI/AMX, 1.5× faster than FP16 on CPU |
CPU thread budget: bootstrap/full reindex uses 35% of cores (min 2); background incremental sync uses 15% (min 1). GPU profiles set threads=1 and offload to GPU.
Incremental sync environment defaults
| Variable | Default |
|---|---|
| CTX_LIVE_MAX_FILES | 200 |
| CTX_LIVE_MAX_CHUNKS | 300 |
| CTX_INCREMENTAL_MAX_TOUCH | 200 |
| CTX_AUTO_FULL_INDEX_CHUNKS | 10000 |
| CTX_BULK_REINDEX_THRESHOLD | 300 |
| CTX_CHANGE_POLL_MS | 1000 |
| CTX_SYNC_INTERVAL_MS | 300000 (5 min background) |
| CTX_WATCHDOG_INTERVAL_S | watchdog polling interval |
Failure modes
| Condition | Expected behavior | Operator response |
|---|---|---|
| Repo not managed | status reports unmanaged; rule says use native tools | scubiee init PATH |
| Daemon down | Search fails rather than crossing repo boundaries | scubiee engine ensure . --wait 45 |
| Missing provider/model | Preflight/setup/indexing fails closed | setup --repair or --profile cpu |
| Large change set | Live sync escalates to full rebuild | scubiee rebuild . |
| Duplicate/moved identity | Git-family reconciliation on init | Do not hand-edit IDs |
| Destructive cleanup | Wipe requires explicit --confirm | Review --dry-run first |
Identity & Git worktrees
A repository is identified by evidence from: in-repo .scubiee/id.json, trusted registry, per-project store, Git common directory/worktree family, and current path + Git metadata. A Git worktree may have a .git pointer file — the resolver uses Git common-directory evidence without rejecting worktrees. When a repo moves or has duplicate ID evidence, prefer scubiee init over manually editing IDs.
Operator runbook
# First installuv tool install --force scubiee==0.3.14 --index-url https://pypi.org/simple --refreshscubiee setup --repairscubiee preflightscubiee init . && scubiee connect --cursor# Health checkscubiee doctor . --allscubiee resources --refresh# Stale indexscubiee sync .scubiee sync-now .scubiee rebuild .# Repairscubiee setup --repairscubiee doctor --all --fixscubiee migrate . --check-all
Privacy, data & transparency
Privacy & security
- Code stays local — indexing, embedding, and search run on your machine. There is no Scubiee-hosted repository upload service.
- Model download only — HuggingFace/FastEmbed model fetch during setup (~270 MB FP16 or ~132 MB INT8 on CPU). After that, offline search works.
- You control deletion —
scubiee wiperemoves local indexes and metadata;wipe --all --confirmaudits leftovers honestly. - Open install — package on PyPI; inspectable CLI and local data under
~/.scubiee.
Honest footnotes
- Your AI tool (Cursor, Copilot, etc.) may still send code to its own model provider — that is separate from Scubiee.
- Scubiee writes MCP config and rule files into IDE config directories; those files contain paths, not your source code.
scubiee diagnoseoutput may include paths and versions for support — review before sharing.
Who Scubiee is for
| Audience | Why Scubiee |
|---|---|
| Individual developers | Better agent accuracy on personal and work repos without cloud upload |
| Private / air-gapped teams | Local-only indexing; no code transmission for search |
| Monorepo maintainers | Semantic + structural search across large trees |
| Power users | CLI search, dashboard, lifecycle control, honest wipe audit |
Not the primary audience: teams wanting hosted multi-user cloud search, single-file editors with no cross-repo discovery, or environments where Python 3.10+ and ~300 MB model cache is impossible.
Data & storage paths
| Path | What it holds |
|---|---|
| <repo>/.scubiee/id.json | Repository identity (project_id ce_…) |
| ~/.scubiee/prefs.json | User preferences and consent mode |
| ~/.scubiee/registry.json | Trusted managed-project registry |
| ~/.scubiee/accel.json | Saved GPU/CPU/MLX profile + calibrated batch size |
| ~/.scubiee/projects/<id>/ | Per-project index store — chunks, graph, Merkle, manifest |
| ~/.scubiee/vectordb/ | FAISS / TurboQuant vector root and catalog |
| ~/.scubiee/engine.log | Daemon log (optional for support) |
| ~/.scubiee/watchdog.log | Watchdog recovery log |
CTX_VECTORDB_ROOT can override the default vector root. Legacy .context-engine paths are not used. Override home with CTX_HOME (advanced/testing only).
~/.scubiee/ — full map
| Path | Purpose | Safe to delete? |
|---|---|---|
| registry.json | All enrolled repos, paths, pause state | Wipe recreates; loses enrollment |
| accel.json | GPU/CPU profile, batch size | setup --repair recreates |
| prefs.json | automatic vs mcp_cli mode | Recreated with defaults |
| projects/<project_id>/ | Index store — chunks, graph, FAISS | wipe or remove --delete-store |
| upgrade_history.json | Upgrade component versions | Upgrade may re-run steps |
| engine.log / watchdog.log | Daemon / watchdog logs | Yes (diagnostic only) |
| vectordb/ | VectorDB collections | Repo wipe drops collections |
Index store artifacts
Under projects/<project_id>/: meta.json, Merkle/manifest, chunk store, graph, FAISS vectors, lexical index. Size scales with indexed source. Deleting id.json but keeping registry may allow recovery on next init; deleting both creates new ce_… id → full re-index.
Install locations & MCP files
uv tool: Windows %APPDATA%\uv\tools\scubiee\, Unix ~/.local/share/uv/tools/scubiee/ — contains Scripts/python.exe MCP uses. MCP configs: Cursor global + project .cursor/mcp.json; Kiro/Copilot/Cline/Roo project-local files. Wipe repo removes project-local; wipe --all removes global MCP too.
Environment variables
| Variable | Effect |
|---|---|
| CTX_HOME | Override ~/.scubiee |
| CTX_ENGINE_URL | Daemon URL (default :8765) |
| CTX_REPO / CTX_PROJECT_ID | MCP repo binding |
| CTX_MCP_SURFACE | phase, nav, grep, … |
| CTX_RM_DISABLE | Disable RAM admission pauses |
| CTX_WATCHDOG | 0 disables watchdog |
| CTX_INCREMENTAL_MAX_TOUCH | File count gate (default 400) |
What delete/wipe removes
| Action | Index | .scubiee in repo | Source code | Global MCP |
|---|---|---|---|---|
| pause | keep | keep | keep | keep |
| wipe (repo) | delete | remove | keep | keep |
| wipe --all | all deleted | all repos | keep | remove |
Storage invariants
- Repository identity and registry state must agree for daemon routing.
- A denied or never-indexed repository must not receive an automatic index.
- Provider and capability checks must pass before embedding/publishing work.
- Retrieval must use a consistent published generation — not partial writes.
- Incremental changes must update Merkle, chunk, metadata, graph, and vector state together or escalate to a full rebuild.
- A daemon bound to one repository must not silently answer a request for another repository.
- Removing a repository store and wiping all machine data are explicit operations — not side effects of search or status.
Setup & indexing commands
| Command | What it does |
|---|---|
| scubiee setup --repair | Machine install: detect GPU/CPU/MLX, ORT/FastEmbed, model, calibration |
| scubiee setup --status | Print saved accel profile (read-only) |
| scubiee init <path> | Enroll a repository and index it (requires setup first) |
| scubiee init . --fast --roots packages | Fast index scoped to code roots |
| scubiee init . --confirm | Allow indexing when >400 files would be touched |
| scubiee status <path> | Show index health, freshness, and daemon state |
| scubiee search "query" <path> | Search your code from the CLI |
| scubiee sync <path> [--confirm] | Incremental re-index of changed files |
| scubiee rebuild <path> | Full re-index (slow; fixes corruption) |
| scubiee list | List all enrolled repositories |
| scubiee activate / pause <path> | Per-repo unpause / pause background indexing |
Diagnostics & lifecycle commands
| Command | What it does |
|---|---|
| scubiee diagnose --no-tests --desktop | Shareable diagnose JSON on Desktop |
| scubiee unlock-tool | Windows: free %APPDATA%\uv\tools\scubiee locks before reinstall |
| scubiee upgrade | Unlock/stop processes, upgrade package, restart, migrate |
| scubiee stop / scubiee resume | Stop engine / bring back (not wake) |
| scubiee doctor <path> [--fix] | Readiness report |
| scubiee preflight [path] | Dependency / capability check |
| scubiee engine status / ensure . --wait 45 | Daemon health and startup |
| scubiee dashboard | Local web UI for repo list and hardware status |
| scubiee resources | Hardware pressure and adaptive budgets |
| scubiee wipe --all --confirm --package | Full machine cleanup + uninstall |
| scubiee settings --show | Show consent / auto modes |
| scubiee migrate <path> --check-all | Check and apply data migrations |
CLI command tree
scubiee
├── setup [--repair] [--status] [--profile …]
├── init <path> [--fast] [--confirm] [--no-index]
├── connect / disconnect [--cursor|--kiro|…|--all]
├── stop / resume
├── unlock-tool / upgrade
├── search / sync / sync-now / status / rebuild
├── pause / activate <path>
├── diagnose [--desktop] / doctor / preflight
├── engine / dashboard / resources
├── wipe / remove / never-index
└── settings / migrate / list / serve / mcp
Issue cheatsheet
| Issue | Fix |
|---|---|
| Agent unmanaged | init + connect + reload MCP |
| Special-4 broken | connect --tool inside that repo |
| Access denied on Windows upgrade | unlock-tool → reinstall → setup --repair (not Admin/reboot) |
| No module named pipeline | unlock-tool / repair script → reinstall → setup --repair |
| Cursor unmanaged | connect --cursor from the project + reload MCP |
| Stale accel after reinstall | setup --repair before init |
| Said wake | Use resume |
| Warming forever | engine ensure . --wait 45 |
| machine_not_setup | scubiee setup --repair first |
Comparisons
vs native IDE search / agent grep
| Dimension | Native grep | Scubiee |
|---|---|---|
| Match type | Text | Semantic + graph + text |
| Cross-session memory | None | Workspace session + index |
| Stale after edits | Agent may not know | Incremental Merkle sync |
| Setup | Zero | init + connect once |
vs cloud code intelligence
| Dimension | Cloud index | Scubiee |
|---|---|---|
| Code location | Vendor servers | Your disk |
| Air-gapped | No | Yes (after model download) |
| Per-repo control | Vendor-defined | wipe/pause per repo |
vs build-your-own RAG
| Dimension | DIY | Scubiee |
|---|---|---|
| Time to value | Weeks | Minutes |
| MCP wiring | Custom | Built-in connect |
| Incremental sync | You build it | Merkle + daemon |
| GPU paths | You integrate ORT/CUDA/MLX | Auto profile |
Terminology & brand rules
| Use | Avoid |
|---|---|
| Scubiee | Scubie, SCUBIEE in prose |
| scubiee (CLI/MCP key) | context-engine, ctx in user docs |
| ~/.scubiee | .context-engine |
| init + connect | setup does everything |
| scubiee resume (machine-wide) | scubiee wake |
| scubiee activate (per-repo unpause) | scubiee resume for per-repo |
| Managed / unmanaged | indexed alone (ambiguous) |
Use-case stories
- Security-conscious team — approved because nothing leaves the laptop; model download was the only outbound call.
- Monorepo developer — map('billing webhook handler') pointed the agent at the right package first try.
- Windows laptop user — CPU profile avoided the DirectML hang on Intel graphics.
- Multi-IDE user — same index served Cursor and Copilot after connect in each workspace.
- Upgrade survivor — unlock-tool + setup --repair fixed Access denied without reinstalling Windows.
Support bundle
scubiee --versionscubiee setup --statusscubiee doctor .scubiee diagnose --no-tests --desktop# → Desktop/scubiee-diagnose.json (paths + versions, not source code)
Bots that cannot read this page? Fetch /docs.md (full markdown) or /llms.txt (index). Structured JSON: /docs.json.
Still stuck?
Collect scubiee --version, setup --status, doctor ., and diagnose --no-tests --desktop. Paste this docs page (or the Troubleshooting topic) plus Desktop/scubiee-diagnose.json into ChatGPT / Claude with a short description of the failing command — or open a GitHub issue with the same bundle. Optionally attach a tail of ~/.scubiee/engine.log.