/loci:setupfrom LOCI
Install the loci CLI and verify the environment. Use when the user asks to set up, install, reinstall, or repair LOCI ("set up loci", "install loci", "loci is not installed", "fix my loci install"), or when a loci command fails because the CLI is absent. When the ask is just "doctor", only run diagnostics.
Ships in LOCI. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run the plugin's setup script, report what it did, and verify the result. Only pause for genuinely manual steps (e.g. an SSH key for the private CLI repo, or a missing prerequisite the user must install).
Report for the user, not for us. Surface only two things: what the user must do, and the final verdict (setup worked / here's what's broken). Never expose internal plumbing — do NOT mention the plugin dir, the state dir, hook registration, project-detection internals, or how SessionStart works. If a line isn't something the user needs to know or act on, drop it. Aim for a few lines total; when all is well, a sentence or two is the right length.
One version number. Report the plugin version (loci version: in the session
context) as the LOCI version. The CLI version is plumbing — don't print it;
doctor reports what's broken without it.
Read plugin dir: <path> from the LOCI session context injected at session
start, or use the CLAUDE_PLUGIN_ROOT environment variable. Do this silently — never announce or
print the plugin dir; it's internal. If neither is available, stop and tell the
user to restart the coding agent so the plugin loads.
doctor (/loci:setup doctor) → diagnostics only: skip the install, run
loci doctor, and report all checks — healthy ones in one line, any warning
or failure with its detail and what to do about it. If loci itself is
absent, say so and offer the full setup.loci doctor, so both routes share one check surface — the only
difference is whether the install ran first.Check the prerequisite BEFORE running the script — don't let it fail first.
uv is the one required host tool; it is what installs the loci CLI. jq is
not one, and nothing here probes for it. Probe uv:
command -v uv >/dev/null 2>&1 && echo "uv: ok" || echo "uv: MISSING"
If it is MISSING, stop and give the user the exact install command for their
platform — do not run the setup script yet, and do not install uv yourself.
It is a host tool that needs root and an interactive password prompt, so it can
NEVER be installed from inside the agent (no TTY for sudo); the user runs the
command in their own terminal, then re-runs /loci:setup.
First determine the platform and package manager yourself — then give the single
correct command. Do NOT default to Debian/Ubuntu and do NOT ask the user what
their distro is; work it out and hand them the right command directly.
uname -s names the OS (Darwin, Linux; MINGW*/MSYS* or a PowerShell
shell tool is Windows). On macOS/Windows
that settles it (brew / winget). On Linux it does not — verify with
command -v which package manager is present (apt-get, dnf, pacman, …)
instead of assuming apt.
Only ever offer the command for the user's actual system. Give exactly one
command for the detected platform — never list alternatives for other OSes, and
never mention Nix/nix profile unless you have confirmed the host is NixOS
(command -v nix present and no apt/dnf/pacman).
Reference (pick the one matching the detected platform — give only that one):
curl -LsSf https://astral.sh/uv/install.sh | sh
(Linux/macOS), or pipx install uv; sudo pacman -S uv (Arch),
brew install uv (macOS), winget install astral-sh.uv (Windows).Only if you have confirmed the host is NixOS: nix profile install nixpkgs#uv
(no sudo).
Keep the message to just the missing tool and its command. Do NOT narrate what
you can or can't do ("uv isn't installed and I shouldn't install it for
you…"), do NOT explain that the plugin doesn't install prerequisites, and do NOT
otherwise editorialize about why — the user only needs the tool name and the
command to run. Shape it like: "uv isn't installed — run
! curl -LsSf https://astral.sh/uv/install.sh | sh, then re-run
/loci:setup." Only proceed to the install below once it resolves.
Once it is present, announce it in one concise line — e.g. "Setting up LOCI" — then run from the project root:
bash "<plugin-dir>/setup/setup.sh"
(If a prerequisite still slips through, the script exits early printing
PREREQ_MISSING: <tool> … — handle it exactly as above.) It installs the loci
CLI as a uv tool (via the same self-locking installer the hooks use), then fixes
exec bits, and ends with a Project: line when it was run inside a project. It
writes no project state. It prints a line-per-step report — read it, but relay only what the user needs:
whether the install succeeded and any dependency that failed. The plumbing lines
(exec bits, hooks.json validation, hook registration — including a "skipped"
registration, which is normal in plugin mode) are internal: do NOT surface them
and do NOT theorize about what they mean for auto-triggers. This step installs
the loci CLI; environment/toolchain verification is Step 3 (loci doctor).
If the loci CLI step fails:
~/.loci/state/loci-cli-install.log for the cause.uv cannot reach PyPI to fetch the loci-tools wheel — an old
uv, or a proxy blocking pypi.org (a missing uv is caught earlier, in
Step 1, with an install command to relay). Report the log excerpt and the
specific dependency that failed.bash <plugin-dir>/hooks/ensure-loci-cli.sh (self-locking; waits for any
in-flight install).Nothing is installed here — this is the check half. Run loci doctor: it is the
single verification surface and prints one JSON envelope (data.checks[],
data.summary, data.healthy). Let it print and read those fields off it — not
through jq or any other parser, and never with 2>&1: diagnostics go to
stderr, so merging the streams puts non-JSON in front of the envelope and what
fails is the read rather than the install. Running it also proves the
freshly-installed binary actually works, so it doubles as the post-install
sanity check — if the loci doctor call itself errors (rather than reporting an
unhealthy check), treat that as an install problem and fall back to the
CLI-failure handling in Step 2.
Doctor checks the whole environment (Python, bundled deps, c++filt,
cross-compilers, credential store, sign-in state, state dir — and the container
engine, as engine-* checks, only when the project's recipe puts the toolchain in
one), but most of those are our internal diagnostics. Relay only the user-facing verdict:
healthy → one sentence ("Environment checks passed"). Do NOT enumerate
the passing checks, and never surface internal ones (state dir, credential
store, individual Python imports).warn/fail checks that the user can act on
(e.g. no cross-compiler for their target, or an unreachable container engine),
each with its detail and the fix.
Required-check failures block usage; optional ones are advisories.Keep doctor's session check result for the sign-in offer in the next step.
Read the session check from the loci doctor output above. If signed in, say
nothing about auth. If signed out, offer sign-in as
the last setup step. Every loci command except the auth verbs and
doctor requires a session, so a signed-out install is not usable yet.
The login is a browser OAuth flow that must run in the user's own
terminal — do NOT run loci login yourself. Tell the user:
One step left: sign in by typing
! loci login(opens your browser). LOCI's commands need a session — if you skip this, they'll ask again when first run.
Declining is not a failure; setup is complete either way.
End with a short, user-facing status — two things only: any action still
required (sign-in, a missing compiler for their target, adding an SSH key, or the
Project: line's /loci:init <root>), and the verdict. If everything is healthy, one line that setup is complete plus a
pointer to /loci:help. Do NOT list checks that passed, internal paths, the
state dir, or hook-registration details.
Whenever setup finishes healthy, close with one more line, phrased as something they may want rather than a step they owe, and in these words — the separate terminal is there because it takes over the one it starts in:
Run
loci cockpitin a separate terminal to see what LOCI catches that your coding agent might miss during planning and coding.
Healthy is the trigger, not a fresh install — setup over an already-current CLI is the commonest run there is, and gating this on "the install succeeded" is why a user who was already set up never heard the cockpit existed. One line only, here and nowhere else in the report — no flags, no panel list. Do not run it yourself: it does not exit on its own, so a Bash call to it hangs the session.
Do NOT tell the user to restart or reload the coding agent — this skill only runs when the plugin is already loaded, so its hooks and skills are already active in the session.
What SKILL.md sets; muted values are Claude Code's defaults
"doctor" installs nothing: diagnostics only.
Other plugins' skills for the same job
12 skills in this plugin
/bug-reportForensic diagnostic report for LOCI — collects environment state, runs health checks, and writes a timestamped report when analysis fails or doesn't trigger. Use when the user says "bug report", "LOCI isn't working", "something is broken", "debug LOCI", or wants any LOCI failure investigated.
/contractAuthor and inspect this repository's Contract Envelope (.loci/contract.yaml) — the stack, timing, energy, memory and structural bounds that let LOCI judge a measurement rather than merely report it. Use when the user states a limit as a requirement: "set a budget", "add a bound", "cap X at N", "X must not exceed N", "fail the build if timing regresses"; also "what are my limits", "show the contract".
/control-flowAnnotated control-flow graphs for compiled C/C++/Rust/Go and Python (Cython): per-function basic blocks, loops with derived trip counts, recursion and irreducible cycles, call sites, in text optimised for LLM analysis. Renders the graph and judges the two structural signals it determines, recursion cycles and indirect calls, and the contract's text-only rules on the functions it draws. Use when the user asks what the control flow of compiled code looks like: call dependencies, function impact, which branches and loops exist, where the hot path could run, or what a change did to the shape of a function.
npx claudepluginhub auroralabs-loci/loci-claude --plugin loci