context7

context7 is a skill for Claude Code from mishahanin/heading-os. It costs 102 tokens per session (874 once invoked), scanned A, original, Apache-2.0.

A documentation lookup tool that fetches current, version-specific guidance for software libraries and frameworks.

In plain words
What is it for?
Use it when you need accurate API references, code examples, or usage guidance for a library or framework.
Why use it?
It reduces the risk of relying on outdated training data or using an API incorrectly.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; mentions Claude Code.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mishahanin/heading-os/context7
Any agent
npx skills add mishahanin/heading-os --skill context7
Clone the repo
git clone --depth 1 https://github.com/mishahanin/heading-os

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context7

README.md
[![agentmods](https://agentmods.dev/badge/skills/mishahanin/heading-os/context7.svg)](https://agentmods.dev/skills/mishahanin/heading-os/context7)
Your own site
<a href="https://agentmods.dev/skills/mishahanin/heading-os/context7"><img src="https://agentmods.dev/badge/skills/mishahanin/heading-os/context7.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 874 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00102 $0.00874
Opus 5 $0.00051 $0.00437
Sonnet 5 $0.00020 $0.00175
Haiku 4.5 $0.00010 $0.00087

Measured 6d ago against content hash 6b6d28f2aa10, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

context7 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/context7.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/context7/SKILL.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context7 - Library Documentation

Fetch live, version-specific documentation for any library or framework via the Context7 REST API. Returns authoritative docs formatted for LLM consumption.

Naming note. A user-level Claude Code plugin also exposes a skill called context7:context7 (namespaced form). When the user types /context7 without the namespace, the local skill in this file wins per Claude Code's bare-name lookup precedence (local > plugin). To force the plugin variant, type the namespaced form explicitly. Both skills do similar things; the local one uses the workspace's own CONTEXT7_API_KEY and scripts/context7.py, the plugin uses its own MCP-style backend.

Prerequisites

CONTEXT7_API_KEY should be set in the workspace .env file. The script auto-loads it via python-dotenv.

# In the workspace root .env file:
CONTEXT7_API_KEY=ctx7sk-your-key-here

Get a free key at: https://context7.com/dashboard

The API works without a key but with lower rate limits.

Workflow

  1. Parse the user input: first word is the library name, remainder is the query. If only a library name is given, use "documentation" as the default query.

  2. Run the script:

python scripts/context7.py "<library_name>" "<query>"

Examples:

  • /context7 react hooks -> python scripts/context7.py "react" "hooks"
  • /context7 nextjs app router middleware -> python scripts/context7.py "nextjs" "app router middleware"
  • /context7 python-pptx -> python scripts/context7.py "python-pptx" "documentation"
  1. Use the returned documentation as authoritative context. Prefer it over training data when writing or validating code.

  2. If the library is not found, try alternative names (e.g., "next.js" instead of "nextjs", "react-dom" instead of "reactdom").

Script Flags

Flag Purpose
--list List matching libraries without fetching docs
--version v15 Pin to a specific library version
--json Output structured JSON instead of text
--limit 5000 Cap returned token count

Read the full file on GitHub · 82 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 82 lines · 102 tokens per session scan A 6b6d28f2aa10

Subscribe to this mod's changes

context7 is a skill published in the GitHub repository mishahanin/heading-os (11 stars, last pushed yesterday), licensed Apache-2.0. It adds 102 tokens to every session and 874 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.