xtage
Allows fetching public GitHub repositories in token-sized chunks, indexing them into a persistent knowledge base for Claude.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xtageInitialize the knowledge base for this repository"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
xtage
CLI + MCP server that gives Claude persistent, semantic knowledge of a codebase — across every session, without manual context-setting.
Author: ruco-ai | Date: 2026-04-26
Overview
Claude starts every session cold. xtage fixes this by maintaining a persistent knowledge base that Claude reads before touching any source files.
The knowledge base lives in ~/xtage/ and is structured in three tiers:
Structural map —
CODEINDEX.md,REPO.md,PROJECTINSIGHTS.mdper repoPer-file compressed summaries —
files/{slug}.mdper source fileSource files — opened only when the above tiers are insufficient
All files are generated by your local Claude, live in ~/xtage/, and stay on your machine. No external AI API. No cloud.
Related MCP server: Memory MCP Server
Installation
Claude Code (recommended):
claude mcp add xtage npx -- -y xtageFor global installation across all projects, edit ~/.claude/settings.json:
{
"mcpServers": {
"xtage": {
"command": "npx",
"args": ["-y", "@ruco-ai/xtage"]
}
}
}Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"xtage": {
"command": "npx",
"args": ["-y", "@ruco-ai/xtage"]
}
}
}Usage
1. Index a repo
xtage initIndexes the current directory. Local filesystem by default — works offline, works for private repos, indexes your actual working state.
To index a public GitHub repo instead:
xtage init https://github.com/owner/repoClaude fetches, chunks, and writes REPO.md and CODEINDEX.md to ~/xtage/{repo-name}/. A spinner shows live progress.
2. Start a session
xtage startLoads your codebase context into Claude at the start of a session. Claude reads the knowledge base silently and answers your first question with it already loaded.
3. End a session
xtage endClaude reflects on what was learned and writes new entries to PROJECTINSIGHTS.md or GENERALINSIGHTS.md.
4. Update after commits
xtage updateIncrementally refreshes CODEINDEX.md based on what changed since the last index. Much faster than a full re-init.
Install as a git post-commit hook to run automatically:
echo 'xtage update' >> .git/hooks/post-commit
chmod +x .git/hooks/post-commit5. Check index freshness
xtage statusShows when the index was last updated and whether it's stale.
6. Register a local directory
xtage linkRegisters the current directory in the local repo registry (~/xtage/registry.json), so xtage can resolve which indexed repo corresponds to the current working directory.
MCP Tools
Fetch tools
Tool | Description |
| Fetch a public GitHub repo in token-sized chunks |
| Fetch files from a local directory in token-sized chunks |
| Fetch a single file from a GitHub repo |
| Check if |
Write tools
Tool | Description |
| Write |
| Write |
| Write |
| Write global |
| Write a per-file prose summary to |
Read tools
Tool | Description |
| Read |
| Read |
| Read |
| Read a per-file summary from |
| List available file chunk summaries for a repo |
| Token savings stats for the current session |
Registry tools
Tool | Description |
| Map a local path → repo name in |
| Resolve local path → repo name (or list all registered repos) |
Memory sync
Tool | Description |
| Merge Claude auto-memory files ( |
Storage Layout
~/xtage/
registry.json ← local path → repo name mappings
GENERALINSIGHTS.md ← cross-repo patterns and standing instructions
{repo-name}/
REPO.md ← architecture, stack, workflow
CODEINDEX.md ← file-by-file semantic map
PROJECTINSIGHTS.md ← design decisions, known gaps
files/
{slug}.md ← per-file compressed prose summaryConfiguration
Variable | Default | Description |
| unset | Set to |
Add a .xtage-ignore file to your repo root to exclude paths (same format as .gitignore).
Default ignores: .env, *.pem, *.key, secrets/, node_modules/, dist/, *.lock.
Project Structure
xtage/
src/
cli.ts ← CLI entry point (commands are thin proxies for claude -p)
server.ts ← MCP server setup
tools.ts ← MCP tool definitions
resources.ts ← MCP resources (xtage:// URIs)
prompts.ts ← MCP prompts (repo-init, repo-update, session-start, session-end)
chunker.ts ← token-aware file chunker
github.ts ← GitHub REST API fetcher
local.ts ← local filesystem repo reader
ignore.ts ← ignore chain + secretlint scanning
store.ts ← read/write ~/xtage/ files + registry
progress.ts ← spinner progress state (CLI ↔ MCP via env var)
sessions.ts ← session token tracking
telemetry.ts ← anonymous usage telemetry
hook.ts ← git diff parser (installGitHook removed; parseGitDiff + getGitDiff only)
tokens.ts ← local token counter
version.ts
templates/ ← mdblu templates for xtage index filesTelemetry
xtage collects anonymous usage data to understand how the tool is used. It is opt-in — you are asked on first run, and the default is off. Set XTAGE_NO_TELEMETRY=1 to disable permanently without being asked.
What is collected: event type (init, update, error, general_insights_write), timestamp, repo URL, file/chunk counts, word count of insights written. No source code, no file contents, no personal data.
Preference is stored at ~/.xtage/telemetry.json.
Release Notes
0.4.0
New:
sync_from_claude_memoryMCP tool — reads Claude auto-memory files and merges them intoPROJECTINSIGHTS.md. Wire it with a Claude CodePostToolUsehook so every memory write propagates to xtage automatically.Removed: dead
init.tsandupdate.tsmodules (logic had already moved tocli.tsviarunClaude); removedinstallGitHookfromhook.ts.Fixed:
sync_from_claude_memoryadded toXTAGE_TOOLSsoensureXtagePermissions()grants it onxtage init.
0.3.x
Session token tracking and
get_session_statstoolPer-file chunk summaries (
write_file_chunk,read_file_chunk,list_file_chunks)Open-source release: LICENSE, telemetry disclosure,
.npmignore
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ruco-ai/xtage'
If you have feedback or need assistance with the MCP directory API, please join our Discord server