[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74148":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},74148,"FastCode","HKUDS\u002FFastCode","HKUDS","\"FastCode: Accelerating and Streamlining Your Code Understanding\"","https:\u002F\u002Farxiv.org\u002Fabs\u002F2603.01012",null,"Python",2169,259,26,5,0,3,15,29.24,false,"main",[],"2026-06-12 02:03:22","\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"assets\u002FFastCode.svg\" alt=\"FastCode Logo\" width=\"200\"\u002F>\n\n\u003C!-- # FastCode -->\n\n### FastCode: Accelerating and Streamlining Your Code Understanding\n\n| **⚡ High Performance** | **💰 Cost Efficient** | **🚀 Fast & Scalable** |\n\n[![Python 3.12+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12+-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green.svg)](LICENSE)\n[![Code style: black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack)\n\u003Cp>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F1\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F💬WeChat-Group-07c160?style=for-the-badge&logo=wechat&logoColor=white&labelColor=1a1a2e\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F2\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F💬Feishu-Group-3370ff?style=for-the-badge&logo=bytedance&logoColor=white&labelColor=1a1a2e\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n[Features](#-why-fastcode) • [Quick Start](#-quick-start) • [Installation](#-installation) • [MCP Server](#mcp-server-use-in-cursor--claude-code--windsurf) • [Documentation](#-how-it-works)\n\n\u003C\u002Fdiv>\n\n---\n\n## 🎯 Why FastCode?\n\nFastCode is a token-efficient framework for comprehensive code understanding and analysis: delivering **superior speed**, **exceptional accuracy**, and **cost-effectiveness** for large-scale codebases and software architectures.\n\n🚀 **Superior Speed Advantage** - Runs 3x faster than Cursor and 4x faster than Claude Code.\n\n💰 **Significant Cost Savings** - Costs 55% less than Cursor and 44% less than Claude Code.\n\n⚡ **Highest Accuracy** - Outperforms Cursor and Claude Code with the highest accuracy score.\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"assets\u002Fperformance.png\" alt=\"FastCode Performance vs Cost\" width=\"850\"\u002F>\n\u003C\u002Fdiv>\n\n---\n\n## Key Features of FastCode\n\n### 🎯 Core Performance Advantages\n- 2-4x Faster than competitors (Cursor\u002FClaude Code)\n- 44-55% Cost Reduction compared to alternatives\n- Highest Accuracy Score across benchmarks\n- Up to 10x Token Savings through smart navigation\n\n### 🛠️ Technical Capabilities\n- Large-Scale Repository Analysis - Handle massive codebases efficiently\n- Multi-Language Support - Python, JavaScript, TypeScript, Java, Go, C\u002FC++, Rust, C#\n- Multi-Repository Reasoning - Cross-repo dependency analysis\n- Small Model Support - Local model compatibility (qwen3-coder-30b)\n\n### 💻 User Experience\n- **MCP Server** - Use FastCode directly through MCP integration (e.g., Cursor, Claude Code)\n- Beautiful Web UI - Intuitive codebase exploration\n- Flexible API - Easy workflow integration\n- Smart Structural Navigation - Load only what you need\n\n---\n\n## 🎥 See FastCode in Action\n\n\u003Cdiv align=\"center\">\n\n[![Watch FastCode Demo](https:\u002F\u002Fimg.youtube.com\u002Fvi\u002FNwexLWHPBOY\u002F0.jpg)](https:\u002F\u002Fyoutu.be\u002FNwexLWHPBOY)\n\n**Click to watch FastCode in action** - See how FastCode analyzes complex codebases with lightning speed.\n\n---\n\n\u003C\u002Fdiv>\n\n### Core Technologies Behind FastCode\n\nFastCode introduces a three-phase framework that transforms how LLMs understand and navigate codebases:\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fframework.png\" alt=\"FastCode Framework\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\n## 🏗️ Semantic-Structural Code Representation\n\n### Multi-layered codebase understanding for comprehensive analysis\n\n- **🔍 Hierarchical Code Units** — Advanced multi-level indexing spanning files, classes, functions, and documentation using AST-based parsing across 8+ programming languages\n\n- **🔗 Hybrid Index** — Seamlessly combines semantic embeddings with keyword search (BM25) for robust and precise code retrieval\n\n- **📊 Multi-Layer Graph Modeling** — Three interconnected relationship graphs (Call Graph, Dependency Graph, Inheritance Graph) enabling structural navigation across the entire codebase\n\n### 🧭 Lightning-Fast Codebase Navigation\n\nFinding the right code without opening every file - at lightning speed\n\n- **⚡ Two-Stage Smart Search** — Like having a research assistant that first finds potentially relevant code, then ranks and organizes the best matches for your specific question.\n\n- **📁 Safe File Browsing** — Explores your project structure securely, understanding folder organization and file patterns without compromising security.\n\n- **🌐 Following Code Connections** — Traces how code pieces connect (up to 2 steps away), like following a trail of breadcrumbs through your codebase.\n\n- **🎯 Code Skimming** — Instead of reading entire files, FastCode just looks at the \"headlines\" - function names, class definitions, and type hints. This is like reading a book's chapter titles instead of every page, saving massive amounts of processing power.\n\n### 💰 Cost-Efficient Context Management\n\nGetting maximum insight while minimizing costs - automatically\n\n- **📈 Budget-Aware Decision Making** — Considers five key factors before processing: confidence level, query complexity, codebase size, resource cost, and iteration count. Like a cost-conscious financial advisor that weighs all options before making decisions.\n\n- **🔄 Resource-Optimized Learning** — Continuously adapts its approach in real-time, getting more efficient about what information to gather and when to stop. Think of it as an AI that maximizes value and becomes more cost-effective with every query.\n\n- **🎯 Value-First Selection** — Prioritizes high-impact, low-cost information first, like choosing the ripest fruit at the best price. This cost-optimized approach ensures you get maximum value for every token spent until the perfect stopping point is reached.\n\n---\n\n## 📊 Benchmark Performance\n\nFastCode has been rigorously tested on four major benchmarks representing real-world software engineering challenges:\n\n### 🎯 Evaluation Datasets\n\n| Benchmark | Focus Area | What It Tests |\n|-----------|------------|---------------|\n| SWE-QA | Software Engineering Q&A | Complex technical question answering |\n| LongCodeQA | Extended Code Analysis | Long-context code understanding |\n| LOC-BENCH | Code Localization | Bug detection & feature requests |\n| GitTaskBench | Real-World Tasks | Production repository workflows |\n\n### 🏆 Outstanding Results\n- ✅ **Superior Accuracy** — Consistently outperforms state-of-the-art baselines across all benchmarks\n\n- ✅ **10x Token Efficiency** — Achieves better results while using up to 90% fewer tokens\n\n- ✅ **Real-World Validation** — Proven performance on actual production codebases and workflows\n\n---\n\n## 🚀 Quick Start\n\nGet FastCode running in under 2 minutes:\n\n```bash\n# 1. Clone the repository\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\n\n# 2. Install dependencies\npip install -r requirements.txt\n\n# 3. Configure your API keys\ncp env.example .env\n# Edit .env with your API keys\n\n# 4. Launch the Web UI\npython web_app.py --host 0.0.0.0 --port 5000\n```\n\nOpen http:\u002F\u002Flocalhost:5000 and start asking questions about your code! 🎉\n\n---\n\n## 📦 Installation\n\nFastCode supports **Linux**, **macOS**, and **Windows**. Choose your platform below:\n\n> **💡 Recommendation:** We recommend using [uv](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv) for faster and more reliable dependency installation.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🐧 Linux Installation\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Prerequisites\n- Python 3.12 or higher\n- Git\n\n### Step-by-Step Guide\n\n1. **Clone FastCode**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **Install Dependencies**\n\n   **Option A: Using uv (Recommended)**\n   ```bash\n   # Install uv\n   pip install uv\n   # create new env with uv\n   uv venv --python=3.12\n   source .venv\u002Fbin\u002Factivate\n\n   # Install dependencies with uv\n   uv pip install -r requirements.txt\n   ```\n\n   **Option B: Using pip**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Configure Environment**\n   ```bash\n   cp env.example .env\n   nano .env  # or use your preferred editor\n   ```\n\n   Add your API keys:\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=gpt-5.2\n   BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n   ```\n\n4. **Launch FastCode**\n   ```bash\n   # Web UI (Recommended)\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # Or use the CLI\n   python main.py query --repo-path \u002Fpath\u002Fto\u002Fyour\u002Frepo --query \"Your question here\"\n   ```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🍎 macOS Installation\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Prerequisites\n- Python 3.12 or higher\n- Git\n\n### Step-by-Step Guide\n\n1. **Clone FastCode**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **Install Dependencies**\n\n   **Option A: Using uv (Recommended)**\n   ```bash\n   # Install uv\n   pip install uv\n   # create new env with uv\n   uv venv --python=3.12\n   source .venv\u002Fbin\u002Factivate\n\n   # Install dependencies with uv\n   uv pip install -r requirements.txt\n   ```\n\n   **Option B: Using pip**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Configure Environment**\n   ```bash\n   cp env.example .env\n   nano .env  # or use: open -e .env\n   ```\n\n   Add your API keys:\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=gemini-3-flash\n   BASE_URL=https:\u002F\u002F...\n   ```\n\n4. **Launch FastCode**\n   ```bash\n   # Web UI (Recommended)\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # Or use the CLI\n   python main.py query --repo-path \u002Fpath\u002Fto\u002Fyour\u002Frepo --query \"Your question here\"\n   ```\n\n**Note for Apple Silicon (M1\u002FM2\u002FM3):** All dependencies are compatible with ARM architecture.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>💻 Windows Installation\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Prerequisites\n- Python 3.12 or higher\n- Git\n\n### Step-by-Step Guide\n\n1. **Clone FastCode**\n   ```cmd\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **Install Dependencies**\n\n   **Option A: Using uv (Recommended)**\n   ```cmd\n   # Install uv\n   pip install uv\n   # create new env with uv\n   uv venv --python=3.12\n   .venv\\Scripts\\activate\n\n   # Install dependencies with uv\n   uv pip install -r requirements.txt\n   ```\n\n   **Option B: Using pip**\n   ```cmd\n   pip install -r requirements.txt\n   ```\n\n3. **Configure Environment**\n   ```cmd\n   copy env.example .env\n   notepad .env\n   ```\n\n   Add your API keys:\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=qwen\u002Fqwen3-coder-30b-a3b-instruct\n   BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n   ```\n\n4. **Launch FastCode**\n   ```cmd\n   # Web UI (Recommended)\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # Or use the CLI\n   python main.py query --repo-path C:\\path\\to\\your\\repo --query \"Your question here\"\n   ```\n\n**Troubleshooting:**\n- If you get SSL errors: `pip install --upgrade certifi`\n- For permission errors, run Command Prompt as Administrator\n- If `faiss-cpu` fails to install: `pip install faiss-cpu --no-cache-dir`\n- If you run `.\u002Frun_nanobot.sh` (bash script) on Windows, use **Git Bash** or **WSL**, and keep `.sh` files in **LF** line endings. This repo enforces LF for `*.sh` via `.gitattributes`, but older clones may need a one-time re-checkout.\n\n\u003C\u002Fdetails>\n\n---\n\n## 🎮 Usage\n\n### Web Interface (Recommended)\n\nThe Web UI provides the most intuitive experience:\n\n1. **Launch the server:**\n   ```bash\n   python web_app.py --host 0.0.0.0 --port 5000\n   ```\n\n2. **Open your browser:** Navigate to http:\u002F\u002Flocalhost:5000\n\n3. **Load a repository:** Use the sidebar to index your codebase\n\n4. **Start asking questions:**\n   - \"Where is the authentication logic implemented?\"\n   - \"How does the payment processing flow work?\"\n   - \"What files would be affected if I change the User model?\"\n   - \"Explain the dependency between module A and module B\"\n\n### Command Line Interface\n\nFor automation and scripting:\n\n```bash\n# Single repository query\npython main.py query --repo-path \u002Fpath\u002Fto\u002Frepo --query \"Your question\"\n\n# Multi-repository query\npython main.py query --repos \u002Fpath\u002Fto\u002Frepo1 \u002Fpath\u002Fto\u002Frepo2 --query \"Your question\"\n\n# With custom model\npython main.py query --repo-path \u002Fpath\u002Fto\u002Frepo --query \"Your question\" --model gpt-4-turbo\n```\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>REST API\u003C\u002Fb>\u003C\u002Fsummary>\n\nIntegrate FastCode into your tools with the comprehensive REST API:\n\n```bash\n# Start the API server\npython api.py --host 0.0.0.0 --port 8000\n```\n\nThe API provides all features available in the Web UI. Visit http:\u002F\u002Flocalhost:8000\u002Fdocs for interactive API documentation.\n\n**Key API Endpoints:**\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Repository Management\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# List available and loaded repositories\nGET \u002Frepositories\n\n# Load a repository from URL or local path\nPOST \u002Fload\n{\n  \"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\",\n  \"is_url\": true\n}\n\n# Index the loaded repository\nPOST \u002Findex?force=false\n\n# Load and index in one call\nPOST \u002Fload-and-index\n{\n  \"source\": \"\u002Fpath\u002Fto\u002Frepo\",\n  \"is_url\": false\n}\n\n# Load multiple existing indexed repositories\nPOST \u002Fload-repositories\n{\n  \"repo_names\": [\"repo1\", \"repo2\"]\n}\n\n# Index multiple repositories at once\nPOST \u002Findex-multiple\n{\n  \"sources\": [\n    {\"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo1\", \"is_url\": true},\n    {\"source\": \"\u002Fpath\u002Fto\u002Frepo2\", \"is_url\": false}\n  ]\n}\n\n# Upload repository as ZIP file\nPOST \u002Fupload-zip\nContent-Type: multipart\u002Fform-data\nfile: \u003Czip_file>\n\n# Upload and index in one call\nPOST \u002Fupload-and-index?force=false\nContent-Type: multipart\u002Fform-data\nfile: \u003Czip_file>\n\n# Delete repositories and their indexes\nPOST \u002Fdelete-repos\n{\n  \"repo_names\": [\"repo1\", \"repo2\"],\n  \"delete_source\": true\n}\n\n# Get repository summary\nGET \u002Fsummary\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Query & Conversation\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# Query repository (single response)\nPOST \u002Fquery\n{\n  \"question\": \"How does authentication work?\",\n  \"filters\": null,\n  \"repo_filter\": [\"repo1\"],\n  \"multi_turn\": false,\n  \"session_id\": null\n}\n\n# Query with streaming response (SSE)\nPOST \u002Fquery-stream\n{\n  \"question\": \"Explain the database schema\",\n  \"multi_turn\": true,\n  \"session_id\": \"abc123\"\n}\n\n# Start a new conversation session\nPOST \u002Fnew-session?clear_session_id=old_session\n\n# List all conversation sessions\nGET \u002Fsessions\n\n# Get conversation history\nGET \u002Fsession\u002F{session_id}\n\n# Delete a conversation session\nDELETE \u002Fsession\u002F{session_id}\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>System & Status\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# Health check\nGET \u002Fhealth\n\n# Get system status\nGET \u002Fstatus?full_scan=false\n\n# Clear cache\nPOST \u002Fclear-cache\n\n# Get cache statistics\nGET \u002Fcache-stats\n\n# Refresh index cache\nPOST \u002Frefresh-index-cache\n\n# Unload current repository\nDELETE \u002Frepository\n```\n\u003C\u002Fdetails>\n\n**Example Usage:**\n\n```python\nimport requests\n\n# Start a session and query\nresponse = requests.post(\"http:\u002F\u002Flocalhost:8000\u002Fload-and-index\", json={\n    \"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\",\n    \"is_url\": True\n})\n\n# Query the repository\nresponse = requests.post(\"http:\u002F\u002Flocalhost:8000\u002Fquery\", json={\n    \"question\": \"Where is the main entry point?\",\n    \"multi_turn\": False\n})\n\nresult = response.json()\nprint(result[\"answer\"])\nprint(f\"Tokens used: {result['total_tokens']}\")\n```\n\n\u003C\u002Fdetails>\n\n\u003Ca id=\"mcp-server-use-in-cursor--claude-code--windsurf\">\u003C\u002Fa>\n\u003Cdetails>\n\u003Csummary>\u003Cb>MCP Server (Use in Cursor \u002F Claude Code \u002F Windsurf)\u003C\u002Fb>\u003C\u002Fsummary>\n\nFastCode can run as an [MCP (Model Context Protocol)](https:\u002F\u002Fmodelcontextprotocol.io\u002F) server, allowing AI coding assistants like **Cursor**, **Claude Code**, and **Windsurf** to use FastCode's repo-level code understanding capabilities directly.\n\n#### Setup\n\nAdd the following to your MCP configuration:\n\nBefore configuring MCP, make sure FastCode dependencies are installed in the local uv virtual environment:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\nuv venv --python=3.12\nsource .venv\u002Fbin\u002Factivate\nuv pip install -r requirements.txt\n```\n\nThe MCP server should be launched with `.venv\u002Fbin\u002Fpython`, and it needs `OPENAI_API_KEY`, `MODEL`, and `BASE_URL`.\n\n**Cursor** (`~\u002F.cursor\u002Fmcp.json`):\n```json\n{\n  \"mcpServers\": {\n    \"fastcode\": {\n      \"command\": \"\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython\",\n      \"args\": [\"\u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\"],\n      \"env\": {\n        \"MODEL\": \"gpt-5.2\",\n        \"BASE_URL\": \"https:\u002F\u002Fapi.openai.com\u002Fv1\",\n        \"OPENAI_API_KEY\": \"sk-...\"\n      }\n    }\n  }\n}\n```\n\n**Claude Code** (`claude_desktop_config.json`):\n```json\n{\n  \"mcpServers\": {\n    \"fastcode\": {\n      \"command\": \"\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython\",\n      \"args\": [\"\u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\"],\n      \"env\": {\n        \"MODEL\": \"gpt-5.2\",\n        \"BASE_URL\": \"https:\u002F\u002Fapi.openai.com\u002Fv1\",\n        \"OPENAI_API_KEY\": \"sk-...\"\n      }\n    }\n  }\n}\n```\n\nOr via `claude mcp add` (ensure the same env vars are available in your shell):\n```bash\nclaude mcp add fastcode -- \u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython \u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\n```\n\n**SSE transport** (for remote \u002F shared deployments):\n```bash\nOPENAI_API_KEY=sk-... MODEL=gpt-5.2 BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1 \\\n\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython \u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py --transport sse --port 8080\n```\n\n#### Available Tools\n\n| Tool | Description |\n|------|-------------|\n| `code_qa` | Core tool — ask questions about one or more code repositories. Automatically clones (if URL) and indexes repos that haven't been indexed yet. Supports multi-turn conversations. |\n| `list_indexed_repos` | List all repositories that have been indexed and are available for querying. |\n| `list_sessions` | List all existing conversation sessions with titles and turn counts. |\n| `get_session_history` | Retrieve the full Q&A history of a specific session. |\n| `delete_session` | Delete a conversation session and all its history. |\n| `delete_repo_metadata` | Delete indexed metadata for a repository (`.faiss`, `_metadata.pkl`, `_bm25.pkl`, `_graphs.pkl`) and remove its entry from `repo_overviews.pkl`, while keeping the repository source code. |\n\n#### `code_qa` Parameters\n\n| Parameter | Required | Default | Description |\n|-----------|----------|---------|-------------|\n| `question` | Yes | — | The question to ask about the code |\n| `repos` | Yes | — | List of repo sources (GitHub URLs or local paths). Multiple repos supported. |\n| `multi_turn` | No | `true` | Enable multi-turn conversation mode |\n| `session_id` | No | auto-generated | Session ID for continuing a conversation. Returned in the response of each call. |\n\n#### How It Works\n\n1. **Auto-detection**: For each repo in `repos`, FastCode checks if it's already indexed. If yes, it skips indexing entirely.\n2. **Auto-clone**: If a repo is a URL and not yet on disk, FastCode clones it to `.\u002Frepos\u002F` and indexes it.\n3. **Multi-turn**: When `multi_turn` is enabled (default), previous Q&A context from the same `session_id` is used for query rewriting and answer generation. The `session_id` is returned in each response — pass it back in subsequent calls to continue the conversation.\n4. **Multi-repo**: Pass multiple repos to `repos` and FastCode will search across all of them, using LLM-based repository selection to find the most relevant code.\n\n#### Usage Example\n\nIn Cursor or Claude Code, simply ask:\n\n```\nUse FastCode to analyze what this repository at \u002Fpath\u002Fto\u002Frepo_name is for.\n```\n\nor\n\n```\nUse FastCode to analyze the authentication flow in https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\n```\n\nThe AI assistant will call `code_qa` with the URL, FastCode will clone and index the repo (if needed), and return a detailed answer with source references.\n\nFor follow-up questions, the assistant reuses the same `session_id` automatically:\n\n```\nWhich files would be affected if I change the User model?\n```\n\n\u003C\u002Fdetails>\n\n---\n\n\n## 🔧 Configuration\n\n### Supported LLM Providers\n\nFastCode works with multiple LLM providers:\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>OpenAI\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-...\nMODEL=gpt-4\nBASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n```\n\u003C\u002Fdetails>\n\n\u003C!-- \u003Cdetails>\n\u003Csummary>\u003Cb>Anthropic Claude\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-ant-...\nMODEL=claude-3-opus-20240229\nBASE_URL=https:\u002F\u002Fapi.anthropic.com\u002Fv1\n```\n\u003C\u002Fdetails> -->\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>OpenRouter (Multiple Models)\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-or-...\nMODEL=google\u002Fgemini-flash-1.5\nBASE_URL=https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Local Models (Ollama)\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=ollama\nMODEL=qwen3-coder-30b_fastcode\nBASE_URL=http:\u002F\u002Flocalhost:11434\u002Fv1\n```\n\u003C\u002Fdetails>\n\n### Supported Languages\n\nFastCode automatically detects and parses:\n- 🐍 Python\n- 📜 JavaScript \u002F TypeScript\n- ☕ Java\n- 🦀 Rust\n- 🐹 Go\n- ⚙️ C \u002F C++\n- 💎 C#\n\n---\n\n\n## 🤖 Nanobot + Feishu (Lark) Integration (Docker Deployment)\n\nFastCode can be integrated with a Feishu (Lark) bot via [Nanobot](https:\u002F\u002Fgithub.com\u002Fnanobot-ai\u002Fnanobot), enabling conversational code repository queries directly within Feishu.\n\n### Architecture\n\n```\nFeishu User ←→ Feishu Open Platform ←→ Nanobot (WebSocket) ←→ FastCode API\n                                        (port 18791)            (port 8001)\n```\n\n- **FastCode Container**: Provides the code analysis REST API (port 8001)\n- **Nanobot Container**: Connects to Feishu via WebSocket and invokes FastCode tools (port 18791)\n- Both containers communicate over Docker's internal network — no public IP required\n\n### Quick Start\n\n```bash\n# One-command launch (automatically builds images and generates config on first run)\n.\u002Frun_nanobot.sh\n\n# Subsequent runs auto-detect the current state:\n# - Services running → show status + health check\n# - Services stopped → auto-restart\n# - Images not found → auto-build and start\n```\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Configuration\u003C\u002Fb>\u003C\u002Fsummary>\n\n#### 1. Unified Configuration (`.env`)\n\nAll API keys and model settings are centralized in the `.env` file, shared by both services:\n\n```bash\n# ===== Shared API Configuration =====\nOPENAI_API_KEY=sk-or-v1-xxx        # Shared by both services\nBASE_URL=https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\n\n# ===== FastCode Model (Code Analysis) =====\nMODEL=google\u002Fgemini-3-flash-preview\n\n# ===== Nanobot Model (Agent Reasoning \u002F Feishu Conversations) =====\nNANOBOT_MODEL=minimax\u002Fminimax-m2.1\n```\n\nThe API key is automatically injected into the Nanobot container via `docker-compose.yml` environment variables — no need to duplicate it in `nanobot_config.json`.\n\n#### 2. FastCode Core Configuration\n\n- `config\u002Fconfig.yaml` — FastCode retrieval and indexing settings\n\n#### 3. Nanobot Configuration (`nanobot_config.json`)\n\n`run_nanobot.sh` auto-generates this file. You only need to configure **Feishu credentials and the systemPrompt** here; API keys and model settings are managed centrally via `.env`.\n\n```json\n{\n  \"channels\": {\n    \"feishu\": {\n      \"enabled\": true,\n      \"appId\": \"cli_xxxxxxxxx\",\n      \"appSecret\": \"your_app_secret\"\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Feishu App Setup\u003C\u002Fb>\u003C\u002Fsummary>\n\nNanobot receives Feishu messages via a WebSocket long-lived connection — **no public IP or webhook required**.\n\n#### 1. Create an App\n\nGo to the [Feishu Open Platform](https:\u002F\u002Fopen.feishu.cn\u002Fapp) → Create a **Custom Enterprise App** → Note the **App ID** (`cli_xxx`) and **App Secret**.\n\n#### 2. Enable Bot Capability\n\nNavigate to App Settings → **App Features** → Enable the \"Bot\" capability.\n\n#### 3. Add Permissions\n\nAdd the following permissions under **Permission Management**:\n\n| Permission | Description |\n|------------|-------------|\n| `im:message` | Read messages |\n| `im:message:send_as_bot` | Send messages as the bot |\n| `im:resource` | Access resource files in messages |\n| `im:chat` | Retrieve group chat information |\n\n#### 4. Configure Event Subscriptions\n\n> ⚠️ **Note the order**: You must start Nanobot to establish the WebSocket connection first, then configure event subscriptions in the Feishu admin console.\n\n1. Enter `appId` and `appSecret` in `nanobot_config.json`, then start the service (`.\u002Frun_nanobot.sh`)\n2. Verify the log shows `connected to wss:\u002F\u002Fmsg-frontier.feishu.cn`, confirming a successful connection\n3. Go back to the Feishu admin console → **Events & Callbacks** → Select \"**Receive events via long-lived connection**\" → Save\n4. Add event: `im.message.receive_v1` (Receive messages)\n\n#### 5. Publish the App\n\nGo to **Version Management** → Create a version → Submit for review (internal enterprise apps can be self-approved) → Once published, you can chat with the bot in Feishu.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Docker Compose Structure\u003C\u002Fb>\u003C\u002Fsummary>\n\n```yaml\nservices:\n  fastcode:          # FastCode API (port 8001)\n    build: .\n    volumes:\n      - .\u002F.env:\u002Fapp\u002F.env:ro\n      - .\u002Fconfig:\u002Fapp\u002Fconfig:ro\n      - .\u002Fdata:\u002Fapp\u002Fdata\n      - .\u002Frepos:\u002Fapp\u002Frepos\n\n  nanobot:           # Nanobot Gateway (port 18791 → 18790)\n    build: .\u002Fnanobot\n    command: [\"gateway\"]\n    volumes:\n      - .\u002Fnanobot_config.json:\u002Froot\u002F.nanobot\u002Fconfig.json:ro\n    environment:\n      - FASTCODE_API_URL=http:\u002F\u002Ffastcode:8001\n      # API key and model injected from .env\n      - NANOBOT_PROVIDERS__OPENROUTER__API_KEY=${OPENAI_API_KEY}\n      - NANOBOT_AGENTS__DEFAULTS__MODEL=${NANOBOT_MODEL}\n    depends_on:\n      - fastcode\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Management Commands\u003C\u002Fb>\u003C\u002Fsummary>\n\n| Command | Description |\n|---------|-------------|\n| `.\u002Frun_nanobot.sh` | Smart launch (auto-detects state) |\n| `.\u002Frun_nanobot.sh --build` | Force rebuild images |\n| `.\u002Frun_nanobot.sh --fg` | Run in foreground (view live logs) |\n| `.\u002Frun_nanobot.sh stop` | Stop all services |\n| `.\u002Frun_nanobot.sh restart` | Restart all services |\n| `.\u002Frun_nanobot.sh logs` | View live logs |\n| `.\u002Frun_nanobot.sh status` | View service status + health check |\n| `.\u002Frun_nanobot.sh config` | Re-check \u002F regenerate Nanobot config |\n| `.\u002Frun_nanobot.sh clean` | Stop and remove containers and images |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Registered FastCode Tools in Nanobot\u003C\u002Fb>\u003C\u002Fsummary>\n\nOn startup, Nanobot automatically registers the following tools via the `FASTCODE_API_URL` environment variable:\n\n| Tool Name | Function |\n|-----------|----------|\n| `fastcode_load_repo` | Load and index a code repository (GitHub URL or local path) |\n| `fastcode_query` | Query code using natural language, with multi-turn conversation support |\n| `fastcode_list_repos` | List loaded \u002F available repositories |\n| `fastcode_status` | View FastCode system status |\n| `fastcode_session` | Manage conversation sessions (create \u002F list \u002F history \u002F delete) |\n\n\u003C\u002Fdetails>\n\n### Feishu Usage Example\n\nChat with the bot in Feishu:\n\n```\nUser: https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\nBot:  ✓ Repository loaded and indexed (152 files, 3847 code elements)\n\nUser: How is the authentication logic implemented in this project?\nBot:  This project uses JWT for authentication... [detailed analysis]\n\nUser: Which files would be affected by changes to the User model?\nBot:  The following 8 files would be affected... [impact analysis]\n```\n\n---\n\n\n## 🧠 How It Works\n\nFastCode uses a novel **scouting-first** approach that fundamentally differs from traditional code reasoning systems:\n\n### Traditional Approach ❌\n```\nQuestion → Load Files → Search → Load More Files → Search Again → ... → Answer\n💸 High token cost from repeated file loading\n```\n\n### FastCode Approach ✅\n```\nQuestion → Build Semantic Map → Navigate Structure → Load Targets → Answer\n💰 Minimal token cost with precise targeting\n```\n\n\n---\n\n## 📚 Examples\n\n### Example 1: Understanding Authentication Flow\n\n**Query:** \"How does user authentication work in this application?\"\n\n**FastCode Process:**\n1. 🗺️ Scouts for authentication-related structures\n2. 🔍 Identifies `auth.py`, `middleware.py`, `user_model.py`\n3. 📊 Traces dependencies between these files\n4. 📖 Loads only relevant functions\n5. ✅ Provides comprehensive answer\n\n### Example 2: Impact Analysis\n\n**Query:** \"What would break if I change the User model schema?\"\n\n**FastCode Process:**\n1. 🗺️ Locates User model definition\n2. 🔗 Traces all imports and usages\n3. 📊 Maps dependency graph\n4. 📖 Loads affected code sections\n5. ✅ Lists all impacted files and functions\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! FastCode is built for the community, by the community.\n\n### Ways to Contribute\n\n- 🐛 **Report Bugs** - Found an issue? Let us know!\n- 💡 **Suggest Features** - Have ideas? We'd love to hear them!\n- 📝 **Improve Documentation** - Help others understand FastCode better\n- 🔧 **Submit Pull Requests** - Code contributions are always welcome\n\n\u003C!-- ### Development Setup\n\n```bash\n# Clone and setup\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate  # or .venv\\Scripts\\activate on Windows\npip install -r requirements.txt\n\n# Run tests\npytest tests\u002F\n\n# Code formatting\nblack .\n``` -->\n\n---\n\n## 📄 License\n\nFastCode is released under the MIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n## 🌟 Star History\n\n\u003Cdiv align=\"center\">\n\nIf FastCode saves you tokens and time, consider giving us a star! ⭐\n\n**Built with ❤️ for developers who value efficiency**\n\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#HKUDS\u002FFastCode&Date\">\n    \u003Cpicture>\n      \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=HKUDS\u002FFastCode&type=Date&theme=dark\" \u002F>\n      \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=HKUDS\u002FFastCode&type=Date\" \u002F>\n      \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=HKUDS\u002FFastCode&type=Date\" style=\"border-radius: 15px; box-shadow: 0 0 30px rgba(0, 217, 255, 0.3);\" \u002F>\n    \u003C\u002Fpicture>\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Cem> Thanks for visiting ✨ FastCode!\u003C\u002Fem>\u003Cbr>\u003Cbr>\n  \u003Cimg src=\"https:\u002F\u002Fvisitor-badge.laobi.icu\u002Fbadge?page_id=HKUDS.FastCode&style=for-the-badge&color=00d4ff\" alt=\"Views\">\n\u003C\u002Fp>\n","FastCode是一个用于加速和简化代码理解的高效框架。它通过提供卓越的速度、准确性和成本效益来支持大规模代码库和软件架构的分析。项目的核心功能包括比同类工具快2-4倍的处理速度，以及高达55%的成本节省；同时，它在准确性上也超越了Cursor和Claude Code等竞争对手。技术特点方面，FastCode支持多种编程语言（如Python、JavaScript、TypeScript等），具备跨仓库依赖分析能力，并且兼容本地小模型以减少资源消耗。此外，用户可以通过直观的Web界面或灵活的API接口轻松集成FastCode到现有工作流中。该项目特别适用于需要对大型或多语言代码库进行快速理解和深入分析的场景。",2,"2026-06-11 03:49:01","high_star"]