|
| 1 | +# Small Harness Quickstart |
| 2 | + |
| 3 | +This guide is for the first 20 minutes with Small Harness. It focuses on the |
| 4 | +top three things you can do immediately: understand a repo, make a safe edit, |
| 5 | +and tune Small Harness to the best model available on your machine. |
| 6 | + |
| 7 | +## Before You Start |
| 8 | + |
| 9 | +You need Rust and at least one OpenAI-compatible local backend. Ollama is the |
| 10 | +fastest first path: |
| 11 | + |
| 12 | +```bash |
| 13 | +brew install ollama |
| 14 | +brew services start ollama |
| 15 | +ollama pull qwen2.5-coder:7b |
| 16 | +``` |
| 17 | + |
| 18 | +Then run Small Harness from the project you want to work in: |
| 19 | + |
| 20 | +```bash |
| 21 | +cargo run --release |
| 22 | +``` |
| 23 | + |
| 24 | +On first run, the setup wizard creates `agent.config.json`. For the quickest |
| 25 | +local setup, choose: |
| 26 | + |
| 27 | +```text |
| 28 | +backend: ollama |
| 29 | +profile: mac-mini-16gb |
| 30 | +model override: blank |
| 31 | +approval policy: dangerous-only |
| 32 | +tool mode: auto |
| 33 | +``` |
| 34 | + |
| 35 | +## 1. Understand A Codebase Fast |
| 36 | + |
| 37 | +Small Harness is most useful when you let it inspect files directly instead of |
| 38 | +pasting code into chat. Start with a broad map, then ask narrower questions. |
| 39 | + |
| 40 | +Try: |
| 41 | + |
| 42 | +```text |
| 43 | +Give me a concise map of this repo. Focus on the entry points, core modules, |
| 44 | +and where configuration lives. |
| 45 | +``` |
| 46 | + |
| 47 | +Then: |
| 48 | + |
| 49 | +```text |
| 50 | +Find the code path for slash commands and explain how a new command should be |
| 51 | +added. |
| 52 | +``` |
| 53 | + |
| 54 | +Useful commands: |
| 55 | + |
| 56 | +```text |
| 57 | +/config show the active backend, model, tools, workspace, and history |
| 58 | +/tools show enabled tools and whether adaptive tool selection is on |
| 59 | +/context show prompt budget and active tool schemas |
| 60 | +``` |
| 61 | + |
| 62 | +What to look for: |
| 63 | + |
| 64 | +- Small Harness should use read/search/list tools only when needed. |
| 65 | +- With `toolSelection: "auto"`, ordinary chat should avoid sending tool schemas. |
| 66 | +- The answer should cite concrete files and functions, not just guess. |
| 67 | + |
| 68 | +## 2. Make A Safe Local Edit |
| 69 | + |
| 70 | +Small Harness can edit files, but the best workflow is to ask for a small, |
| 71 | +reviewable change and let approvals show you exactly what will happen. |
| 72 | + |
| 73 | +Try: |
| 74 | + |
| 75 | +```text |
| 76 | +Add a short comment above the function that dispatches slash commands explaining |
| 77 | +that new commands should be registered in both COMMANDS and dispatch. |
| 78 | +``` |
| 79 | + |
| 80 | +Then inspect what happened: |
| 81 | + |
| 82 | +```bash |
| 83 | +git diff |
| 84 | +cargo test |
| 85 | +``` |
| 86 | + |
| 87 | +Useful commands: |
| 88 | + |
| 89 | +```text |
| 90 | +/session show current model, approval policy, session file, and tokens |
| 91 | +/new start a clean conversation |
| 92 | +/export current markdown |
| 93 | +``` |
| 94 | + |
| 95 | +Good habits: |
| 96 | + |
| 97 | +- Ask for one focused change at a time. |
| 98 | +- Prefer exact files, functions, or tests when you know them. |
| 99 | +- Keep `approvalPolicy` at `dangerous-only` or `always` until you trust a model. |
| 100 | +- Use `git diff` as the source of truth before committing. |
| 101 | + |
| 102 | +## 3. Tune The Best Local Model |
| 103 | + |
| 104 | +Different local models vary a lot. Small Harness can probe model capabilities, |
| 105 | +cache the results, benchmark latency, and recommend the best cached fit. |
| 106 | + |
| 107 | +Run: |
| 108 | + |
| 109 | +```text |
| 110 | +/doctor --deep |
| 111 | +/bench |
| 112 | +/capabilities |
| 113 | +``` |
| 114 | + |
| 115 | +If you have multiple backends running, probe them all: |
| 116 | + |
| 117 | +```text |
| 118 | +/capabilities refresh all |
| 119 | +``` |
| 120 | + |
| 121 | +Then ask for a recommendation: |
| 122 | + |
| 123 | +```text |
| 124 | +/autotune |
| 125 | +``` |
| 126 | + |
| 127 | +Apply the recommendation to the current session: |
| 128 | + |
| 129 | +```text |
| 130 | +/autotune apply |
| 131 | +``` |
| 132 | + |
| 133 | +What Small Harness is checking: |
| 134 | + |
| 135 | +- model listing |
| 136 | +- streaming responses |
| 137 | +- usage chunks |
| 138 | +- native tool calls |
| 139 | +- inline JSON fallback for small models |
| 140 | +- first-token latency |
| 141 | +- estimated output tokens per second |
| 142 | + |
| 143 | +By default, `/autotune` prefers local backends. To let OpenRouter compete with |
| 144 | +local models, use: |
| 145 | + |
| 146 | +```text |
| 147 | +/autotune --cloud |
| 148 | +``` |
| 149 | + |
| 150 | +## A Good First Session |
| 151 | + |
| 152 | +Here is a simple sequence that exercises the whole product: |
| 153 | + |
| 154 | +```text |
| 155 | +/config |
| 156 | +Give me a concise map of this repo. |
| 157 | +/doctor --deep |
| 158 | +/bench |
| 159 | +/capabilities |
| 160 | +/autotune |
| 161 | +Find one small README improvement and propose the exact diff before editing. |
| 162 | +``` |
| 163 | + |
| 164 | +After the edit: |
| 165 | + |
| 166 | +```bash |
| 167 | +git diff |
| 168 | +cargo fmt --all -- --check |
| 169 | +cargo test |
| 170 | +``` |
| 171 | + |
| 172 | +## Where Things Are Saved |
| 173 | + |
| 174 | +Small Harness keeps local state under `.sessions/`: |
| 175 | + |
| 176 | +```text |
| 177 | +.sessions/ |
| 178 | + history.jsonl input history |
| 179 | + *.jsonl session transcripts |
| 180 | + doctor/ deep doctor JSON and Markdown reports |
| 181 | + evals/ eval suite JSON and Markdown reports |
| 182 | + capabilities/ per-model capability and benchmark cache |
| 183 | +``` |
| 184 | + |
| 185 | +That local cache is what powers `/capabilities` and `/autotune`. |
0 commit comments