Install the Expand Skill so agents know when and how to use Fetch.
The Expand Skill teaches your agent when to fetch live pages with Expand, reuse captured snapshots, search them for more context, and return citation links instead of falling back to raw HTML.
Authenticate once, then install the skill for your agent. Project scope is the default because it keeps the setup in the repo where the agent works.
expandai login
expandai skill install codex projectPick your agent. Both the host and the scope are required arguments.
| Agent | Project install | Recommended full setup |
|---|---|---|
| Claude Code |
expandai skill install claude-code project |
| Hook setup |
| Cursor | expandai skill install cursor project | Skill + MCP |
| Codex | expandai skill install codex project | Skill + MCP |
| OpenCode | expandai skill install opencode project | Hook setup |
Verify it works by asking the agent:
Use Expand to fetch https://news.ycombinator.com.
Show me the first 10 lines of Markdown and confirm the Fetch succeeded.The skill works on its own whenever your agent can run terminal commands. Add MCP when you want the agent to call Expand as native tools instead of shelling out. For Claude Code and OpenCode, the recommended full setup is a hook.
Run the command from your project root when you use project scope, so the files land next to the code the agent works on.
Global variants make the skill available across every project:
expandai skill install claude-code global
expandai skill install cursor global
expandai skill install codex global
expandai skill install opencode globalUse project scope when the setup should travel with one repository. Use global scope when you want the same skill in every project on your machine.
These three surfaces stack. The skill gives your agent instructions for using the Expand CLI from the shell. MCP gives it native Fetch tools. Hooks wire Expand into the host's own fetch behavior where the host supports it.
| Agent | Skill support | Recommended full setup | Why |
|---|---|---|---|
| Claude Code | yes | Hook | Routes the native WebFetch tool through Expand. |
| Cursor | yes | Skill + MCP | Skill teaches usage; MCP exposes direct tools. |
Skill alone is enough when your agent can run terminal commands. Add MCP when you want the agent to call Expand as native tools instead of shelling out. For Cursor and Codex, the full setup is Skill + MCP. For Claude Code and OpenCode, a hook is usually the best full setup because it upgrades the host's own fetch behavior. Cursor and Codex do not have an Expand hook path.
Use expandai fetch <url> when the agent needs rendered page content instead of raw HTML. Expand renders the live page, so it handles SPAs and bot-protected sites that plain curl cannot.
expandai fetch https://docs.example.com/api
expandai fetch github.com/owner/repoUse JSON output when the agent needs the page metadata, Main Markdown, and State JSON together.
expandai fetch https://docs.example.com/api --format jsonIn object-mode output, the reusable snapshot handle is meta.snapshotId.
Use expandai search <snapshotId> "your query" to search a page that was already captured instead of fetching the same URL again. Expand calls this search experience Highlights.
expandai search <snapshotId> "pricing limits"
expandai search <snapshotId> "pricing limits" --format json --max-results 10 --min-score 0.5Use expandai fetch <url> --search "query" only for a one-shot fetch and search of a URL you have not captured yet. Once the agent has a snapshotId, prefer expandai search, which reuses the existing capture.
Search-backed claims should carry citation links. In text output, expandai search and expandai fetch --search print a public playground citation link above each snippet. MCP tool results expose citationUrl fields directly. The skill instructs the agent to return those links alongside any claim grounded in fetched content.
Start with Markdown. Reach for JSON, snapshot search, and referenced artifacts only when the task needs more than the main document. This keeps the agent's first read cheap and lets it pull detail on demand.
If Expand is not authenticated, the agent should ask the user to run expandai login rather than authenticating on the user's behalf.
expandai loginMost users never need these paths. Reach for them when the agent does not see the skill or when project versus global scope looks wrong.
| Agent | Project path | Global path |
|---|---|---|
| Claude Code | <project root>/.claude/skills/expandai/ | ~/.claude/skills/expandai/ |
| Cursor | <project root>/.cursor/skills/expandai/ | ~/.cursor/skills/expandai/ |
| Codex |
Codex uses .agents/skills/expandai/, not .codex/skills/expandai/.
Project-scoped skill files are written into the repository. Commit them only when the team wants Expand enabled for collaborators.
There is no separate expandai skill update command. Reinstall the skill to update it. The installer overwrites the existing Expand Skill directory for the selected host and scope.
expandai skill install codex projectUninstall removes the skill directory for that host and scope:
expandai skill uninstall codex project
expandai skill uninstall cursor globalSKILL.md exists at the expected path from the table above.Run expandai login in your terminal, then ask the agent to try again. A non-zero exit with Not authenticated means the CLI has no session.
Install MCP for Cursor, Codex, or another MCP-compatible client when you want the agent to call Expand tools directly instead of relying on shell commands.
expandai mcp install cursor project
expandai mcp install codex projectRead MCP Tools & Resources for the full tool list.
| Codex |
| yes |
| Skill + MCP |
| Skill teaches usage; MCP exposes direct tools. |
| OpenCode | yes | Hook | Routes native fetch through Expand. |
<project root>/.agents/skills/expandai/ |
~/.agents/skills/expandai/ |
| OpenCode | <project root>/.opencode/skills/expandai/ | ~/.config/opencode/skills/expandai/ |