USE WHEN: needing real code examples from GitHub, finding API usage patterns, looking up framework setup, verifying library implementations, eliminating hallucinations with working code. DO NOT USE WHEN: working on proprietary code, questions about the current codebase, or when local context is sufficient. Requires Exa API key configured in environment.
View on GitHubmahidalhan/claude-hacks
exa-code-context
January 22, 2026
Select agents to install to:
npx add-skill https://github.com/mahidalhan/claude-hacks/blob/main/skills/exa-code-context/skills/exa-code-context/SKILL.md -a claude-code --skill exa-code-contextInstallation paths:
.claude/skills/exa-code-context/# Exa Code Context
## Overview
Exa Code Context is a powerful tool for finding relevant code snippets and examples from the open source community. It searches over billions of GitHub repos, documentation pages, Stack Overflow posts, and more to find perfect, token-efficient context that helps write correct code.
This skill eliminates hallucinations in coding tasks by providing real, working code examples instead of made-up patterns.
## When to Use This Skill
Use this skill when:
- Looking for real-world usage examples of a library or framework
- Need correct API syntax for a specific SDK or service
- Setting up development environments or project configurations
- Finding authentication, middleware, or architectural patterns
- Understanding how to use specific programming language features
- Searching for best practices and common implementations
**Example triggers**:
- "How do I use React hooks for state management?"
- "Show me FastAPI async endpoint examples with dependencies"
- "What's the correct syntax for pandas dataframe filtering?"
- "How to set up Next.js 14 app router with TypeScript?"
- "Express.js middleware patterns for authentication"
## Quick Start
The skill provides a Python script that interfaces with the Exa Context API:
```python
from scripts.get_code_context import get_code_context
# Simple usage - automatic token optimization
result = get_code_context("React hooks for state management")
print(result["response"])
# Specify token count for more/less context
result = get_code_context("pandas dataframe filtering", tokens_num=5000)
print(result["response"])
```
**Command-line usage**:
```bash
python scripts/get_code_context.py "React hooks for state management"
python scripts/get_code_context.py "FastAPI async endpoints" 5000
```
## Common Use Cases
### 1. Framework Usage
Find practical examples of how frameworks are used in real projects:
**Query**: "use Exa search in python and make sure content is always livecrawled"
Returns actual