/harness-anchor:docs-lookupfrom harness-anchor
Looks up unfamiliar tools, APIs, errors, and library behavior using a fallback chain: Context7 MCP, then WebSearch, then calibrated uncertainty. Prevents guessing.
Ships in harness-anchor. 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.
When you need authoritative information about an unfamiliar tool / API / error message / library behavior, follow this fallback chain. Each step has explicit success and failure criteria so the agent never silently degrades to guessing.
Step 1: Structured docs MCP (Context7; or Microsoft Learn for .NET/Azure/Windows/MSVC)
↓ (unavailable / no match / wrong content / tool error)
Step 2: WebSearch (broader web, recent ecosystem changes)
↓ (unavailable / no useful results / paywalled)
Step 3: Calibrated uncertainty (tell user what you tried + what's needed)
You do not skip steps. If Step 1 fails, you go to Step 2. If Step 2 fails, you go to Step 3. You do NOT retry Step 1 with the same query hoping for a different answer.
When it's the right tool: API references, configuration options, well-known libraries (React, CMake, Clang, etc.), version-specific behavior.
Two-call usage (typical Context7 / Microsoft Docs MCP shapes):
1. resolve-library-id(library_name) → canonical id, e.g. /llvm/clang
2. get-library-docs(id, topic="<question>") → structured snippet + citation URL
(Tool names vary by harness: mcp__Context7__*, mcp__plugin_context7_context7__*, mcp__73bcda44-…__query-docs, etc. Use whatever resolves to "Context7" in your tool inventory.)
First-party ecosystem docs MCP — prefer it over Context7 when the topic matches. Context7 is the general default for libraries, but if the question is about a specific vendor ecosystem and that vendor's docs MCP is in your inventory, it is higher-signal (first-party). The prime example: Microsoft Learn (microsoft_docs_search → microsoft_docs_fetch; microsoft_code_sample_search for snippets) for .NET / Azure / Windows / MSVC / Win32 topics — including MSVC compiler errors and Windows-SDK headers in C/C++ work. Same two-call shape (search → fetch) and the same failure-mode handling below; if it is absent or returns nothing useful, fall through to Context7 → WebSearch as normal. (General principle — prefer the first-party MCP for its ecosystem; not a hard dependency.)
Context7 "doesn't work" — what to watch for:
| Failure mode | Signal | Action |
|---|---|---|
| MCP server not connected | Context7 tools absent from your tool inventory | Go to Step 2 |
| Library not indexed | resolve-library-id returns [] or "no match" | Go to Step 2 |
| Returned wrong library | Excerpt mentions a different product than asked | Re-query with a more specific name once, then Step 2 |
| Returned irrelevant snippet | Snippet doesn't mention your error / option / API | Reformulate topic once, then Step 2 |
| Tool errors out | Non-zero / "error:" reply | Step 2 (don't retry the same call) |
| Returns very old version | Stated version is older than your project's | Useful as baseline; confirm with WebSearch for recent changes |
Do not retry the same query multiple times — Context7 is deterministic for a given input. One retry with a refined query is allowed; further iteration is the agent thrashing.
When it's the right tool:
Query construction rules:
| Goal | Pattern |
|---|---|
| Exact-error lookup | "<paste error string in quotes>" + tool name |
| Tool config option | <tool> <option-name> documentation |
| Recent ecosystem | <library> <feature> 2026 |
| Comparison | <lib-A> vs <lib-B> <year> |
Source quality (descending trust):
WebSearch "doesn't work":
| Failure mode | Signal | Action |
|---|---|---|
| Tool not available | WebSearch absent from tool inventory | Skip to Step 3 |
| Returns paywall / login walls | Excerpts mention sign-up / 403 | Try one more query variant, then Step 3 |
| All hits are AI-generated junk | Suspiciously polished, no concrete details, no source | Step 3 — don't trust |
| No results | Empty / "no results found" | Reformulate once, then Step 3 |
When external lookup fails, do not guess. State explicitly what you tried and what you'd need:
"I looked up
<topic>via Context7 (not loaded / returned no match for<query>) and WebSearch (no useful results / returned only AI-generated content). I am uncertain about<specific question>. To proceed I would need:<the specific input from you, e.g. output of \cmake --version`, or a link to the right docs, or permission to try option X cautiously>`."
This earns user trust. Guessing destroys it. The terminal fallback exists because pretending to know is the highest-cost agent failure mode.
When you DO find an answer, cite the source:
"Per Context7 (
clang-tidy v18 docs):bugprone-easily-swappable-parametersflags adjacent params of the same type that could be confused at call sites. Tuning option:MinimumLength(default 2)."
"Per WebSearch (Stack Overflow answer with 47 upvotes, accepted Aug 2025): the fix is
set(CMAKE_POLICY_DEFAULT_CMP0148 NEW)beforefind_package(Python)."
The citation makes your claim falsifiable — the user can verify. Unsourced confidence is worse than sourced uncertainty.
project-indexing to find local files first)self-correction-loop — when a tool error needs context, this skill is the lookup stepanti-hallucination-gates — the citation from this skill becomes part of evidenceproject-indexing — for internal lookups (when info is in your repo, not on the web)cpp-* skills — domain entry points; they delegate the lookup procedure hereWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub redtropig/harness-anchor --plugin harness-anchor14 skills in this plugin
/anti-hallucination-gatesUse before claiming done/fixed/passing — or before asserting something is absent: not installed, not available, no such function, couldn't find it. Default-FAIL runs both ways — every claim needs an evidence path. A negative claim must carry its search scope and observation date; state calibrated uncertainty when evidence is missing./capturing-golden-rulesUse when the same mistake or bad pattern recurs, when a code-review comment is really a convention worth enforcing, or when you catch AI-generated drift/slop and want it to never happen again. Encodes the lesson as a durable rule in golden-rules.md — the feedback-flywheel / harness-layer-learning ratchet — instead of a one-off fix. Generic (language-agnostic)./context-budget-disciplineUse when sessions run long, adding subagents, fetching large files, or planning context-heavy work. SELECT/WRITE/COMPRESS/ISOLATE discipline./cpp-build-systemsUse in C/C++ projects for build configure/errors, compile_commands.json generation, or selecting CMake/Meson/Make/Bazel commands./cpp-formattingUse in C/C++ projects for clang-format. Changed-lines-only; never reformat unchanged code mid-feature. .clang-format from root or LLVM baseline./cpp-sanitizersUse in C/C++ projects for crashes, hangs, UB, data races, memory errors. ASan/UBSan/TSan runtime checks. Build sanitizer config separately.Other plugins' skills for the same job