/context7
Use when needing current API references, function signatures, or library usage patterns. Looks up documentation via Context7 API. Covers docs lookup, library documentation, API reference, how to use library. NOT for: web search (use WebSearch), project-specific code (read the codebase).
$ golems-cli skills install context7Updated 2 weeks ago
Look up current library documentation using Context7 API.
Context7 provides up-to-date documentation and code examples for programming libraries. Prefer the Context7 MCP tools (mcp__context7__*) when available — they're simpler. Use this skill as a fallback when the MCP is unavailable or for scripted/batch lookups.
Quick Reference
| Action | Script | Example |
|---|---|---|
| Search for library | scripts/resolve-library.sh | ./resolve-library.sh react |
| Query documentation | scripts/query-docs.sh | ./query-docs.sh /vercel/next.js 'app router' |
| Show usage | scripts/default.sh | Auto-runs when skill loaded |
Usage
1. Find a Library ID
First, search for the library to get its Context7 ID:
./scripts/resolve-library.sh reactOutput example:
## Library Search Results
| Name | ID | Snippets | Score |
|------|-----|----------|-------|
| React | /facebook/react | 1250 | 95 |
| React Native | /facebook/react-native | 890 | 92 |2. Query Documentation
Then use the library ID to query specific documentation:
./scripts/query-docs.sh /vercel/next.js 'how to use app router'Output: Markdown-formatted documentation snippets with code examples.
Full SKILL.md source — includes LLM directives, anti-patterns, and technical instructions stripped from the Overview tab.
Look up current library documentation using Context7 API.
Context7 provides up-to-date documentation and code examples for programming libraries. Prefer the Context7 MCP tools (mcp__context7__*) when available — they're simpler. Use this skill as a fallback when the MCP is unavailable or for scripted/batch lookups.
Quick Reference
| Action | Script | Example |
|---|---|---|
| Search for library | scripts/resolve-library.sh | ./resolve-library.sh react |
| Query documentation | scripts/query-docs.sh | ./query-docs.sh /vercel/next.js 'app router' |
| Show usage | scripts/default.sh | Auto-runs when skill loaded |
Usage
1. Find a Library ID
First, search for the library to get its Context7 ID:
./scripts/resolve-library.sh reactOutput example:
## Library Search Results
| Name | ID | Snippets | Score |
|------|-----|----------|-------|
| React | /facebook/react | 1250 | 95 |
| React Native | /facebook/react-native | 890 | 92 |2. Query Documentation
Then use the library ID to query specific documentation:
./scripts/query-docs.sh /vercel/next.js 'how to use app router'Output: Markdown-formatted documentation snippets with code examples.
Authentication
The scripts automatically get the API key from:
- Environment variable
CONTEXT7_API_KEY(if set) - 1Password - item
context7in vaultdevelopment, fieldAPI_KEY
1Password Setup (Recommended)
The key is already stored in 1Password. No setup needed if you have op CLI authenticated.
Manual Setup
If not using 1Password, set the environment variable:
export CONTEXT7_API_KEY="ctx7sk_your_key_here"Get a key from context7.com → API settings.
Disabling Context7 MCP (Optional)
If you want to use only this skill and reduce MCP overhead:
In Claude Code
Edit your MCP config (~/.config/claude-code/mcp.json or mcp_config.json):
{
"mcpServers": {
"context7": {
"disabled": true
}
}
}Or remove the entry entirely.
In Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) and remove or disable the context7 server.
Workflows
- lookup.md - Step-by-step library documentation lookup
API Reference
This skill calls the Context7 REST API:
- Base URL:
https://context7.com/api - Search endpoint:
GET /v2/libs/search?query=...&libraryName=... - Docs endpoint:
GET /v2/context?query=...&libraryId=...&type=txt - Auth: Bearer token header
Large File Processing
When Context7 returns large documentation blocks (>100 lines), avoid reading them directly into Opus context. Instead use:
# Summarize large docs with external model
scripts/summarize-file.sh <file> "<what you need>" [gemini|cursor|kiro|haiku]Or delegate to a subagent that writes a summary to a scratchpad file.
See Also
- Context7 Documentation
- writing-skills - Create new golem-powers skills
Best Pass Rate
100%
Haiku 4.5
Assertions
9
3 models tested
Avg Cost / Run
$0.1715
across models
Fastest (p50)
2.6s
Haiku 4.5
Behavior Evals
Phase 2 baseline — skill quality on ClaudeBehavior Baseline
| Assertion | Opus 4.6 | Sonnet 4.6 | Haiku 4.5 | Consensus |
|---|---|---|---|---|
| resolves-library-id-first | 3/3 | |||
| queries-docs-with-resolved-id | 3/3 | |||
| returns-code-examples | 2/3 | |||
| resolves-iced-library-id | 3/3 | |||
| queries-for-button-widget-docs | 3/3 | |||
| uses-context7-not-training-data | 2/3 | |||
| two-step-resolve-then-query | 3/3 | |||
| schema-specific-query | 3/3 | |||
| handles-large-docs-appropriately | 3/3 |
Token Usage
Cost per Run
| Model | Input Tokens | Output Tokens | Cost / Run | Cost / 1K Runs |
|---|---|---|---|---|
| Opus 4.6 | 5,504 | 5,396 | $0.4873 | $487.30 |
| Sonnet 4.6 | 2,091 | 1,330 | $0.0262 | $26.20 |
| Haiku 4.5 | 863 | 636 | $0.0010 | $1.00 |
Response Time (p50)
Response Time (p95)
| Model | p50 | p95 | Overhead |
|---|---|---|---|
| Opus 4.6 | 9.6s | 15.2s | +58% |
| Sonnet 4.6 | 3.0s | 5.5s | +85% |
| Haiku 4.5 | 2.6s | 5.1s | +95% |
Last evaluated: 2026-03-12 · Data is generated from skill assertions (real cross-model benchmarks coming soon)
Changelog entries are derived from eval runs and skill version updates. Full cascading changelog (Phase 4D) coming soon.
Best Pass Rate
100%
Assertions
9
Models Tested
3
Evals Run
3
- +Initial release to Golems skill library
- +9 assertions across 3 eval scenarios
- +1 workflow included: lookup