---
title: ctx — Context Engine
description: All-in-one Rust toolkit for Claude Code & MCP agents — auto-rewrite hooks, MCP server, repo maps, call graphs in 7 languages, local RAG. Single binary, 100% local.
template: splash
hero:
  tagline: |
    Drop-in token saver for Claude Code & MCP agents.
    Auto-rewrite hooks · 10 MCP tools · Repo maps · Call graphs in 7 languages · Local RAG.
    Single Rust binary, 100% local, zero APIs.
  image:
    file: ../../assets/logo.svg
  actions:
    - text: Install
      link: /context-engine/guides/install/
      icon: rocket
      variant: primary
    - text: View on GitHub
      link: https://github.com/JaimeJunr/context-engine
      icon: external
      variant: minimal
    - text: crates.io
      link: https://crates.io/crates/ctx-engine
      icon: external
      variant: minimal
---

import { Card, CardGrid, LinkCard, Tabs, TabItem } from '@astrojs/starlight/components';

## Get started in 30 seconds

<Tabs>
  <TabItem label="Linux / macOS">
    ```bash
    curl --proto '=https' --tlsv1.2 -LsSf \
      https://github.com/JaimeJunr/context-engine/releases/latest/download/ctx-engine-installer.sh | sh
    ctx install --agent claude-code
    ```
  </TabItem>
  <TabItem label="Windows (PowerShell)">
    ```powershell
    irm https://github.com/JaimeJunr/context-engine/releases/latest/download/ctx-engine-installer.ps1 | iex
    ctx install --agent claude-code
    ```
  </TabItem>
  <TabItem label="Cargo">
    ```bash
    cargo install ctx-engine
    ctx install --agent claude-code
    ```
  </TabItem>
</Tabs>

Reopen your Claude Code session and the agent automatically uses `ctx` for command compression, repo maps, semantic search and call graphs.

## Why ctx?

The only Rust CLI that covers **5 competitive axes** in a single 100% local binary.

<CardGrid>
  <Card title="Auto-rewrite hooks" icon="seti:bash">
    Bash calls go through `ctx exec` automatically — git, cargo, npm, docker, kubectl, aws, terraform, linters compressed without the agent knowing.
  </Card>
  <Card title="Native MCP server" icon="puzzle">
    10 tools (`ctx_exec`, `ctx_search`, `ctx_map`, `ctx_callers`, `ctx_trace`…) exposed via stdio. Schemas auto-generated by `schemars`.
  </Card>
  <Card title="Repo map (BM25 + PageRank)" icon="document">
    Curated signatures ranked by relevance with token budget binary-search. Personalized PageRank with seed dirs for high-precision context.
  </Card>
  <Card title="Call graph in 7 languages" icon="random">
    TypeScript, Python, Ruby, Go, Rust, Java, Groovy. `callers`/`callees`/`trace`/`impact` ranked by query relevance — **unique vs CodeGraph**.
  </Card>
  <Card title="Local RAG search" icon="magnifier">
    Index docs, wikis, ADRs. Semantic search via embeddings (Ollama-compatible endpoint, optional). Works offline in lexical mode without Ollama.
  </Card>
  <Card title="100% local · zero APIs" icon="approve-check">
    No telemetry, no cloud calls, no accounts. Single Rust binary. MIT licensed. Linux x86/aarch64, macOS Intel/Apple Silicon, Windows x86.
  </Card>
</CardGrid>

## Compared to the field

| | **ctx** | RTK | CodeGraph | Context Mode | QMD |
|---|:---:|:---:|:---:|:---:|:---:|
| Auto-rewrite hook | ✅ | ✅ | ❌ | ❌ | ❌ |
| Native MCP server | ✅ | ❌ | ✅ | ✅ | ✅ |
| Command output compression | ✅ | ✅ | ❌ | ✅ | ❌ |
| Curated repo map (BM25+PageRank) | ✅ | ❌ | ❌ | ❌ | ❌ |
| Local RAG over docs | ✅ | ❌ | ❌ | partial | ✅ |
| Token budget binary search | ✅ | ❌ | ❌ | ❌ | ❌ |
| **Call graph** | ✅ | ❌ | ✅ | ❌ | ❌ |
| **Query-ranked graph results** | ✅ | ❌ | ❌ | ❌ | ❌ |
| **Token budget on graph output** | ✅ | ❌ | ❌ | ❌ | ❌ |
| Single Rust binary | ✅ | ✅ | ❌ TS | ❌ TS | ❌ TS |
| 100% local | ✅ | ✅ | ✅ | ✅ | ✅ |

[Read the detailed comparison →](/context-engine/compare/)

## What it does, concretely

<CardGrid>
  <LinkCard
    title="ctx exec — Command compression"
    description="17 command families. git push → 'ok abc1234 main'. kubectl logs deduplicated. cargo test keeps only failures."
    href="/context-engine/subcommands/exec/"
  />
  <LinkCard
    title="ctx graph — Call graph navigation"
    description="callers/callees/trace/impact. Query-ranked results. Token budget. Indexed in SQLite for instant queries."
    href="/context-engine/subcommands/graph/"
  />
  <LinkCard
    title="ctx map — Repo map for LLMs"
    description="Signatures extracted via Tree-Sitter, ranked by BM25+PageRank, capped by token budget. Drop into any prompt."
    href="/context-engine/subcommands/map/"
  />
  <LinkCard
    title="ctx catalog — Local docs RAG"
    description="Index markdown, wikis, ADRs. Search semantically (with Ollama) or lexically (without). All local."
    href="/context-engine/subcommands/catalog/"
  />
  <LinkCard
    title="ctx mcp — MCP server"
    description="10 tools exposed via stdio. Works with Claude Code, Cursor, opencode, any MCP-compatible client."
    href="/context-engine/subcommands/mcp/"
  />
  <LinkCard
    title="ctx install — Agent setup"
    description="One command configures hook + MCP server in ~/.claude/settings.json. Symmetric uninstall preserves your other configs."
    href="/context-engine/guides/agent-integration/"
  />
</CardGrid>

## Backed by numbers

- **271 tests passing** (228 unit + 43 integration), 0 failures
- **17 command families** covered by `ctx exec` filters (git, cargo, npm, docker, kubectl, aws, gh, gradle, maven, pytest, tsc, eslint, ruff, mypy, go test, rubocop, terraform…)
- **7 languages** in the call graph (TS, Py, Rb, Go, Rust, Java, Groovy)
- **10 MCP tools** exposed via stdio
- **5 platforms** supported (Linux x86/aarch64, macOS Intel/Apple Silicon, Windows x86)

## Open source · MIT licensed

[GitHub](https://github.com/JaimeJunr/context-engine) ·
[crates.io](https://crates.io/crates/ctx-engine) ·
[Release v0.1.0](https://github.com/JaimeJunr/context-engine/releases/tag/v0.1.0) ·
[Changelog](https://github.com/JaimeJunr/context-engine/blob/main/CHANGELOG.md)
