System Overview
EL4CTEO/fast-anything (current version v0.8.5, MIT License) is a Rust CLI tool, Claude Code plugin, and built-in MCP server. It profiles application bottlenecks, records real inputs and outputs, delegates porting of individual hot functions to standalone Rust crates via a coding agent, and swaps verified ports into place using a single reversible marked block.
Each ported function lives in a one-function crate sharing a single .fast/target build cache, keeping compile times to seconds. You can delete the cache at any time or set FAST_ANYTHING_DISABLE=1 to run the original implementation. The tool targets the outermost portable loop to minimize cross-language boundary crossings.
Per README.md and src/doctor.rs, v0.8.5 supports 12 languages and their corresponding bridges:
| Language and minimum version | Run command examples | Bridge and profiler |
|---|---|---|
| Python 3.10+ | python app.py, uv run, poetry run | PyO3; supports @staticmethod, dataclasses, NamedTuples, numeric NumPy arrays, and multiprocessing.Pool |
| JavaScript / TypeScript (Node 22+, Bun 1+, Deno 2+) | node app.ts, bun app.ts, deno run -A app.ts | napi-rs; supports worker_threads, static methods, Buffer, typed arrays, and Set<string> |
| Ruby 3.3+ | ruby app.rb | C ABI + JSON via built-in Fiddle; no headers required |
| Java 22+ | java App.java, mvn exec:java, gradle run | C bridge via the Java FFM API |
| Kotlin / JVM (JDK 22+, Gradle) | gradle run (src/main/kotlin) | Shared Java bridge; top-level functions, object, companion, and extension functions |
| Go 1.22+ | go run . | C bridge via the Windows loader or dlopen (cgo) |
| PHP 8.1+ | php app.php | C bridge via PHP's FFI extension (extension=ffi required) |
C / C++ (gcc, clang, Intel oneAPI icx/icpx) | clang -O2 main.c lib.c | C bridge via LoadLibrary or dlopen; -fsycl profiles and ports host functions only |
| C# / .NET 8+ | dotnet run -c Release | C bridge via NativeLibrary; profiled with EventPipe |
| R 4.0+ | Rscript app.R | C bridge via base R's .C(); profiled with Rprof, no packages or R headers required |
Installation and Prerequisites
Running fast-anything requires a local Rust toolchain and the target language runtime. Cargo.toml specifies Rust 1.88 (edition 2024) for building the binary, while doctor checks for cargo 1.85 or newer for compiling ported crates.
- Not completed:
Rust toolchain (required): Install
cargovia rustup (1.85+for ports;1.88+to build from source). - Not completed:
Target language runtime (project-dependent): Meet the minimum version in the table above; enable
extension=ffiinphp.inifor PHP; run from asetvars.batshell on Windows for Intel oneAPI. - Not completed:
AI coding agent (optional): Supports
claude,codex, or any CLI command reading a prompt onstdin; without--agent, pass.fast/ports/<id>/TASK.mdmanually to any tool.
Install globally via npm or Cargo, then run doctor to inspect your environment:
# Install via npm or Cargo
npm i -g @el4cteo/fast-anything
cargo install fast-anything
# Check Rust, language runtimes, and available agents
fast-anything doctorFor editor and agent integration, the repository ships both a Claude Code plugin and a built-in MCP server:
# 1. Claude Code plugin (run inside Claude Code)
/plugin marketplace add EL4CTEO/fast-anything
/plugin install fast-anything@fast-anything
# 2. Built-in MCP server (Claude Code, Codex, Cursor, and others)
claude mcp add fast-anything -- fast-anything mcpCore Commands and MCP Tools
fast-anything provides a unified CLI (with a global -C / --dir flag for target project folders) and exposes 8 matching tools with progress notifications over stdio JSON-RPC 2.0 via fast-anything mcp.
End-to-end
fast-anything go --agent <name> -- <cmd>
Profile, port, verify, enable, and benchmark in one command
Runs the full pipeline with --top (default 1), --attempts (default 3), --runs (default 5), and --samples (default 500), retaining the best verified attempt across retries.
Profiling
fast-anything scan -- <cmd> / fast_scan
Profile runtime and rank functions by portability
Runs a representative workload, scores functions by time share and portability, reports I/O or nondeterminism blockers, and skips functions below 2% share.
Recording
fast-anything port [id] / fast_port
Record real calls and scaffold a one-function Rust crate
Re-runs the app to capture up to 500 calls into .fast/ports/<id>/recordings.jsonl and generates the crate stub plus TASK.md; pass --agent to delegate immediately.
Verification
fast-anything verify [id] [--all] / fast_verify
Release-build and replay real plus derived cases
Replays every recorded call, synthetic edge case, and shrunk input; floats must match within 1e-9, errors must match type, and per-call runtime must beat the original.
Toggle
fast-anything enable / disable [id] [--all]
Swap the verified Rust port in or out
enable requires Rust sources matching the last passing verify (or --force); disable removes the marked block byte for byte and fails if a marker is missing.
Benchmarking
fast-anything bench [--runs 5] / fast_bench
Interleaved end-to-end timing: original vs Rust
Runs 5 interleaved iterations by default to measure whole-app speedup and warns if program output differs with Rust ports enabled.
Reporting
fast-anything report / status / build
Generate PR cards, inspect state, and rebuild ports
report writes .fast/report.md and .fast/report.svg; status prints the last scan and every port; build recompiles all ports after cloning or toolchain upgrades.
Diagnostics
fast-anything doctor / mcp
Verify local runtimes and start the MCP server
doctor checks cargo, minimum runtime versions, PHP FFI, and agents; mcp serves fast_scan through fast_status (8 tools) over stdio.
Verification Guarantees and Authoring Rules
fast-anything enforces behavioral equivalence and measured per-call speedup before enabling any port. Key rules from README.md, skills/fast-anything/SKILL.md, and src/agent.rs:
Combine recorded calls with synthetic edge and shrunk cases
verify replays up to 500 recorded calls plus derived cases covering NaN, ±infinity, -0.0, 0, ±1, non-ASCII text, empty inputs, inputs up to 16 times larger, and shrunk slices, using the original function as the oracle. Every case must match (floats within 1e-9, identical error types) and per-call speed must beat the original before enable succeeds.
README.md
Port the outermost portable loop to amortize FFI overhead
Crossing PyO3 or FFI boundaries carries per-call cost. Targeting the outermost portable function crosses into Rust once instead of millions of times; official benchmarks showed inner levenshtein ports yielding 35x and 1.9x versus 116x and 20x for the outer loop.
README.md
Preserve original functions and recordings; match language semantics
Leave the original function body untouched (the appended marked block performs the swap) and never edit recordings.jsonl. Match Unicode semantics (.chars() for Python, UTF-16 units for JavaScript), integer ranges, float operation order, and error paths; edit src/port.rs for Ruby, Java, Go, PHP, C/C++, C#, and R, or src/lib.rs for Python and JS/TS.
skills/fast-anything/SKILL.md
Profile representative workloads and skip functions under 2%
Run scan with a realistic application workload (avoid substituting the test suite). Functions under 2% of total runtime cannot produce visible gains; if pure compute is mixed with I/O or top-level script code, extract it into a standalone function or guard main execution before scanning.
skills/fast-anything/SKILL.md
Scoped agent presets and automatic speed retries
With --agent claude, fast-anything launches Claude Code with --permission-mode acceptEdits restricted to Read, Edit, Write, Glob, Grep, and cargo check/build/test/fmt; --agent codex runs codex exec --full-auto -. If a port passes correctness checks but runs slower per call than the original, go --agent sends it back for optimization and keeps the best correct attempt.
src/agent.rs / CHANGELOG.md
Workflow and Benchmark Example
Run either the single-command pipeline or individual subcommands to execute the same verification loop:
$ fast-anything go --agent claude -- python app.py
$ fast-anything scan -- python app.py
$ fast-anything port
$ fast-anything verify
ok: all recorded and derived cases matched
$ fast-anything enable
$ fast-anything bench
$ fast-anything report
$ FAST_ANYTHING_DISABLE=1 python app.py
$ fast-anything disable --allPublished examples/ benchmarks from README.md (Intel i5-10500 on Windows 11; C and C++ on a 4-core GitHub Actions Linux runner):
| Example application | Before | After and speedup |
|---|---|---|
| Python fuzzy dedupe (700 names) | 4.91s | 42ms (116x) |
| PHP fuzzy dedupe (600 names) | 2.94s | 53ms (55x) |
| Go fuzzy dedupe (3,000 names) | 3.02s | 144ms (21x) |
| TypeScript fuzzy dedupe (2,000 names) | 3.11s | 155ms (20x) |
| Ruby fuzzy dedupe (400 names) | 3.13s | 228ms (14x) |
| C# fuzzy dedupe (4,000 names) | 4.03s | 312ms (13x) |
| C mandelbrot (8 zoom levels) | 431ms | 127ms (3.4x) |
| Java fuzzy dedupe (4,000 names) | 3.50s | 1.18s (3x; 11x on the function, rest is JVM startup) |
| C++ fuzzy dedupe (6,000 names) | 3.02s | 1.09s (2.7x) |
Limitations and Guardrails
Next Steps and References
Validate your local setup: Run
fast-anything doctorafter installation to confirmcargo, target language runtimes, and agent CLIs are ready.Test on a built-in example: Copy
examples/fuzzy-dedupe/or another language example from the repository and runfast-anything scan,port,verify, andbenchto inspect.fast/report.mdand.fast/report.svg.Wire into your agent workflow: Install the Claude Code plugin for
/fast-anything:fast, or registerclaude mcp add fast-anything -- fast-anything mcpto expose all 8 MCP tools directly to your coding agent.