Use when analyzing code repositories, understanding codebases, cross-repo analysis, debugging unfamiliar code, or when the user asks about code structure, dependencies, "how does X work", "where is Y implemented", or impact analysis in any repository
FastCode is a token-efficient framework for repository-level code understanding from HKUDS, providing 3-4x faster analysis with 44-55% cost reduction through hybrid retrieval (semantic + keyword + graph-based).
Location: /project/FastCode
Use FastCode when you need to:
cd /project/FastCode
pip install -r requirements.txt
# Set environment variables
export OPENAI_API_KEY="your-key"
export MODEL="gpt-4-turbo"
export BASE_URL="https://api.openai.com/v1"
Add to your Claude Code MCP settings:
{
"mcpServers": {
"fastcode": {
"command": "python",
"args": ["/project/FastCode/mcp_server.py"],
"env": {
"MODEL": "gpt-4-turbo",
"BASE_URL": "https://api.openai.com/v1",
"OPENAI_API_KEY": "your-key"
}
}
}
}
| Tool | Purpose |
|------|---------|
| code_qa(question, repos, multi_turn, session_id) | Query codebase with natural language |
| list_sessions() | List conversation sessions |
| get_session_history(session_id) | Get session history |
| delete_session(session_id) | Delete a session |
| list_indexed_repos() | List indexed repositories |
| delete_repo_metadata(repo_name) | Clean up repo metadata |
Use the code_qa tool:
- question: "How does authentication work?"
- repos: ["https://github.com/user/repo"] or ["/local/path"]
- multi_turn: true (for context persistence)
- session_id: "optional-session-id"
Query across multiple repos:
- question: "How do auth systems differ between services?"
- repos: ["auth-service", "user-service", "api-gateway"]
- multi_turn: true
Use consistent session_id for follow-up questions to maintain context:
1. First query: session_id="analysis-1"
2. Follow-up: session_id="analysis-1" (retains context)
from fastcode import FastCode
fc = FastCode(config_path="/project/FastCode/config/config.yaml")
fc.load_repository("https://github.com/user/repo", is_url=True)
fc.index_repository()
result = fc.query("How does X work?", multi_turn=True)
code_qa:
question: "Trace the authentication flow from login to token validation"
repos: ["/project/target-repo"]
code_qa:
question: "What would break if I change the User model schema?"
repos: ["/project/target-repo"]
code_qa:
question: "Where is the payment processing logic implemented?"
repos: ["/project/target-repo"]
Python, JavaScript, TypeScript, Java, Go, C/C++, Rust, C#
| Issue | Solution |
|-------|----------|
| Repository not indexing | Check supported extensions in config/config.yaml |
| Empty results | Ensure repo is indexed first (auto-indexes on first query) |
| API errors | Verify OPENAI_API_KEY, MODEL, BASE_URL are set |
| Slow first query | Initial indexing takes time; subsequent queries are fast |
Edit /project/FastCode/config/config.yaml for:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer