opus mcp human-invoked

Quick reference

FieldValue
Command/brewcode:semble [status|setup|resume|enable|disable|reindex|optimize|update|remove|purge]
Argumentsa mode keyword, or free text in RU/EN — empty input is always status
Modelopus
ToolsRead, Bash, AskUserQuestion
MCP serversemble_code, registered at user scope, pin semble[mcp]==0.5.2

What it does

semble is the lifecycle router for semble_code — a semantic code-search MCP server that gives Claude two tools: mcp__semble_code__search (find code by intent) and mcp__semble_code__find_related (neighbors of a known location). The skill never edits code itself; it installs the prerequisite, registers the MCP server, wires a project rule and hooks, and migrates project agents so they can call the tools.

It always prints the current state before changing anything. Every mutation goes through a script under scripts/ — the skill only decides which one to run and reports the result.

Semble has no Homebrew formula of its own. The skill installs uv via brew (a machine-level step gated by an explicit confirmation) and then runs the pinned uvx --from 'semble[mcp]==0.5.2' semble --content code config — never a floating version.

When to use

SituationCommand
First time on a project, nothing wired yet/brewcode:semble setup
Just reloaded Claude Code after setup/brewcode:semble resume
Check current state, no changes/brewcode:semble (empty input)
Something looks off, want a diagnostic/brewcode:semble optimize
A newer semble[mcp] pin is approved/brewcode:semble update
Turn search off without deleting anything/brewcode:semble disable
One repo’s index looks stale/brewcode:semble reindex
Free-text works too, RU or EN/brewcode:semble переиндексируй
Remove the wiring, keep or drop pieces/brewcode:semble remove
Wipe everything, including the cache/brewcode:semble purge

Example

/brewcode:semble setup
uv missing — plan: brew install uv; uvx --from 'semble[mcp]==0.5.2' semble --help
[AskUserQuestion] Install uv via Homebrew now?  -> Install
✅ uv resolved, pin 0.5.2 confirmed
✅ docs cache root reserved (RESERVED-FOR-DOCS.txt)
✅ semble_code registered at user scope

Reload Claude Code (new session), then run: /brewcode:semble resume
Checkpoint: /abs/project/root/.claude/semble/state.json

After a fresh session:

/brewcode:semble resume
smoke query ok — cold index built in 23s, 7.6 MiB on disk
rule + hooks + permissions installed, 2 project agents migrated
phase: ready

Subsequent searches are sub-second and require the absolute repo path:

{"query": "how sessions are persisted", "repo": "/abs/project/root", "top_k": 5}
{"results": [
  {"file_path": "src/store/session.ts", "start_line": 41, "end_line": 58, "score": 0.83}
]}

Workflow

  1. Status first, every mode

    Runs semble-status.sh —section all —json — read-only, writes nothing under the project, the cache root or ~/.claude/settings.json. Prints the pre-mutation Before snapshot.

  2. Resolve the mode

    Applies the 5-step routing algorithm to $ARGUMENTS: empty input is always status; a pending reload routes straight to resume; otherwise the highest count of matched keywords wins. States the resolved mode and the reason before acting.

  3. Setup — prerequisite gate

    semble-install.sh <check|uv|coreutils|semble|all>all runs check -> uv -> coreutils -> semble. Probes without —yes first. uv is a hard gate: missing, it asks one AskUserQuestion before running brew install uv — a machine-level mutation outside the project, never silent. coreutils is a soft, optional offer for the same question — see Technical details below.

  4. Setup — register and checkpoint

    Reserves the separate docs cache root, registers semble_code at user scope, then writes a reload checkpoint and stops. The server does not exist for the running session — no smoke query is attempted.

  5. Resume — verify and wire

    Re-checks status; if the MCP state is not correct, falls back into setup instead of verifying. Runs a smoke query (up to 600s on a cold embedding-model download), installs the semble-first rule, hooks and permissions, then migrates project agents’ tools: allowlists.

  6. Other modes — one delegation each

    enable/disable flip a flag, deleting nothing. reindex and purge run dry first (exit 4), show the exact paths, then require one confirmation before the destructive pass. optimize only reads. update compares the recorded pin against 0.5.2 and no-ops if identical.

  7. Report

    Re-runs status after the last write and prints six fixed sections: Detection, Before, Actions, Verification, Current Status, Next Step — including every command actually run and an uncovered: line on every invocation.

Technical details

Modes

