PLUGIN brewcode / Skills
On this page
semble-setup — semantic search with isolated content variants
opus mcp human-invokedWires the semble_code MCP server into a project so Claude finds code by intent, not by exact string: pinned install, project rule, hooks, permissions and agent migration. It reports state before every change and delegates every mutation to a script.

Illustrative animation: install wires the server, resume warms the index, a behaviour question runs a semantic search, a status card closes. File names, scores and timings are invented.
View README on GitHub (opens in a new tab)
Quick reference
| Field | Value |
|---|---|
| Command | /brewcode:semble-setup [status|install|upgrade|enable|disable|uninstall|purge|reindex|optimize|resume] [--unattended] |
| Arguments | a mode keyword, or free text in RU/EN |
| No-arg default | always status (read-only) |
| Model | opus |
| Output | six-section report: Detection, Before, Actions, Verification, Current Status, Next Step |
A bare call never installs
Unlike most -setup skills, semble-setup never falls back to install: it runs brew install uv, a machine-level change outside the project. Empty input is always read-only status; type the verb to install.
Modes
| Mode | Does | Mutates |
|---|---|---|
status | full report: prereqs, MCP, cache, guidance, agents, coverage, state | no |
install | install uv, register semble_code, wire rule, hooks, permissions, agents; stop at reload | yes |
upgrade | repair to the pin 0.6.2, re-sync wiring, delete retired hooks | yes |
enable / disable | back on (verify, warm) / hooks go silent, nothing deleted | yes |
uninstall | integration, mcp, cli or purge flavour | yes |
purge | everything of this project, typed confirmation | yes |
reindex | stage and swap only this repo’s index-code-config-docs | yes |
optimize | read-only audit with concrete recommendations | no |
resume | after the reload: smoke query, self-repairing re-run, phase=ready | yes |
The first six rows hold the seven modes shared by every -setup skill; reindex, optimize and resume are semble-specific. setup, update and remove stay accepted as free-text synonyms.
Under --unattended, upgrade never repairs the MCP pin (drift is reported as pending) and skips when uv or uvx is absent; see how the flag works.
When to use
| Situation | Command |
|---|---|
| First time on a project | /brewcode:semble-setup install |
Just reloaded after install | /brewcode:semble-setup resume |
| Check state, no changes | /brewcode:semble-setup |
| Index looks stale | /brewcode:semble-setup reindex |
| Remove wiring or everything | /brewcode:semble-setup uninstall / purge |
Example
/brewcode:semble-setup install
The skill probes uv, asks once before brew install uv, registers the server at user scope, wires the project, then stops at the reload checkpoint:
## Actions
changed: brew install uv, semble_code registered @ user, rule installed, CLAUDE.md block installed, 3 hooks wired, permissions merged, 2 agents patched
## Current Status
reload required — MCP registered, waiting for a new session
## Next Step
Reload Claude Code (new session), then run: /brewcode:semble-setup resume
After the reload, /brewcode:semble-setup resume runs the pinned smoke query and closes at phase=ready. Searches then take {"query": "how sessions are persisted", "repo": "/abs/project/root", "top_k": 5}.
How it works
- Status first
Runs the read-only status script and prints the Before snapshot in every mode.
- Resolve the mode
Empty input is
status; a pending reload routes toresume; otherwise the most matched keywords win. The mode and reason are stated before acting. - Prerequisite gate
uvis required and asked for once;coreutilsis an optional offer. - Register and wire
Registers the pinned server, wires rule,
.sembleignore,CLAUDE.mdblock, hooks, permissions and agents, then writes the reload checkpoint. - Resume
Verifies in the new session (up to 600 s on a cold model download) and self-repairs drift.
- Report
Re-runs status after the last write and prints the six sections with every command run.
Good to know
- The first query on a cold cache downloads hundreds of MB; allow up to 600 s. Offline with a cold cache, every call errors.
.json,.csv,.mdxand.txtare never indexed; usergfor those, exact identifiers and exhaustive counts.- Both tools require
repo(absolute root orhttps://git URL); optionalcontent=code|docs|config|all. disableis the reversible off switch;purgeis the only wipe.
Technical details
More situations #
Free text works too: /brewcode:semble-setup rebuild the index. warm the cache routes to reindex and its no-delete warm branch.
What install installs, and where #
| Surface | Location |
|---|---|
| MCP server | profile .claude.json .mcpServers.semble_code, user scope (-s user; CLI default is local), alwaysLoad: true. Default profile: ~/.claude.json |
| Command | uvx --from 'semble[mcp]==0.6.2' semble --content <SEMBLE_CONTENT_ARGS> (default code docs config) |
| Shared cache | macOS ~/Library/Caches/semble-code, Linux ${XDG_CACHE_HOME:-$HOME/.cache}/semble-code; per repo index (code-only) and index-<sorted-content> siblings |
| State | <repo>/.claude/semble/state.json, gitignored unless a repo rule already covers it |
| Rule | <repo>/.claude/rules/semble-first.md |
| Ignore file | <repo>/.sembleignore, gitignore syntax; managed like the rule (edits reported, --force backs up) |
| CLAUDE.md | marked <!-- BEGIN brewcode:semble --> block, replaced in place, never duplicated; only uninstall removes it |
| Hooks | semble-session.mjs, semble-stats.mjs, semble-subagent.mjs in .claude/hooks/; four settings rows, timeout: 5, portable ${CLAUDE_PROJECT_DIR} path |
| Permissions | exactly mcp__semble_code__search and mcp__semble_code__find_related, never a wildcard; written only if no layer grants them |
| Agents | project .claude/agents/**/*.md get the two tool names; agents without tools: inherit; global agents untouched. Patching records which tool names it added; uninstall and --revert strip only those recorded names, never a user-authored tool name, and decline when no record exists |
The project root is CLAUDE_PROJECT_DIR (else the git toplevel): a session started in a subdirectory wires that subdirectory. The MCP registration is per profile, the rest per project, so another profile reports version: not registered until install runs there. Installation is uvx-ephemeral: no semble on PATH.
Prerequisites: uv/uvx (brew install uv) is required and asked first; the fallback curl -LsSf https://astral.sh/uv/install.sh | sh is printed, never run. coreutils (gtimeout) is optional; without it a pure-bash watchdog keeps every shell-out time-bounded.
CLAUDE.md conflict scan #
install --part claudemd scans the root CLAUDE.md outside the marked block, backs it up to a timestamped .bak first and removes whole lines only, echoed verbatim.
| Line | Result |
|---|---|
denies semantic search (Grep/Glob are no-ops, never use semble) | removed, even if it also scopes the tool |
puts grep/Bash/rg first (grep-first, search via the Bash tool) | removed unless it scopes the tool to exact identifiers, regexes, paths or enumeration |
| merely mentions a search tool | reported, untouched |
An unpaired or duplicated marker is malformed: exit 3, nothing changes. SEMBLE_DRY_RUN=1 previews. A controlled A/B found no conversion effect (36% with the line vs 22% without, p = 0.45, n = 32), so this is hygiene for false statements, not an adoption fix.
State file and phases #
state.json is what semble-session.mjs reads; its phase follows a transition machine.
absent -> prereq_ready -> awaiting_reload -> verifying -> ready
\ |
+-> disabled <----------+ready is reachable only from verifying, so a run that dies half-way leaves an accurate record. Re-registration parks the phase at awaiting_reload; disable reaches disabled from any set-up state. Installer-owned fields (resumePrompt, cacheRoot, repoHash, approvedVersion, projectRoot, schema, metadata) are recomputed on every write; enabled, phase, completed and notes are never reset as a side effect.
Hooks and measured delivery #
Retired and deleted by install/upgrade/uninstall with their settings rows and markers (.reminder-ts, .prefetch-ts, reminder.json): semble-explore.mjs (5.0.0, replaced by semble-subagent.mjs), semble-reminder.mjs and semble-prefetch.mjs (6.5.0, no gain in a same-profile A/B: 42% vs 42% semble share, one repetition per cell).
Measured on CC 2.1.226: SubagentStart text reached 8/8 subagents when installed, 0/6 removed. That proves delivery, not routing: first-tool semble was 14/14 with and without the hook because the spawn prompts already said to start with mcp__semble_code__search. Never quote a conversion percentage for a nudge. Status reports conversion per source; 0/0 means never delivered, 0/N delivered and ignored.
Version tracking and upgrade verdicts #
status compares the version stamped in the installed rule (frontmatter version:) and hooks (line 2, // brewcode-meta:) against the running plugin; a mismatch drops ready to partial with Next Step upgrade. The resolver refuses to stamp a value it cannot resolve.
Rule and .sembleignore are compared with the stamp stripped: identical is unchanged; metadata-only is re-synced; a byte-pristine v4.5.0-v6.4.0 copy is upgraded (pristine prior-release copy) without --force or backup; anything else is user_modified, skipped with a diff, replaced only by --force after a backup. Absolute-path hook rows (<= 6.5.0 shape) are drifted; upgrade and install rewrite them to ${CLAUDE_PROJECT_DIR}/.claude/hooks/.... Leftover retired hooks print retired: <names> - stale (remove via upgrade).
Skipped is not failed: SEMBLE_NO_NETWORK=1, SEMBLE_DRY_RUN=1 or a missing uvx skip smoke, warm and staged rebuilds with exit 3 and "status":"skipped"; phase stays verifying and status reports partial. A guidance section that errored always downgrades ready to partial; a null measurement (section not requested) never does.
Gap in a partial project | Next Step |
|---|---|
| warm/smoke unrecorded, index variant missing | resume |
| hand-edited rule at an old stamp | review diff -u, or upgrade --force (backup first) |
| pin moved, retired hooks, prior-release copy, agents need patching, absolute-path rows | upgrade |
| any install step missing | install |
Tool contract and corpus #
Both tools require repo, never inferred, and accept optional content=code|docs|config|all. Results carry file_path, start_line, end_line, score and optional content; there is no line field. Defaults: top_k=5, max_snippet_lines=10. Routing: intent to semble; symbols to LSP; literals, regexes, paths and counts to rg.
The registered corpus is code docs config in index-code-config-docs; all reuses it, docs and config resolve narrower siblings. docs is what includes Markdown and .html. .json, .json5, .csv, .tsv, .psv are unreachable at any setting; .mdx and .txt are absent from semble’s extension table. A ! un-ignore ending in an extension bypasses the extension filter; .sembleignore re-ignores win.
Limits: read before trusting it #
| Fact | Consequence |
|---|---|
| No watcher, no daemon | staleness is re-checked per call behind a 3x last-build-duration cooldown; nothing runs in the background |
| Cold cache | first query downloads the embedding model, up to 600 s; offline fails |
| Retrieval split (0.5.4, 16 questions, not rerun on 0.6.2) | semble won 8 of 9 behaviour questions, lost 2 of 5 exhaustive ones |
semble clear index wipes every index under the shared root | reindex stages and proves a replacement, then swaps only index-code-config-docs; siblings stay live |
| New MCP server invisible to the running session | install stops at a reload checkpoint; resume finishes |
| Staleness detection approximates semble’s own | reported as likely stale, offers reindex, never acts alone |
Upstream server named semble (from semble install) | reported as a conflict, never removed automatically |
| Windows | unsupported; every mutation refused |
Config backups <file>.bak.<epoch> | mode 0600, newest 3 kept, each pruned one named on stderr |
Removal flavours #
| Flavour | Rule / hooks / CLAUDE.md | MCP | Agent frontmatter | Cache | uv tool |
|---|---|---|---|---|---|
integration | removed | kept | entries removed | kept | kept |
mcp | kept | removed | kept | kept | kept |
cli | kept | kept | kept | kept | uninstalled |
purge | removed | removed | removed | this project’s entry (shared root kept unless empty) | uninstalled |
MCP removal covers the active profile only. purge prints every path first and needs the typed confirmation purge semble code cache. Settings are unwired before any hook file is deleted; if unwiring fails, nothing is deleted. A pre-0.5.5 semble-docs directory is removed only when its sole entry is RESERVED-FOR-DOCS.txt.
Troubleshooting #
| Symptom | Fix |
|---|---|
Tools missing after install | reload Claude Code, then /brewcode:semble-setup resume |
| First search hangs for minutes | the model is downloading; wait up to 600 s, once per model |
| Every call errors offline | run once online, or set SEMBLE_NO_NETWORK=1 to skip warm steps |
search rejects the call | pass the absolute repo |
.json/.csv/.mdx/.txt never found | not in the corpus by design; use rg |
partial, retired: ... stale or portable: N absolute-path hook entries | upgrade |
partial, nextStep is resume | warm/smoke unrecorded or index variant missing: resume |
partial, rule hand-edited at an old stamp | review the diff yourself, or upgrade --force |
partial, hooks N/4 wired | a drifted or duplicated hook row: re-run install, the merge repairs it |
malformed | the profile .claude.json or project .mcp.json is invalid JSON: fix by hand, re-run |
ready but tools missing in this profile | version: not registered: run install from this profile; scripts/semble-status.sh --versions --all-profiles lists them |
Reference files #
| Path | What |
|---|---|
SKILL.md | the router: status first, mode selection, delegation |
scripts/semble-{status,install,mcp,cache,state,project,remove,guidance,agents}.sh | one script per concern; status is read-only (--json, --section, --versions) |
references/intent-routing.md | routing table, 5-step resolution, worked examples |
references/output-contract.md | the report template |
references/mcp-and-cache.md, language-coverage.md, project-agent-migration.md, engine-landscape.md | registration and cache layout, indexed suffixes, agent migration, engine decision record |
assets/INSTALL.md | runbook for the guidance and hooks install |
Every script takes --json. Exit codes: 0 ok, 1 hard failure, 2 bad usage, 3 recoverable precondition or skipped verification, 4 confirmation required.
Related
brewcode overview
All skills, agents and hooks in one place.
agents skill
Manages the agent roster whose tools: lists install patches.
setup-status
Dashboard that flags stale semble wiring; upgrade refreshes it.
Update: /brewtools:plugin-update, /reload-plugins, then /brewcode:setup-status upgrade - FAQ