Synaptex
Syncs CLAUDE.md files across repos, builds a semantic index, and exposes search, list, context, and status tools to Claude via MCP.
README
<p align="center"> <img src="synaptex_claude_logo.jpg" alt="Synaptex logo" width="300"/> </p>
Synaptex
Global brain for all your Claude Code projects.
Synaptex syncs your CLAUDE.md files across repos, builds a semantic index, and exposes everything to Claude via MCP.
Portable across operating systems (Linux x86/ARM, macOS, Windows WSL), Git hosts (Forgejo, Gitea, GitHub, GitLab, or just local folders), and embedding providers (Ollama, OpenAI, LM Studio, vLLM, LocalAI…).
Quick start
git clone <this-repo> ~/Synaptex
cd ~/Synaptex
bash install.sh # standard setup (embed backend)
# or:
bash install.sh --enable-leann # adds BM25+vector search (~3 GB extra)
synaptex init # interactive wizard
synaptex sync # first sync + index
synaptex search "your query"
Prerequisites
- Python 3.10+ with
pip install -r requirements.txt - A repo source (one of: Forgejo, Gitea, GitHub, GitLab, or local folders)
- For semantic search: Ollama (local or remote) with an embedding model pulled — not required if you use the
fts5backend
Five git providers, one variable
FORGE_TYPE in ~/.synaptex/.env:
| Value | API used | Token scope |
|---|---|---|
forgejo |
Forgejo API v1 (/api/v1/...) |
read:repository |
gitea |
Gitea API v1 (same as Forgejo) | read:repository |
github |
GitHub REST API v3 | repo (read) |
gitlab |
GitLab REST API v4 | read_api |
local |
Filesystem scan (no API) | none |
local is the most universal: point LOCAL_REPOS_PATH to a folder containing your Git repos, and Synaptex reads CLAUDE.md files directly from disk. No tokens, no network, fully offline.
Three search backends, one switch
SYNAPTEX_SEARCH_BACKEND in ~/.synaptex/.env:
| Value | Quality | Network needs | Disk cost | Use when |
|---|---|---|---|---|
embed (default) |
Semantic similarity (cosine) | Ollama (local or remote) | ~tens of MB | You have an embedding provider |
leann |
BM25 + vector hybrid (best) | Ollama | ~3 GB (PyTorch) | Quality matters more than disk |
fts5 |
Keyword (SQLite FTS5) | None | Negligible | Fully offline, no Ollama |
You can switch at any time — re-run synaptex sync to repopulate the index in the new backend.
Supported embedding providers
- Ollama (default) — any model available via
ollama pull - OpenAI-compatible — LM Studio, vLLM, LocalAI, OpenAI API: set
OLLAMA_API_TYPE=openai
Configuration
~/.synaptex/.env (created by synaptex init or install.sh, chmod 600):
| Variable | Description | Example |
|---|---|---|
FORGE_TYPE |
Source type | forgejo | gitea | github | gitlab | local |
FORGE_URL |
Git provider base URL (not needed for github or local) |
http://localhost:3000 |
FORGE_TOKEN |
API token with read access | abc123... |
FORGE_USER |
Your username on the git provider | alice |
LOCAL_REPOS_PATH |
Local folder to scan (when FORGE_TYPE=local) |
~/projects |
SYNAPTEX_INCLUDE_PATTERNS |
Files to index per repo (comma-separated) | CLAUDE.md | CLAUDE.md,README.md | *.md |
SYNAPTEX_EXCLUDE_DIRS |
Local dirs to skip during scan (comma-separated) | Drive-Archive,Secrets,Templates |
SYNAPTEX_SEARCH_BACKEND |
Search engine | embed | leann | fts5 |
OLLAMA_BASE_URL |
Ollama or OpenAI-compatible API | http://localhost:11434 |
OLLAMA_API_TYPE |
API format | ollama | openai |
OLLAMA_EMBED_MODEL |
Embedding model | nomic-embed-text |
OLLAMA_FALLBACK_MODEL |
Fallback model (optional) | mxbai-embed-large |
OLLAMA_API_KEY |
API key for OpenAI-compatible APIs (optional) | sk-... |
Commands
synaptex init
Interactive wizard — generates ~/.synaptex/.env.
synaptex status
Check connectivity: git provider, Ollama, embedding model, index, backend, memory sheets, projects synced, last sync timestamp.
synaptex sync
Download files matching SYNAPTEX_INCLUDE_PATTERNS, generate memory sheets, re-index.
synaptex sync --dry-run # preview without writing
synaptex sync # full sync
synaptex sync --no-index # sync without re-indexing
synaptex sync --verbose # log each file with [ok] or [skip] (reason)
synaptex sync --only mon-projet # sync a single repo
synaptex sync --exclude tests # exclude repos by name (repeatable)
synaptex sync --exclude ci --exclude sandbox
synaptex clean
Purge local caches (~/.synaptex/projects/ and/or ~/.synaptex/memory/).
synaptex clean --all # purge projects + memory
synaptex clean --projects # purge projects only (memory kept)
synaptex clean --memory # purge memory only (projects kept)
synaptex search
Semantic (or keyword, depending on backend) search across all indexed files.
synaptex search "raspberry pi backup strategy"
synaptex search "authentication API" -k 3
synaptex map
Generate ~/.synaptex/index.md — a global map with a Mermaid dependency graph.
synaptex context
Generate an injectable context block for a Claude session.
synaptex context # all projects
synaptex context myrepo otherrepo # filtered
Claude Code integration
Slash command /user:synaptex
At the start of a session, type /user:synaptex to load global context.
With specific projects: /user:synaptex myrepo otherrepo
Claude will:
- Run
synaptex contextand read the result - Query past session memories via qmd (if installed)
- Confirm: "🧠 Synaptex loaded — active projects: [list]"
MCP synaptex-search
Available tools directly in Claude Code during a conversation:
| Tool | Usage |
|---|---|
synaptex_search |
Search across CLAUDE.md files |
synaptex_list |
List all synced projects |
synaptex_context |
Return a project's context |
synaptex_status |
Infrastructure status |
Compatibility matrix
| Platform | Status | Notes |
|---|---|---|
| Linux x86_64 | ✅ Tested | Native |
| Linux aarch64 (Pi 4/5) | ✅ Tested | embed/fts5 backends recommended; leann works but install is slow |
| macOS Apple Silicon | ✅ Should work | Bun + qmd binaries native; Ollama runs natively |
| macOS Intel | ✅ Should work | Same as above |
| Windows (WSL2) | ✅ Should work | Treat as Linux |
| Windows (Git Bash) | ⚠️ Partial | install.sh skips ~/.local/bin symlink — use python3 synaptex.py directly |
File layout
~/.synaptex/
├── .env ← secrets (chmod 600, never committed)
├── projects/ ← CLAUDE.md mirror (one folder per repo)
├── memory/ ← generated memory sheets
├── index.md ← global map (synaptex map)
├── leann_index/ ← vector index (sqlite3 + optional leann)
└── sync.log ← sync history
<repo>/
├── synaptex.py ← CLI (Click)
├── forge.py ← multi-git bridge (forgejo/gitea/github/gitlab/local)
├── embed.py ← vector index (sqlite3 + cosine + OpenAI-compatible)
├── search.py ← search backend router (embed/leann/fts5)
├── memory.py ← memory sheets + Mermaid graph
├── context.py ← injectable context block
├── mcp_synaptex.py ← MCP server (stdio)
└── install.sh ← full setup
Troubleshooting
Ollama not responding
curl http://localhost:11434/api/tags # check it's running
ollama pull nomic-embed-text # pull the default embed model
Git provider unreachable
- For remote Forgejo/GitLab: check VPN or network connectivity
- For GitHub: verify your token has
reposcope - For
local: verifyLOCAL_REPOS_PATHpoints to a folder containing.git/directories
Index empty after sync
synaptex status # check embed model is available
synaptex sync # re-run sync
Want offline search (no Ollama)
# In ~/.synaptex/.env:
SYNAPTEX_SEARCH_BACKEND=fts5
synaptex sync # re-index with FTS5
Want best search quality
bash install.sh --enable-leann
# Then in ~/.synaptex/.env:
SYNAPTEX_SEARCH_BACKEND=leann
synaptex sync
qmd not found
export PATH="$HOME/.bun/bin:$PATH"
License
See LICENSE if present, or contact the repo owner.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。