Look up current library documentation, API references, and code examples via Context7 (ctx7 CLI or MCP server); update checks CLI/upstream drift. Use when: 'look up the docs for X', 'how do I migrate to X v2', or asking about library, framework, SDK, CLI, or cloud API syntax, config, or migration. Not for ctx7/MCP setup or auth: /context7:setup.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Lookup?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/melodic-software-lookup)
---
description: "Look up current library documentation, API references, and code examples via Context7 (ctx7 CLI or MCP server); update checks CLI/upstream drift. Use when: 'look up the docs for X', 'how do I migrate to X v2', or asking about library, framework, SDK, CLI, or cloud API syntax, config, or migration. Not for ctx7/MCP setup or auth: /context7:setup."
argument-hint: "[lookup <library> <query>|update]"
user-invocable: true
disable-model-invocation: false
allowed-tools:
- "Bash(ctx7 --version*)"
- 'Bash(node "${CLAUDE_PLUGIN_ROOT}/lib/prerequisites.mjs" latest "${CLAUDE_PLUGIN_ROOT}" --for skill:lookup --data-dir "${CLAUDE_PLUGIN_DATA}")'
- 'Bash(node ${CLAUDE_PLUGIN_ROOT}/lib/prerequisites.mjs latest ${CLAUDE_PLUGIN_ROOT} --for skill:lookup --data-dir ${CLAUDE_PLUGIN_DATA})'
metadata:
upstream-version: upstash/context7@17839096a0efe61b4b8a88cc20a8147784234cfa
synced: 2026-11-27
workflow-stage: research
summary: Look up current library docs, API references, and examples via Context7
shell: bash
---
# Lookup
**Arguments.** `[lookup <library> <query>|update]`. A bare argument is `lookup`, e.g. /context7:lookup react "useEffect cleanup".
## Pre-computed context
Installed CLI version: !`ctx7 --version 2>/dev/null || echo "not installed (run: npm install -g ctx7@latest)"`
Latest release, checked at most once a day: !`node "${CLAUDE_PLUGIN_ROOT}/lib/prerequisites.mjs" latest "${CLAUDE_PLUGIN_ROOT}" --for skill:lookup --data-dir "${CLAUDE_PLUGIN_DATA}" || echo "not checked (node did not run)"`
When that line names a newer release or a missing CLI, tell the user once. Add the update hint after this colon when one is set, and nothing when it is empty or still a placeholder: ${user_config.cli_update_hint}
MCP availability: if `mcp__context7__resolve-library-id` and `mcp__context7__query-docs` are in your tool list, the MCP path is configured.
## Actions
| Action | When | Loads |
|---|---|---|
| `lookup <library> <query>` (default) | A question about a library | [context/lookup.md](context/lookup.md): query writing, result selection, versioned lookups, common mistakes |
| `update` | CLI upgrade and upstream drift check | [context/update.md](context/update.md): merge strategy, what to preserve, baseline refresh |
Verify library behavior against Context7 before stating it; training data lags library releases. CLI install, `CONTEXT7_API_KEY` auth and MCP wiring belong to `/context7:setup`.
## Lookup
Resolve the name to a Context7 library ID, then fetch docs with that ID:
```bash
ctx7 library "<name>" "<question>"
MSYS_NO_PATHCONV=1 ctx7 docs "<libraryId>" "<question>"
```
Or through the MCP server, when configured: `mcp__context7__resolve-library-id`, then
`mcp__context7__query-docs` with the resolved ID.
- **Pointer**: for each MCP tool's parameters, fetch
[Context7: MCP Tools](https://github.com/upstash/context7#mcp-tools) live.
- Always resolve first; the docs step rejects anything but a resolved ID, unless the user supplied one in `/org/project` form.
- One concept per query; run a separate lookup per independent topic, and at most 3 lookup commands per topic. When Context7 does not cover it, answer from training knowledge and say so.
- Never put API keys, passwords or other credentials in a query: it is sent to the Context7 backend.
- Keep the two steps above as the default. `ctx7 search "<question>"` is an option for a question that spans several libraries or names none, only when `ctx7 --help` lists it. When to choose it and where its behavior is read: [context/cli.md](context/cli.md#commands).
Both paths read the same backend. Prefer the MCP server for conversational lookups: it returns clean markdown, needs no `MSYS_NO_PATHCONV`, and is discoverable from your tool list ([context/mcp.md](context/mcp.md)). Use the CLI to pipe or save output (`grep`, `jq`, `> docs.md`), in scripts and loops, for `--json` extraction, or when no MCP server is configured or `mcp.context7.com` is blocked. Flags and errors: [context/cli.md](context/cli.md).
## Update
```bash
bash "${CLAUDE_PLUGIN_ROOT}/skills/lookup/scripts/update.sh" # report only
bash "${CLAUDE_PLUGIN_ROOT}/skills/lookup/scripts/update.sh" --fix # also upgrade the CLI
```
The script reports installed vs latest `ctx7` and diffs upstream `find-docs` and `context7-cli` against the `vendor/` baselines. It exits 0 for no drift, 1 for drift and 2 when a check could not run; a `ctx7` that is not installed is reported, not counted as drift. It never rewrites this skill: the update is advisory, the user approves every port, and this skill's own additions (Windows prefix, CLI-vs-MCP guidance, action dispatch) are kept. Read `vendor/` only during `update`, never for a lookup. Protocol: [context/update.md](context/update.md).
## Spoke paths
The `context/` files write this skill's directory as `<skill-dir>`, which is `${CLAUDE_SKILL_DIR}`.
Put that path in place of the placeholder before running a command or writing it into a brief;
never hand a `${…}` token from those files to the Bash tool.
- **Pointer**: when deciding where a `${…}` reference resolves and what the Bash tool's environment
carries, fetch
[Where each variable resolves](https://code.claude.com/docs/en/plugins/manifest-reference#where-each-variable-resolves)
live.
## Related
- Multi-source or cross-checked technical questions: /discovery:research.
- Verbatim read of a named upstream docs page: /discovery:read-docs.
## Gotchas
- **Windows Git Bash** rewrites `ctx7 docs /org/project` into `C:/Program Files/Git/org/project`. Always prefix `ctx7 docs`, and `ctx7 search --library /org/project`, with `MSYS_NO_PATHCONV=1`; `ctx7 library` is unaffected. Detail: [context/cli.md](context/cli.md).
- **Pointer**: for how an MSYS2-based shell rewrites a `/org/project` argument, see
[MSYS2: Automatic Unix ⟶ Windows Path Conversion](https://www.msys2.org/docs/filesystem-paths/#automatic-unix-windows-path-conversion).
- When the MCP server is configured, prefer it for conversational lookups. Which flags `ctx7 docs` takes is
[Context7 CLI § Query Library Documentation](https://context7.com/docs/clients/cli#query-library-documentation).
- Never run `ctx7 setup`, or `ctx7 skills install` if a guide names it: this plugin owns the lookup surface, and a second copy of Upstash's `find-docs` fragments lookups and drifts on its own.
- This skill retrieves library docs only. Architecture decisions and other questions that need cross-checked sources go to a research workflow.