/loci:bug-report [description of what failed]from LOCI
Forensic 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.
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.
Shared house rules. Read <plugin-dir>/skills/_shared/house-rules.md
and apply its Output: the JSON envelope section — every loci call here prints one
JSON document, you let it print and branch on .ok, and a field this report quotes is
read off that output rather than parsed out of a log.
Generate a forensic diagnostic report when LOCI analysis fails, a skill does
not invoke, or results are missing or invalid. The report is written to a
timestamped .md file that can be shared or loaded into a future
session to diagnose and fix the issue.
This skill must work even when LOCI is completely broken. Do NOT run analysis
skills or heavy loci verbs (timing / elf) for collection — they may be the
thing that's broken. Use only: Read, Bash, file search and the lightweight,
fast-failing probes command -v loci, loci auth status, loci doctor,
loci init probe (a read-only dump of what init decides from) and
loci build fresh (a local mtime/DWARF check — no backend call, no asmslicer).
The last two run signed out; loci init needs a session and this skill never
runs it.
From the LOCI session context: plugin dir: <path> → <plugin-dir>, and
loci version: <semver> → <plugin-version>. <project-context> is the
context_file of loci project (with --project-root if the user named the
project); record its whole answer, a refusal included.
The analysis front door is the bare loci command on PATH — a uv tool that
ships its own analysis stack (asmslicer + deps). There is no plugin-side venv:
command -v loci and loci doctor are the readiness probes in the checklist
below.
If plugin dir: is not in the session context, fall back to the
CLAUDE_PLUGIN_ROOT environment variable (Copilot sets it for the hooks only;
installs live under ~/.copilot/installed-plugins/). If neither is
available, stop and
tell the user: "Cannot locate LOCI plugin directory. Ensure the plugin is
installed and restart the coding agent."
State files live outside the versioned plugin cache so they survive plugin upgrades.
| Path | Purpose | Fallback |
|---|---|---|
$LOCI_STATE_DIR (typically ~/.loci/state) | project-context, measurements, stats | <plugin-dir>/state |
loci CLI (a uv tool on PATH) | analysis stack — asmslicer + deps | — |
The plugin exports LOCI_STATE_DIR at session start; read it with
${LOCI_STATE_DIR:-$HOME/.loci/state} so the fallback path is used when this
skill runs outside a hook context.
The skill accepts an optional argument string describing the problem.
Store it as <user-description>.
If no argument was provided, ask the user in one sentence: "What did you expect LOCI to do, and what happened instead?"
Run these in parallel where possible via Bash and Read:
Host and version — the host: line of the session context when present
(GitHub Copilot CLI; run copilot --version only if the line carries no
number); otherwise Claude Code, claude --version 2>/dev/null || echo "unknown"
Model — read from your own system prompt (e.g. claude-opus-4-7,
claude-sonnet-4-6, or the host's model name). Record the exact model ID.
Plugin version — prefer <plugin-version> from session context. If
missing, Read <plugin-dir>/.claude-plugin/plugin.json and take its
version key. Fall back to "unknown".
loci CLI version — loci --version 2>/dev/null || echo "unknown". The
ONE place the CLI's own number is surfaced (house-rules cli-version-gate);
everywhere else the plugin version is the LOCI version.
OS info — uname -a
OS short name — uname -s | tr '[:upper:]' '[:lower:]' (for filename)
Project context — Read <project-context> (the context_file loci project named). Record the full JSON. If
missing, record "MISSING". loci init writes it and every verb that resolves
the project rebuilds it from the recipe, so MISSING beside a recipe on
disk means the state directory was wiped and nothing has run
since. Every field is init's — init_status, detection_status and, out
of the recipe, init_recipe, validated, confirmed_by_user,
loci_target, compiler, compiler_path, build_system and artifact. A
null in the recipe group means no recipe stands behind this context, even
with one still on disk; init_status says why, so record it verbatim. A
subproject_roots key, or an init_status of uninitialized, was left by
an older plugin's session start; nothing writes either now, and
uninitialized still reads as no recipe yet (checks 3, 4 and 6 below).
CLI health — run loci doctor and record data.report (covers Python
3.12, asmslicer, analysis deps, c++filt, the Rust demangler, cross-compilers,
credential store, the state dir and, when the recipe puts the toolchain in a
container, the engine-* checks). If loci is unavailable, record "loci not on PATH".
Git info — git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown"
and git log --oneline -3 2>/dev/null || echo "no git history"
Hooks config — Read <plugin-dir>/hooks/hooks.json. If missing,
record "MISSING".
CLI auth — run loci auth status and record signed-in / signed-out.
Turn baselines — the per-turn trees loci build snapshot --turn writes,
which are what a post-edit "Before" is read from, under the one build root the
CLI reads: .loci/build/. (A .loci-build/ beside it is a pre-move CLI's
leftover; nothing reads it, and a tree under it is not a baseline.) Substitute
the project_root you read in item 7 for <project-root> before running this;
the fence sets it itself so nothing depends on an exported variable:
ROOT='<project-root>'
. '<plugin-dir>/lib/loci_json.sh'
for t in "$ROOT"/.loci/build/turns/*/; do
[ -d "$t" ] || continue
loci_json_load "$(cat "$t/turn.json" 2>/dev/null)"
printf '%s\t%s\t%s\t%s\t%s\n' \
"$(date -r "$t" '+%Y-%m-%dT%H:%M:%S' 2>/dev/null \
|| date -r "$(stat -f %m "$t" 2>/dev/null)" '+%Y-%m-%dT%H:%M:%S' 2>/dev/null \
|| echo '?')" \
"$(loci_json_get turn || echo '?')" \
"$(( $(find "$t/orig" -type f 2>/dev/null | wc -l) ))" \
"$(( $(find "$t/obj" -name '*.o' 2>/dev/null | wc -l) ))" \
"$t"
done | sort | tail -10
lib/loci_json.sh is the hooks' own forkless JSON reader; jq is a host
tool the plugin does not ship.
One sort over every tree, then tail -10: the newest ten. The mtime is
read GNU-first then BSD (date -r FILE is an epoch on BSD/macOS); a ?
row would sort on the digest, which is uncorrelated with time. Each row is
mtime, turn id, captured sources, reconstructed objects, path. Record all
of it, or "none" when there are no rows. Sorting is on the
timestamp because the directory name is a one-way digest of the turn id —
lexical order is uncorrelated with time, and turn.json is the only place the
id itself survives. Also record whether uncaptured.jsonl exists in the tree
with the newest mtime and its last line: that file is where an edit the CLI
could not capture records why.
Reading the two counts. They answer "there was no Before", but only in one direction each:
orig/ empty — the pre-edit hook never captured for that turn. That is
a real finding: it means no --turn reached build snapshot (an older CLI,
the hook killed on its 8 s budget, or loci briefly absent).obj/ empty is NORMAL and is not a finding on its own. That directory
is written only when a header edit is measured through the translation
units that include it. An ordinary .c edit is measured from the .o.prev
beside the object and puts nothing there, and --baseline refuses Rust
outright, so a cargo project always shows 0. Only treat it as a
reconstruction failure when the report is about a header edit.The build recipe and its escrow — every measurement resolves its flags
from the recipe, so the recipe is a report's first fact. probe writes
nothing and runs signed out:
loci init probe --project-root '<project-root>'
Substitute the project_root from item 7, as item 12 does. If item 7 recorded
"MISSING", drop the flag entirely — probe defaults to the current directory,
which is a better answer than a placeholder.
Record from .data: initialized, and when true the recipe block's path,
target, validated (the tier the flags were demonstrated at),
confirmed_by_user and escrow — the out-of-repo integrity record at
<LOCI_STATE_DIR>/recipe-escrow-<cwd_hash>.json. ok means the recipe's bytes
are the ones loci init wrote; missing means nothing vouches for them and
confirmed_by_user can still read true beside it; unchecked means this
load did not verify it, which is not the same as either. A recipe the CLI
would refuse never reaches that block at all — it comes back under
data.recipe_untrusted, whose string carries the code. Record that string
verbatim and do not read it as tampering: recipe_tampered is only one of
the codes that land there, alongside recipe_stale, recipe_invalid,
compiler_missing and an unreadable: prefix for a recipe that would not
parse at all — a cross-compiler someone uninstalled produces the same key. For the same reason initialized reads false for all four, so it is
not evidence that no recipe exists; the recipe_untrusted string is.
On a CLI predating the recipe (invalid choice: 'init'), say so and fall back
to init_status / init_recipe / validated / confirmed_by_user from the
project context: the same values, as of the last successful init.
Rust toolchain (only when the project context shows
build_system: "cargo") — record cargo --version, rustc --version,
and rustup target list --installed 2>/dev/null | head -10 (each falling
back to "not found"). Rust compile failures usually trace to a missing
rustup std for the LOCI target.
Go toolchain (only when the project context shows build_system: "go"
or "tinygo") — record go version, falling back to "not found".
The two Go values this step needs are in the recipe FILE, not in any
envelope. loci init probe's recipe block carries path, target,
validated, confirmed_by_user and escrow — it has no go: block. Read
them from the file that path names:
sed -n '/^go:/,/^[a-z]/p' "<data.recipe.path>"
Substitute the literal path the probe envelope printed under
data.recipe.path. No path means no recipe, and there is nothing to read.
(data.recipe is an object here and a plain path string in an init
envelope — read the one the verb you ran actually returns.)
For a TinyGo project also record tinygo version and, when the block gave a
board, tinygo info -target=<board> 2>&1 | head -5. Do not run
tinygo info with an empty -target= — it errors, and an empty board is
itself the finding. Two Go-specific failures are worth naming because neither
looks like a toolchain problem in the report:
go and tinygo. TinyGo pins a supported Go
range and refuses outside it with requires go version 1.25 through 1.27, got go1.24 — a build failure whose cause is the other tool's version.go.gcflags from
the block above says which: empty means inlining is on, -l means the user
has already traded it away.Container toolchain (only when the recipe file's build: block has an
exec: section — read it as item 15 reads go:; no envelope carries it):
sed -n '/^ exec:/,/^[a-z]/p' "<data.recipe.path>"
Record the section verbatim — engine, image or container, mounts, platform.
Then the engine itself: docker version --format '{{.Client.Version}} / {{.Server.Version}} {{.Server.Os}}/{{.Server.Arch}}', falling back to "engine
not reachable" — which is a finding on its own; item 8's engine-* rows say
which link broke. For a container: recipe add its live mounts,
docker inspect --format '{{json .Mounts}}' <name>; for an image: recipe the
mounts are the section's own. Substitute the section's kind for docker.
Never read the image's contents: this report is about whether LOCI could
reach the toolchain, not about what is in it.
Host records (only when item 1 named GitHub Copilot CLI; otherwise
"n/a — Claude Code"). An agent session's process log is 0 bytes (1.0.91);
what ran is in the session transcript,
~/.copilot/session-state/<session>/events.jsonl. $COPILOT_AGENT_SESSION_ID
is this session's id; an earlier session's is in the Resume line Copilot
printed when it ended, else the newest other directory there (ls -t). Where
the shell tool is PowerShell, mkdir -p .loci/build, save a fence to a file
there and run bash <file> (quotes die in bash -c):
SID="$COPILOT_AGENT_SESSION_ID" # or the earlier session's id
EV="$HOME/.copilot/session-state/$SID/events.jsonl"
grep -o '"hookType":"[A-Za-z]*","success":[a-z]*' "$EV" | sort | uniq -c
grep -oE '"hookType":"[A-Za-z]+","success":false,("output":\{[^}]*\},)?"error":\{"message":"[^"]*' "$EV" | sort -u | head -5
grep -c '"code":"denied"' "$EV"
grep -o '"newModel":"[^"]*"' "$EV" | sort | uniq -c
Line 1: runs and failures per hook event (one absent here never fired; Copilot
names them userPromptSubmitted, agentStop for Stop). 2: the failure
messages. 3: tool calls a hook denied. 4: every model the session used, a
subagent's too. Then copilot plugin list --json: its loci row is the
INSTALLED copy (a --plugin-dir session has none, or a stale disabled one);
the context's plugin dir: is the copy running — record both when they differ.
Add the last 20 lines of ${LOCI_STATE_DIR:-$HOME/.loci/state}/loci.log
(dev or fail-fast mode) and loci-cli-status.json beside it. Copilot
asks before a tool touches a path outside the project — the plugin dir,
~/.loci, ~/.copilot — and in -p mode nobody can answer: record such a
refusal as "not permitted", not as a LOCI finding.
For each check, record status (PASS / FAIL) and a detail string.
| # | Check | How to test | PASS when |
|---|---|---|---|
| 1 | loci CLI available & signed in | command -v loci resolves AND loci auth status exits 0 (data.status == "signed_in") | loci on PATH and signed in |
| 2 | Project context exists | <project-context> (keyed file) exists and contains project_root | File exists with key |
| 3 | Compiler recorded | compiler field in <project-context> is not unknown, null or empty (recipe-only since T14: the session no longer scans PATH) | Has a value |
| 4 | LOCI target supported | loci_target in <project-context> | One of aarch64, neoverse-v2, armv7e-m, armv6-m, tc399 |
| 5 | loci CLI healthy | loci doctor exits 0 and data.healthy is true (covers Python 3.12, asmslicer, analysis deps, c++filt, the Rust demangler, cross-compilers, credential store, state dir; on a container-toolchain recipe also the engine-* checks) | Exit 0 / healthy |
| 6 | Build artifacts exist | Read artifact from <project-context> (the recipe's own, written by loci init); fall back to a glob for **/*.o under the one build root, .loci/build/ — skipping turns/, cargo/, dumps/ (and the pre-rename elf/) and every .loci-stage-*/ directory at any depth — or any .elf/.o/.axf in the project root. A .loci-build/ beside it is a pre-move CLI's leftover and is not searched | At least one found |
| 7 | Analysed artifact is not stale | For each candidate from check 6 (cap at 5, newest first) run loci build fresh --elf <path> and read .data.role before .data.stale + .data.sources_newer | No candidate reports stale: true, unless its role is exactly "baseline" |
| 8 | session-init executable | test -x <plugin-dir>/hooks/session-init.sh | Exit code 0 |
| 9 | hooks.json valid | Read <plugin-dir>/hooks/hooks.json — it parses as JSON and its hooks key holds the event arrays; under Copilot item 17's per-event counts go in the detail | Valid JSON |
| 10 | Quota not exceeded | If check 1 passed (signed in), run loci usage and read data.eligible / data.daily ({used, limit}). | data.eligible is true |
Check 7: "the results are wrong" is most often "the results describe a
different binary". Record, per candidate, the artifact path, its elf_mtime, role,
stale, and the first entry of sources_newer (path + newer_by_s), so a
"results are wrong" report arrives with the artifact/source delta already computed
instead of needing a round trip. A stale: null is not a FAIL — record it with
its reason (usually no -g, or built on another machine).
role decides what stale: true means, so read it first. A baseline is older
than its sources by construction, so role: "baseline" with stale: true is
the healthy state and never a FAIL. Record
it as baseline (expected). Two kinds of artifact answer baseline: a .prev
written by loci build snapshot, and anything under either root's turns/, which
is where loci build compile --baseline reconstructs a header edit's Before. The
envelope's recommendation agrees; for a stale baseline it is never "rebuild"
(that destroys the Before).
A MISSING role is a FAIL, not an exemption. The field postdates the CLI
version the plugin currently pins, so on an un-upgraded install .data.role is
absent on every artifact. Phrasing the criterion as "no candidate whose role is
measured reports stale: true" would therefore be satisfied vacuously on
exactly the installs most likely to have the problem — a demonstrably stale object
recorded as PASS. Only the literal string "baseline" exempts a candidate; absent,
null, or anything else is treated as measured and a stale: true FAILs.
Check 6's glob skips turns/ for the same reason: everything under it is a Before.
And why it skips .loci-stage-*/. loci build compile writes its object into
a private .loci-stage-<x>/ beside the destination and renames it out; a killed
compile leaves that directory behind holding a <stem>.o newer than every real
object, so an unpruned glob reports it as the artifact and loci build clean
deletes it under the next check. Prune it at every depth. The prune list is
loci build clean's own, so the fallback sees the project every other check does:
cargo/ is LOCI's private CARGO_TARGET_DIR, dumps/ holds text dumps.
Checks 3, 4 and 6 move together, and the pattern is the finding. Since
T14 the session writes nothing about a project's build — no scan runs — so
compiler, loci_target and artifact are all loci init's
and stand or fall with the recipe. Three shapes, each a different finding:
init_status: ok — a recipe governs; each check judges
its own value.init_status absent or uninitialized — no recipe yet.
Checks 3, 4 and 6 fail together and that is ONE finding — the project is not
initialized — said once, citing step 1's snapshot; /loci:init <project_root> adopts
it.init_status is unsupported or needs_user — init
stopped before recording anything, and the finding is init_status.compiler is null beside a .loci/build.yaml on disk — loci init wrote
the file with its no-recipe branch, so init_status is failed. Check 3
fails while a recipe exists; the finding is the failed init, and null (no
recipe behind it) is a different signal from "unknown" (a recipe that names
no compiler) and from absent (nothing wrote it).If loci is not on PATH, checks 5, 7 and 10 automatically FAIL (the analysis
stack lives inside the CLI; loci doctor reports the specific missing piece).
If check 1 failed (not signed in), check 10 — the only check that reaches the
backend — automatically FAILs with "not signed in — cannot check quota".
Run via Bash (skip if loci is unavailable):
loci stats summary --context-file "<project-context>"
loci stats global-summary
Record data.report from each, or the reason it did not run: both verbs need a
session, so a signed-out run records "stats unavailable — not signed in", which is
a different finding from "stats unavailable — loci not working".
This is the most important section. Analyze the session context and diagnostics to determine what went wrong. Write this as free-form reasoning (not templated) so it captures the actual session state.
If the user's issue is that a LOCI skill should have triggered but didn't, investigate:
Prompt match — compare the user's original prompt against each relevant
skill's triggers: its description (all Copilot reads) and, under Claude
Code, when_to_use too. List the keywords and note which matched or didn't.
Auto-run conditions — for auto-triggered skills:
loci-post-edit: Was the edited file a C/C++/Rust/Go/Python source
(.c, .cc, .cpp, .cxx, .c++, .rs, .go, .py, .pyx, .h, .hpp, .hxx, .h++, .hh, .inc, .ipp, .tcc, .inl, .tpp, .def)? Was an Edit/Write
tool used?loci-preflight: Was the session in plan mode when the user described
new logic?Skill visibility — is the skill listed in the Available: line of the
LOCI session context (session-init's list)? If not, session-init may not have
registered it.
Deferred tools — check if loci:loci-post-edit, loci:loci-preflight,
loci:trends, etc. appear in the host's skill list.
If absent, the plugin may not be loaded.
Competing behavior — did the model answer directly instead of invoking the skill? Did another skill or tool pre-empt? Note what it did instead.
If a skill ran but produced no results, wrong results, or results that weren't used, investigate:
Which binary was measured, and was it current? Check this first — it is the
cheapest explanation for "the numbers are wrong" and the one that has actually
happened. Take check 7's output: if the artifact the skill analysed reports
stale: true, the numbers describe a program that is no longer on disk, and
nothing downstream needs investigating. Two shapes to separate:
.o, whole-program question — a relocatable object's call edges are
unapplied relocations, so a worst-case depth or a cross-call timing measured
from a .o collapses to the single function, with has_unknown_callees: false
and no warning. Correct artifact, wrong scope. Check the report's Artifact:
provenance line for which of the two it was; if that line is
missing altogether, record that as the finding.Recipe: line reads unvalidated, or that carried a flag_source_v2
warning about a flags.json mode: "replace" pin used instead of the
recipe, measured a build the project does not make. Step 1's snapshot shows
it.Compilation — did the compilation step succeed? Look for compiler errors,
missing headers, wrong flags. Do not go hunting for the compiler: a recipe
naming one this machine does not have answers compiler_missing, whose one
recovery is /loci:init --refresh, and the envelope says so. Record the
error.code the compile returned; it is the diagnosis.
loci elf output — did loci elf asm or loci elf cfg return an
{"ok":true,"data":…} envelope? Common failures: function name not found in
binary, architecture mismatch between ELF and LOCI target, empty output, or
an {"ok":false,"error":…} envelope (read error.message). Re-run with
LOCI_DEBUG=1 to see leaked third-party text (captured stdout is forwarded
to stderr). On Windows, also confirm the caller did not
merge streams with 2>&1 > file — stderr diagnostics before the JSON would
produce the same symptom.
loci timing response — did loci timing return timing/energy data?
Common failures: backend timeout, auth_required (token expired
mid-session — re-run ! loci login), quota_exceeded, server error, empty
data.rows.
Result parsing — were data.timing_csv / data.timing_architecture (from
loci elf asm) or execution_time_ns (from loci timing) present? If loci
returned data but the model didn't use it, note the gap.
Delta comparison — for post-edit: did the compile report a baseline, i.e.
was data.output_prev present (equivalently, does prepare's provenance[]
line carry a before)? Ask it that way round, not "does a .o.prev
file exist": a .prev can sit on disk and still be correctly withheld —
built from a different source, or with different flags, or captured for another
turn — and any accompanying NOTE says which, as does the compile envelope's own
data.baseline_withheld ({code, reason}) on a CLI new enough to report one.
Record the code when you have it: it is the CLI's verdict on the candidate it
actually examined, and it is what separates a deliberate refusal from a capture
that never happened (not_captured). Finding the file and concluding a
baseline existed turns a working refusal into a filed defect. Then: did
loci elf diff return 0 changed functions? That is not the same as "the
binary didn't change" — the differ hashes masked instructions, so a constant-only
edit produces an empty diff, and data.summary.removed can be non-zero while the
changed-function list is empty. Read data.summary, and see
Diffing the pair before recording
an empty diff as either a defect or a clean run.
Output suppression — did the model generate analysis but fail to present it? (Context window pressure, interrupted response, tool call error.)
The analysis stack lives in the loci CLI (a uv tool on PATH), installed by
session-init.sh at SessionStart. If the user just upgraded the plugin or
installed fresh and analysis broke, check:
command -v loci resolve? If not, session-init's CLI install may have
failed (offline, uv missing) — /loci:setup reinstalls it.loci doctor report data.healthy: true? A fail on the asmslicer
or python probe means the CLI's own environment is broken — /loci:setup
reinstalls it. Warnings (c++filt, cross-compilers, signed-out) are
non-fatal. A fail on an engine-* check is the container
toolchain being unreachable — its detail names the fix (start the daemon, pull
the image, start the container), and a reinstall changes nothing.Based on the diagnostics and reasoning above, state the root cause. Use the dependency chain to find the most upstream failure:
hooks → loci CLI install → sign-in → project-context → loci timing → compilation → analysis
Under Copilot the chain starts at item 17: hooks failing Hook command failed … /hooks/<name>.sh: No such file or directory and tool calls ending
Denied by preToolUse hook from "loci" (hook errored) are the launcher never
starting — a plugin before v0.2.69 ran bash "$CLAUDE_PLUGIN_ROOT/…", which
Copilot's PowerShell hands to bash with the variable empty; the fix is the
current plugin. The copy that ran need not be the one running now: item 17's
registry row says which versions are installed.
If all 10 checks pass, the issue is likely:
loci timing backend timeoutDetermine the output filename:
report-<YYYY-MM-DD>-<os-short>.md
Write the file to the current working directory using this structure:
# LOCI Diagnostic Report
Generated: <YYYY-MM-DD HH:MM:SS UTC>
## Versions
| Component | Version |
|-----------|---------|
| Host | <host and version, from step 1> |
| Model | <model ID, e.g. claude-opus-4-7> |
| LOCI plugin | <plugin version from plugin.json> |
| loci CLI | <loci --version output, or "unknown"> |
| OS | <uname -a output> |
## User Description
<user-description>
## Environment
| Field | Value |
|-------|-------|
| Project root | <project_root or cwd> |
| Git branch | <branch> |
| Compiler | <compiler or "unknown"> |
| Build system | <build_system or "unknown"> |
| LOCI target | <loci_target or "unknown"> |
| Auth status | <signed in / not signed in> |
| loci CLI | <path from `command -v loci`, or "unavailable"> |
| LOCI_STATE_DIR | <resolved path> |
| init_status | <from `<project-context>`, or "absent"> |
| Recipe | <`recipe.path`, or "none — `initialized: false`", or the `recipe_untrusted` string verbatim> |
| Recipe validated | <tier + `confirmed_by_user`, or "n/a"> |
| Recipe escrow | <`ok` / `missing` / "n/a — no recipe"> |
| Toolchain | <"this machine", or the recipe's `build.exec` engine and image/container, or "n/a — no recipe"> |
## Diagnostics Checklist
| # | Check | Status | Detail |
|---|-------|--------|--------|
| 1 | loci CLI available & signed in | <PASS/FAIL> | <detail> |
| 2 | Project context exists | <PASS/FAIL> | <detail> |
| 3 | Compiler recorded | <PASS/FAIL> | <detail> |
| 4 | LOCI target supported | <PASS/FAIL> | <detail> |
| 5 | loci CLI healthy | <PASS/FAIL> | <detail> |
| 6 | Build artifacts exist | <PASS/FAIL> | <detail> |
| 7 | Analysed artifact is not stale | <PASS/FAIL> | <detail, e.g. "kernel.elf stale — blink.c 225s newer" or "3 candidates current" or "unverified: no DWARF"> |
| 8 | session-init executable | <PASS/FAIL> | <detail> |
| 9 | hooks.json valid | <PASS/FAIL> | <detail; under Copilot "<n> entries; ran …, failed …, denied …"> |
| 10 | Quota not exceeded | <PASS/FAIL> | <detail, e.g. "18,000 / 30,000 daily tokens (free)" or "LIMIT REACHED — 35,000 / 30,000"> |
**Result: <N>/10 checks passed.**
## Reasoning
### What the user was trying to do
<describe the intent and expected behavior>
### What should have happened
<which skill should have triggered, with its trigger conditions>
### What actually happened
<what the model did instead — answered directly, wrong skill, error, silence>
### Why it failed
<root cause reasoning chain, referencing specific checklist failures>
### Skill trigger analysis
<for each relevant skill, did the trigger conditions match?>
## Diagnosis
**Root cause:** <one-sentence root cause>
**Contributing factors:** <any additional FAIL checks>
**Suggested fix:**
<numbered actionable steps to resolve>
## Stats
### Branch stats
<loci stats summary `data.report`, or "no stats recorded">
### Global stats
<loci stats global-summary `data.report`, or "no stats recorded">
## Raw Data
<details>
<summary>project context (`<project-context>` keyed file)</summary>
```json
<sanitized contents or "MISSING">
<`loci init probe` .data — `initialized`, the `recipe` block and
`recipe_untrusted` ONLY; or "loci init probe unavailable (CLI predates the
recipe)". Do not paste the whole envelope: its `sources` and `compilers[].path`
are absolute paths across the user's machine, and this file is written to be
shared.>
<`loci doctor` data.report, or "loci not on PATH">
<sanitized contents or "MISSING">
<the fence's four outputs, the `copilot plugin list --json` row and loci.log's
tail — or "n/a — Claude Code">
<`loci auth status` output — signed-in / signed-out>
<git log --oneline -3 output>
Before embedding any file contents in the Raw Data section above, sanitize them in-memory:
Bearer ..., Authorization: ..., private key blocks)
with [REDACTED]./Users/<name>/, /home/<name>/, C:\Users\<name>\) with ~/.Apply substitutions BEFORE writing the report. Do NOT write unsanitized contents and edit afterward.
After writing the report file, display a concise summary:
## LOCI Diagnostic Summary
<N>/10 checks passed.
**Root cause:** <one-sentence diagnosis>
**Suggested fix:**
<numbered steps>
Share this file when reporting issues, or open it in a new
session for further investigation.
─── LOCI · bug-report ─────────────────
Report: <absolute-path-to-report-file>
────────────────────────────────────────
The report file path MUST appear in the footer as the last visible output. Use the absolute path so the user can copy-paste it directly.
Do NOT record stats for this skill (diagnostic/informational only). Do NOT emit a LOCI voice remark (inappropriate for failure context).
What SKILL.md sets; muted values are Claude Code's defaults
Also "exec-trace didn't run", "skill didn't trigger", "results are wrong", "results missing", "generate diagnostic".
Other plugins' skills for the same job
npx claudepluginhub auroralabs-loci/loci-claude --plugin loci12 skills in this plugin
/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.
/exec-traceAnalyze function execution timing and energy from compiled assembly. Use for the timing or energy of a specific function ("how long does X take", "exec trace"); a limit stated in the request is judged here, and a standing bound is authored by /loci:contract.
/helpQuick-reference guide to LOCI — shows available skills, environment status, and troubleshooting for initialization and sign-in issues. Use when the user asks for help with LOCI, what LOCI can do, how to use it, which LOCI commands exist, or seems confused about LOCI setup or capabilities.
/initRecord how this project builds — one machine-local recipe (`.loci/build.yaml`) naming the target ISA, the compiler, the build system and the artifact — and the clock its board runs at, so every LOCI measurement compiles and times the way the project itself does. Use on /loci:init, "initialize LOCI", "set up this project for LOCI", "switch the LOCI target" or "LOCI says this project is not initialized", or a LOCI analysis failed with a recipe-related `error.code` on a project that already has a recipe.
/loci-post-editCompare pre-edit and post-edit compiled artifacts to report execution timing % diff, energy consumption, and control-flow analysis. MANDATORY: invoke IMMEDIATELY when the `[loci] <file> was modified … You MUST invoke` reminder appears after an Edit/Write; also "analyze the change", "measure the edit", "timing diff".