$npx -y skills add SafeAI-Lab-X/ClawKeeper --skill oracleBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
| 1 | # oracle — best use |
| 2 | |
| 3 | Oracle bundles your prompt + selected files into one “one-shot” request so another model can answer with real repo context (API or browser automation). Treat output as advisory: verify against code + tests. |
| 4 | |
| 5 | ## Main use case (browser, GPT‑5.2 Pro) |
| 6 | |
| 7 | Default workflow here: `--engine browser` with GPT‑5.2 Pro in ChatGPT. This is the common “long think” path: ~10 minutes to ~1 hour is normal; expect a stored session you can reattach to. |
| 8 | |
| 9 | Recommended defaults: |
| 10 | |
| 11 | - Engine: browser (`--engine browser`) |
| 12 | - Model: GPT‑5.2 Pro (`--model gpt-5.2-pro` or `--model "5.2 Pro"`) |
| 13 | |
| 14 | ## Golden path |
| 15 | |
| 16 | 1. Pick a tight file set (fewest files that still contain the truth). |
| 17 | 2. Preview payload + token spend (`--dry-run` + `--files-report`). |
| 18 | 3. Use browser mode for the usual GPT‑5.2 Pro workflow; use API only when you explicitly want it. |
| 19 | 4. If the run detaches/timeouts: reattach to the stored session (don’t re-run). |
| 20 | |
| 21 | ## Commands (preferred) |
| 22 | |
| 23 | - Help: |
| 24 | - `oracle --help` |
| 25 | - If the binary isn’t installed: `npx -y @steipete/oracle --help` (avoid `pnpx` here; sqlite bindings). |
| 26 | |
| 27 | - Preview (no tokens): |
| 28 | - `oracle --dry-run summary -p "<task>" --file "src/**" --file "!**/*.test.*"` |
| 29 | - `oracle --dry-run full -p "<task>" --file "src/**"` |
| 30 | |
| 31 | - Token sanity: |
| 32 | - `oracle --dry-run summary --files-report -p "<task>" --file "src/**"` |
| 33 | |
| 34 | - Browser run (main path; long-running is normal): |
| 35 | - `oracle --engine browser --model gpt-5.2-pro -p "<task>" --file "src/**"` |
| 36 | |
| 37 | - Manual paste fallback: |
| 38 | - `oracle --render --copy -p "<task>" --file "src/**"` |
| 39 | - Note: `--copy` is a hidden alias for `--copy-markdown`. |
| 40 | |
| 41 | ## Attaching files (`--file`) |
| 42 | |
| 43 | `--file` accepts files, directories, and globs. You can pass it multiple times; entries can be comma-separated. |
| 44 | |
| 45 | - Include: |
| 46 | - `--file "src/**"` |
| 47 | - `--file src/index.ts` |
| 48 | - `--file docs --file README.md` |
| 49 | |
| 50 | - Exclude: |
| 51 | - `--file "src/**" --file "!src/**/*.test.ts" --file "!**/*.snap"` |
| 52 | |
| 53 | - Defaults (implementation behavior): |
| 54 | - Default-ignored dirs: `node_modules`, `dist`, `coverage`, `.git`, `.turbo`, `.next`, `build`, `tmp` (skipped unless explicitly passed as literal dirs/files). |
| 55 | - Honors `.gitignore` when expanding globs. |
| 56 | - Does not follow symlinks. |
| 57 | - Dotfiles filtered unless opted in via pattern (e.g. `--file ".github/**"`). |
| 58 | - Files > 1 MB rejected. |
| 59 | |
| 60 | ## Engines (API vs browser) |
| 61 | |
| 62 | - Auto-pick: `api` when `OPENAI_API_KEY` is set; otherwise `browser`. |
| 63 | - Browser supports GPT + Gemini only; use `--engine api` for Claude/Grok/Codex or multi-model runs. |
| 64 | - Browser attachments: |
| 65 | - `--browser-attachments auto|never|always` (auto pastes inline up to ~60k chars then uploads). |
| 66 | - Remote browser host: |
| 67 | - Host: `oracle serve --host 0.0.0.0 --port 9473 --token <secret>` |
| 68 | - Client: `oracle --engine browser --remote-host <host:port> --remote-token <secret> -p "<task>" --file "src/**"` |
| 69 | |
| 70 | ## Sessions + slugs |
| 71 | |
| 72 | - Stored under `~/.oracle/sessions` (override with `ORACLE_HOME_DIR`). |
| 73 | - Runs may detach or take a long time (browser + GPT‑5.2 Pro often does). If the CLI times out: don’t re-run; reattach. |
| 74 | - List: `oracle status --hours 72` |
| 75 | - Attach: `oracle session <id> --render` |
| 76 | - Use `--slug "<3-5 words>"` to keep session IDs readable. |
| 77 | - Duplicate prompt guard exists; use `--force` only when you truly want a fresh run. |
| 78 | |
| 79 | ## Prompt template (high signal) |
| 80 | |
| 81 | Oracle starts with **zero** project knowledge. Assume the model cannot infer your stack, build tooling, conventions, or “obvious” paths. Include: |
| 82 | |
| 83 | - Project briefing (stack + build/test commands + platform constraints). |
| 84 | - “Where things live” (key directories, entrypoints, config files, boundaries). |
| 85 | - Exact question + what you tried + the error text (verbatim). |
| 86 | - Constraints (“don’t change X”, “must keep public API”, etc). |
| 87 | - Desired output (“return patch plan + tests”, “give 3 options with tradeoffs”). |
| 88 | |
| 89 | ## Safety |
| 90 | |
| 91 | - Don’t attach secrets by default (`.env`, key files, auth tokens). Redact aggressively; share only what’s required. |
| 92 | |
| 93 | ## “Exhaustive prompt” restoration pattern |
| 94 | |
| 95 | For long investigations, write a standalone prompt + file set so you can rerun days later: |
| 96 | |
| 97 | - 6–30 sentence project briefing + the goal. |
| 98 | - Repro steps + exact errors + what you tried. |
| 99 | - Attach all context files needed (entrypoints, configs, key modules, docs). |
| 100 | |
| 101 | Oracle runs are one-shot; the model doesn’t remember prior runs. “Restoring context” means re-running with the same prompt + `--file …` set (or reattaching a still-running stored session). |