fastctx logo

fastctx

Fast, context-efficient repository tools for AI agents (MCP)

RustAI AgentsDeveloper ToolsRustApache-2.0 379 13Health 77
GitHub

What is it?

What it is

A local Rust tool runtime providing structured repository operations (file read/search, file discovery, batch replacement, Bash command execution) for AI agents to reduce context overhead.

Why it exists

To minimize AI agents' focus on tool mechanics (e.g., command syntax, path handling) by abstracting repository interactions into structured input/output formats.

Who should use it

AI agent developers, LLM-based coding assistants, and engineers using MCP-compatible clients (like ChatGPT or Codex) who need efficient, structured repository interaction tools.

Who should avoid it

Users who require a purely sandboxed/web-only environment without local system access, as FastCtx requires local execution and can perform file writes and shell commands.

How it works

A quick walkthrough in plain English

How fastctx works

Step 1 of 3

You interact with it

Open fastctx, send a request, or connect it to your stack.

Features

MCP (Model Context Protocol) integration
Rust-based runtime for high performance
File operations: read (text, images, PDFs, hex), grep (ripgrep-based), glob, and replace (atomic batch replacement)
Bash command execution with foreground and background job management
Persistent background jobs that survive session restarts
Full-screen TUI (Terminal User Interface) for configuration and job monitoring
Automatic encoding detection and pagination for large files
Support for multiple distribution channels (npm, cargo, GitHub Releases)
Configurable output tiers for large context management
Security features including dry-run modes and tool approval modes

Advantages

  • Reduces model reasoning overhead by providing structured, predictable tool inputs/outputs
  • Improves context efficiency by handling complex command construction and escaping internally
  • Provides stable, persistent tool execution via a dedicated runtime process
  • Offers robust job management with rolling output buffers and persistent storage
  • Ensures safe file modifications through atomic replacement and dry-run capabilities
  • Simplifies complex repository navigation for AI agents

Disadvantages

  • Requires manual enablement for Bash/shell execution tools for security
  • Background job output is limited to an 8 MiB rolling buffer
  • Higher output tiers consume model context faster
  • Requires Node.js 18+ for npm installation

Installation

native

Install with npm:

```console
npm install --global fastctx
fastctx
```

If the install returns 404:

```console
npm install --global fastctx --registry=https://registry.npmjs.org/
```

One-off run:

```console
npx fastctx
```

Other distribution channels:

```console
cargo install fastctx --locked
```

GitHub Releases provides a zip archive for Windows x64 and executable-preserving tar.gz archives for Linux x64, macOS x64, and macOS arm64.

FAQ

How do I install FastCtx and launch the control terminal?

Install via npm with a recent Node.js (≥18): ```bash npm install --global fastctx fastctx ``` The first launch opens a full‑screen TUI where you can configure settings, enable Bash tools, and start ChatGPT/Codex sessions. If you prefer a one‑off run, use `npx fastctx`.

What core tools does FastCtx provide and how can I enable the Bash command tools?

FastCtx ships with four file‑centric tools: - `read` – read text, images, PDFs, or raw bytes - `grep` – regex search in files or trees - `glob` – file pattern matching - `replace` – mechanical batch replacements The five Bash‑related tools (`run`, `run_background`, `job_output`, `job_kill`, `job_list`) are disabled by default. Enable them in the TUI under **Bash terminal** or by starting the server with `--enable-shell`.

How can I run a long‑running command in the background and later fetch its output?

Use `run_background` to start the job: ```json {"command": "cargo test", "timeout_ms": 180000} ``` It returns a `job_id`. Retrieve incremental output with `job_output` (use `after_seq` to page) and terminate the job with `job_kill` if needed. Completed jobs are listed by `job_list` and their output is retained until the storage limit is reached.

How do I control the CPU parallelism used by `grep` and `glob`?

In the TUI’s **Config → Search** panel, set `max_cpu_cores` to an integer (1‑16) or `auto` for automatic detection. The setting is written to `~/.fastctx/config.toml` under `[search]`. It takes effect after restarting the server and does not require Apply.

What non‑interactive commands can I use to manage FastCtx?

FastCtx offers a CLI for scripted use: - `fastctx apply --tier standard --yes` – install and configure - `fastctx status` – check configuration and health - `fastctx jobs` – list running jobs - `fastctx jobs kill <job_id>` – stop a job - `fastctx unapply --yes` – remove FastCtx data - `fastctx lang <code>` – change TUI language These commands work without opening the interactive terminal.

Loading documentation…
View on GitHub

Featured in Videos

YouTube tutorials and walkthroughs for fastctx

Alternatives

Similar projects ranked by category, topics, and text overlap.

Compare
fastctx | MushyBook