{"id":39819984,"url":"https://github.com/ahmedibrahim085/farhan-code-search-template","last_synced_at":"2026-01-18T12:55:58.776Z","repository":{"id":326442521,"uuid":"1105499312","full_name":"ahmedibrahim085/farhan-code-search-template","owner":"ahmedibrahim085","description":"Template repository for FarhanAliRaza/claude-context-local - 100% local semantic code search for any project. Zero API costs, complete privacy.","archived":false,"fork":false,"pushed_at":"2025-11-27T20:12:34.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-30T11:35:18.577Z","etag":null,"topics":["claude-code","code-search","embeddings","faiss","local-first","mcp","privacy","semantic-search","template","zero-cost"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmedibrahim085.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-27T17:44:28.000Z","updated_at":"2025-11-27T20:12:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ahmedibrahim085/farhan-code-search-template","commit_stats":null,"previous_names":["ahmedibrahim085/farhan-code-search-template"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/ahmedibrahim085/farhan-code-search-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedibrahim085%2Ffarhan-code-search-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedibrahim085%2Ffarhan-code-search-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedibrahim085%2Ffarhan-code-search-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedibrahim085%2Ffarhan-code-search-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedibrahim085","download_url":"https://codeload.github.com/ahmedibrahim085/farhan-code-search-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedibrahim085%2Ffarhan-code-search-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","code-search","embeddings","faiss","local-first","mcp","privacy","semantic-search","template","zero-cost"],"created_at":"2026-01-18T12:55:58.129Z","updated_at":"2026-01-18T12:55:58.767Z","avatar_url":"https://github.com/ahmedibrahim085.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FarhanAliRaza Code Search - Project Template\n\nThis template repository provides **100% local semantic code search** using [FarhanAliRaza/claude-context-local](https://github.com/FarhanAliRaza/claude-context-local) for any project.\n\n## ✨ What You Get\n\n- 🔍 **Semantic Code Search**: Find code by meaning, not just keywords\n- 🔒 **100% Private**: No cloud APIs, your code never leaves your machine\n- 💰 **Zero Cost**: No API fees, completely free\n- ⚡ **Fast**: Local FAISS vector search\n- 🎯 **Per-Project**: Isolated index for each project\n- 🌐 **Multi-Language**: Python, JS/TS, Go, Rust, Java, C/C++, C#, Markdown\n\n## 🚀 Quick Start\n\n### For New Projects\n\n1. **Use this template for your new project**\n   ```bash\n   git clone \u003cyour-template-url\u003e your-project\n   cd your-project\n   ```\n\n2. **Install FarhanAliRaza globally** (one-time, ~1 minute)\n   ```bash\n   curl -fsSL https://raw.githubusercontent.com/FarhanAliRaza/claude-context-local/main/scripts/install.sh | bash\n   ```\n\n3. **Enable Claude Code MCP approval** (CRITICAL - Required for MCP to load)\n\n   Create or edit `.claude/settings.local.json` in your project:\n   ```bash\n   mkdir -p .claude\n   cat \u003e .claude/settings.local.json \u003c\u003c 'EOF'\n   {\n     \"enableAllProjectMcpServers\": true\n   }\n   EOF\n   ```\n\n   **Why needed**: Claude Code requires explicit approval to load MCP servers from `.mcp.json`. Without this setting, the server won't activate even after restart.\n\n   **Alternative** (selective approval):\n   ```json\n   {\n     \"enabledMcpjsonServers\": [\"code-search\"]\n   }\n   ```\n\n4. **Restart Claude Code**\n\n   Close and reopen Claude Code completely\n\n5. **Verify MCP server loaded**\n\n   Ask Claude: \"List available MCP tools\"\n\n   You should see `mcp__code-search__*` tools listed\n\n6. **Index your codebase**\n\n   In Claude Code: \"Index this codebase\"\n\n7. **Start searching!**\n\n   Examples:\n   - \"Find authentication code\"\n   - \"Show me the API client class\"\n\n### For Existing Projects\n\n1. **Copy configuration files** to your project root:\n   ```bash\n   cp .mcp.json your-project/\n   cp .mcp-server-wrapper.sh your-project/\n   # Merge with existing .gitignore if it exists\n   cat .gitignore \u003e\u003e your-project/.gitignore\n   ```\n\n2. **Make wrapper executable**\n   ```bash\n   chmod +x your-project/.mcp-server-wrapper.sh\n   ```\n\n3. **Enable Claude Code MCP approval** (CRITICAL)\n\n   Create or edit `.claude/settings.local.json` in your project:\n   ```bash\n   cd your-project\n   mkdir -p .claude\n   cat \u003e .claude/settings.local.json \u003c\u003c 'EOF'\n   {\n     \"enableAllProjectMcpServers\": true\n   }\n   EOF\n   ```\n\n4. **Install FarhanAliRaza globally** (if not already installed)\n   ```bash\n   curl -fsSL https://raw.githubusercontent.com/FarhanAliRaza/claude-context-local/main/scripts/install.sh | bash\n   ```\n\n5. **Restart Claude Code**\n\n   Close and reopen completely\n\n6. **Verify and index**\n\n   Ask Claude: \"List available MCP tools\" (should see `mcp__code-search__*`)\n\n   Then: \"Index this codebase\"\n\n## 📋 Prerequisites\n\nOnly needs to be installed **once per machine** (not per project):\n\n```bash\n# Check if already installed:\nls ~/.local/share/claude-context-local/\n\n# If not found, install:\ncurl -fsSL https://raw.githubusercontent.com/FarhanAliRaza/claude-context-local/main/scripts/install.sh | bash\n```\n\n**System Requirements:**\n- Python 3.12+\n- 1-2 GB disk space (for model + index)\n- Optional: GPU for faster indexing (works on CPU)\n\n## 📁 What's Included\n\n```\n.\n├── .mcp.json                         ✅ Commit - MCP server config\n├── .mcp-server-wrapper.sh            ✅ Commit - Server wrapper script\n├── .gitignore                        ✅ Commit - Excludes index\n├── .claude/\n│   └── settings.local.json.template  ✅ Commit - Template for MCP approval\n├── README.md                         ✅ Commit - This file\n├── SETUP_CHECKLIST.md                ✅ Commit - Verification guide\n└── .code-search-index/               ❌ DON'T commit - Local index (auto-generated)\n```\n\n## 🎮 Usage Examples\n\n### Index Your Codebase\n\n```\nIn Claude Code:\n\u003e Index this codebase\n\nExpected output:\n✅ Indexing /path/to/project...\n✅ Found 121 files\n✅ Created 1804 code chunks\n✅ Indexed in 23 seconds\n```\n\n### Semantic Search\n\n```\n\u003e Find all HTTP request handling code\n\nReturns code chunks that handle HTTP requests,\neven if they don't contain the exact words \"HTTP request\"!\n```\n\n### Class/Function Search\n\n```\n\u003e Show me the DatabaseConnection class\n\nReturns:\n1. database/connection.py:15-45 (class DatabaseConnection) ⭐ EXACT\n2. database/pool.py:20-40 (ConnectionPool)\n3. database/manager.py:10-30 (DBConnectionManager)\n```\n\n### Feature Search\n\n```\n\u003e Find error handling patterns\n\nReturns all error handling code across your codebase,\nunderstanding the semantic meaning of \"error handling\"\n```\n\n### Check Status\n\n```\n\u003e What's the indexing status?\n\nReturns:\n{\n  \"total_chunks\": 1804,\n  \"files_indexed\": 121,\n  \"top_folders\": { \"src\": 450, \"tests\": 610 }\n}\n```\n\n## 🔧 How It Works\n\n```\n┌─────────────────────────────────────────────────┐\n│ Your Project                                    │\n│ ├── .mcp.json            ← Claude Code reads   │\n│ ├── .mcp-server-wrapper.sh ← Launches server   │\n│ ├── .claude/                                    │\n│ │   └── settings.local.json ← Enables MCP      │\n│ └── .code-search-index/  ← Local FAISS index   │\n└─────────────────────────────────────────────────┘\n                    ↓\n┌─────────────────────────────────────────────────┐\n│ ~/.local/share/claude-context-local/            │\n│ ├── mcp_server/          ← MCP server code      │\n│ ├── embeddings/          ← EmbeddingGemma model │\n│ └── chunking/            ← AST-based parser     │\n└─────────────────────────────────────────────────┘\n```\n\n**Key Points:**\n- FarhanAliRaza installed once globally in `~/.local/share/`\n- Each project has its own isolated index in `.code-search-index/`\n- Claude Code approval via `.claude/settings.local.json` required\n- No conflicts between projects\n- Safe to delete and regenerate index anytime\n\n## 🛠️ Troubleshooting\n\n### MCP Server Not Loading After Restart\n\n**Symptom**: No `mcp__code-search__*` tools available after restart\n\n**Cause**: Missing Claude Code approval setting\n\n**Fix**:\n1. Create or edit `.claude/settings.local.json` in your project root:\n   ```bash\n   mkdir -p .claude\n   cat \u003e .claude/settings.local.json \u003c\u003c 'EOF'\n   {\n     \"enableAllProjectMcpServers\": true\n   }\n   EOF\n   ```\n\n2. Restart Claude Code again\n\n**Verify fix**:\n```bash\n# Check if approval setting exists\ncat .claude/settings.local.json | grep enableAllProjectMcpServers\n# Should output: \"enableAllProjectMcpServers\": true\n```\n\n**Additional checklist**:\n1. ✅ Is `.mcp.json` in project root? `ls .mcp.json`\n2. ✅ Is wrapper executable? `ls -la .mcp-server-wrapper.sh` (should show `rwx`)\n3. ✅ Is global install present? `ls ~/.local/share/claude-context-local/`\n4. ✅ Is approval enabled? `grep enableAllProjectMcpServers .claude/settings.local.json`\n\n### \"claude-context-local not found\"\n\n**Fix:**\n```bash\ncurl -fsSL https://raw.githubusercontent.com/FarhanAliRaza/claude-context-local/main/scripts/install.sh | bash\n```\n\n### \"uv command not found\"\n\n**Fix:**\n```bash\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n# Restart terminal\n```\n\n### Wrapper Script Permission Denied\n\n**Fix:**\n```bash\nchmod +x .mcp-server-wrapper.sh\n```\n\n### Re-index from Scratch\n\n```bash\n# Delete index:\nrm -rf .code-search-index/\n\n# Re-index in Claude Code:\n\"Index this codebase\"\n```\n\n### Index Not Building / Search Returns No Results\n\n**Checklist**:\n1. ✅ Did indexing complete successfully?\n2. ✅ Check index stats: \"What's the indexing status?\"\n3. ✅ Verify files in `.code-search-index/projects/*/index/`\n\n**Fix**:\n```bash\n# Re-index from scratch\nrm -rf .code-search-index/\n# Then in Claude Code: \"Index this codebase\"\n```\n\n## 📊 Performance\n\n| Project Size | Files | Indexing Time | Storage |\n|--------------|-------|---------------|---------|\n| Small | \u003c100 | 10-20 sec | ~5 MB |\n| Medium | 1,000 | 1-2 min | ~50 MB |\n| Large | 10,000 | 10-15 min | ~500 MB |\n\n**Search Speed:** 50-200ms per query\n\n## 🌟 Why FarhanAliRaza?\n\nWe tested **3 local code search implementations**. Only FarhanAliRaza works reliably:\n\n| Implementation | Status | Issues |\n|----------------|--------|--------|\n| danielbowne/claude-context-mcp | ❌ Broken | State tracking bug (GitHub #226) |\n| MikeO-AI/claude-context-local-mcp | ❌ Broken | 100-chunk hard limit |\n| **FarhanAliRaza/claude-context-local** | ✅ **Working** | None found |\n\n**Tested with:** 121 files, 1804 chunks, production-ready\n\n## 📚 Architecture\n\n- **Embeddings:** Google EmbeddingGemma (768 dimensions)\n- **Vector DB:** FAISS (IndexFlatIP)\n- **Chunking:** AST-based (respects code structure)\n- **Languages:** Python, JS/TS, Go, Rust, Java, C/C++, C#, Markdown\n- **Storage:** Project-local `.code-search-index/`\n\n## 🤝 Contributing\n\nFound this template useful? Consider:\n- ⭐ Starring the original [FarhanAliRaza/claude-context-local](https://github.com/FarhanAliRaza/claude-context-local)\n- 📝 Improving this template via pull requests\n- 🐛 Reporting issues you encounter\n\n## 📄 License\n\nThis template configuration is provided as-is.\n\nFarhanAliRaza/claude-context-local has its own license - see their repository.\n\n## 🔗 Resources\n\n- [FarhanAliRaza Repository](https://github.com/FarhanAliRaza/claude-context-local)\n- [Setup Guide](SETUP_GUIDE.md) - Detailed instructions\n- [Setup Checklist](SETUP_CHECKLIST.md) - Step-by-step verification\n- [Comparison](THREE_WAY_COMPARISON.md) - Why we chose FarhanAliRaza\n\n---\n\n**Last Updated:** 2025-11-27\n**Status:** ✅ Production-Ready\n**Tested On:** lmstudio-bridge-enhanced (1804 chunks, 121 files)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedibrahim085%2Ffarhan-code-search-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedibrahim085%2Ffarhan-code-search-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedibrahim085%2Ffarhan-code-search-template/lists"}