ModeEffectMutates
statusfull report: prereqs, MCP, cache, guidance, agents, coverage, stateno
setupinstall uv, register semble_code at user scope, checkpoint for reloadyes
resumeafter reload: smoke query, rule + hooks + permissions, agent migrationyes
enableturn back on: verify, warm, phase -> readyyes
disableenabled=false — hooks go silent, nothing deletedyes
reindexdelete exactly this repo’s cache dir (confirmed), then warmyes
warmfree-text intent (“warm”, “прогрей”) — pre-builds the index, deletes nothingyes (cache write only)
optimizeread-only audit fan-out with concrete recommendationsno
updatecompare the recorded pin against 0.5.2, re-register if differentyes
removefour flavours: integration / mcp / cli / purgeyes
purgeeverything, including the code cache root — typed confirmation requiredyes

Prerequisites

PackageRequired?If declined or impossible
uv / uvx (brew install uv)required — setup asks first, stops on declinemanual fallback curl -LsSf https://astral.sh/uv/install.sh | sh is printed, never run
coreutils (brew install coreutils -> gtimeout)optional — offered only when no timeout/gtimeout binary exists and brew doesnothing breaks: sc_timeout keeps its pure-bash watchdog, every shell-out stays bounded either way

semble-install.sh takes one of check \| uv \| coreutils \| semble \| allall runs them in that order and is what setup calls.

What setup installs

SurfaceLocation
MCP server~/.claude.json .mcpServers.semble_code, user scope — -s user is mandatory, the CLI default is local
Commanduvx --from 'semble[mcp]==0.5.2' semble --content code config
Code cache rootabsolute SEMBLE_CACHE_LOCATION: macOS ~/Library/Caches/semble-code / Linux ${XDG_CACHE_HOME:-~/.cache}/semble-code
Docs cache rootsame path with a semble-docs leaf — created empty, reserved, never registered
State<repo>/.claude/semble/state.json
Rule<repo>/.claude/rules/semble-first.md
HooksSessionStart + a PreToolUse advisory reminder
Agentsproject .claude/agents/**/*.md get the two tool names added to tools:; global agents are never touched

Reload boundary

A newly registered MCP server is not usable until a new Claude Code session. setup writes the checkpoint and stops there — it never claims success it cannot verify. /brewcode:semble resume continues at the smoke query in the new session.

Tool contract

Both mcp__semble_code__search and mcp__semble_code__find_related require an absolute repo argument — it is never inferred. 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.

Corpus and coverage

Note

Corpus is --content code config. .html/.htm are not indexed — semble classifies HTML as docs. .json/.json5/.csv/.tsv/.psv are excluded from every content type, unreachable even with --content all. rg stays the tool for those, and for exact identifiers, regexes, and exhaustive enumeration.

Honest limits

FactConsequence
No watcher, no daemonThe index is built inside a tool call and cached; staleness is re-checked per call. Nothing runs in the background.
Every shell-out is time-bounded, with or without coreutilssc_timeout uses timeout/gtimeout when a binary is present and a pure-bash watchdog when none is — the report’s timeout.bounded is always true. coreutils only upgrades which binary enforces the bound; it is never required and never a reason a run can fail.
Cold cache = slow first queryThe embedding model download can take up to 600s and fails offline with a cold HuggingFace cache.
Docs corpus is reserved, not registeredThe per-repo cache key does not encode content type — mixing code and docs in one cache dir would collide and invalidate on every call, so the docs root exists empty and untouched.
semble clear index wipes everything under the cache rootThere is no per-repo rebuild CLI; reindex deletes exactly one resolved <code root>/<64-hex> directory, guarded and confirmed.
Windows is unsupportedThe skill refuses every mutation on a non-macOS/Linux platform.

Removal flavours

FlavourRule / hooksMCPAgent frontmatterCacheuv tool
integrationremovedkeptsemble entries removedkeptkept
mcpkeptremovedkeptkeptkept
clikeptkeptkeptkeptuninstalled
purgeremovedremovedremovedcode root removedtyped confirmation

Measured on this repo

MetricValue
Cold index build23s
Cache size on disk7.6 MiB
Subsequent queriessub-second
🚀

brewcode overview

Full plugin overview — all skills, agents, and hooks in one place.

🤖

agents skill

Manages the project agent roster — semble’s resume step patches those same agents’ tools: allowlists.

🔗

GitHub source

SKILL.md, scripts, and the reference files behind every mode.

Updating plugins

Use /brewtools:plugin-update to check and update the brewcode plugin suite in one command. See the FAQ for details.