一键导入
archex
Use when an agent needs local-first codebase context, architecture maps, scout/fetch bundles, or archex MCP setup for an existing repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when an agent needs local-first codebase context, architecture maps, scout/fetch bundles, or archex MCP setup for an existing repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | archex |
| description | Use when an agent needs local-first codebase context, architecture maps, scout/fetch bundles, or archex MCP setup for an existing repository. |
| version | 0.1.0 |
archex is a local code-context layer. It indexes the repository, returns structural maps and token-budgeted context bundles, and never requires hosted inference or API keys.
Run diagnostics before retrieval:
archex doctor . --format json
If index_health is error because the project is uninitialized or missing an index, run:
archex init .
archex index .
If index_staleness is warning, run archex index . before relying on results. If diagnostics still fail, stop and report the exact archex doctor check and message.
For exact install, MCP JSON, Docker, cache, network, freshness, and uninstall semantics, read docs/INSTALLATION_TRUST_CONTRACT.md.
Use this for broad or architectural questions.
archex scout . "How does authentication flow through this repo?" --budget 1000 --format json
fetch_plan.recommended_strategy:| Strategy | Action |
|---|---|
chunk_first | Fetch the listed symbol: or chunk: handles before running a broader query. |
hybrid_fetch | Fetch the highest-scoring handles, then run archex query only if the fetched context is insufficient. |
direct_query | Skip handle fetch and run a normal context bundle query. |
archex symbol . 'symbol:src/pkg/service.py::Service#class'
archex symbol . 'chunk:src/pkg/service.py::Service#class'
For file handles, run a focused query naming the file path from the handle:
archex query . "Explain src/pkg/service.py in the auth flow" --format xml
For Python callers, pass all scout handles directly:
from archex import query
from archex.models import RepoSource
bundle = query(
RepoSource(local_path="."),
"How does authentication flow through this repo?",
handles=["symbol:src/pkg/service.py::Service#class"],
)
print(bundle.to_prompt(format="xml"))
Install the MCP extra and register the stdio server with the client:
uv tool install "archex[mcp]"
{
"mcpServers": {
"archex": { "command": "archex", "args": ["mcp"] }
}
}
The full installation and trust contract is in docs/INSTALLATION_TRUST_CONTRACT.md.
Optional warm-container or long-running local sessions can keep the MCP server alive with watch mode:
archex mcp --watch --watch-path .
| Need | Command |
|---|---|
| Trust check | archex doctor . |
| Initialize | archex init . && archex index . |
| Scout map | archex scout . "question" --budget 1000 --format json |
| Context bundle | archex query . "question" --format xml |
| Exact symbol body | archex symbol . 'symbol:path.py::name#kind' |
| Architecture guide | archex onboard . |
.archex/ generated and uncommitted.archex doctor . for troubleshooting before changing configuration.