πŸš€ Zero-OOM Enterprise Engine Released β†’

Free for codebases under 50,000 lines

5,554,607 596,752 89.3% $10.99

Deterministic AI Context for IDE AI agents.

Foldwork indexes your codebase once and gives AI agents fast, dependency-aware context through MCP.

Stop wasting tokens scanning thousands of files. Give your AI the exact code context it needs.

Works With

Claude Cursor Codex Any MCP-compatible AI client
Foldwork + Cursor MCP
User: Where is the Kafka consumer configured for user events?
[Foldwork] ↳ `injector_search("Kafka user event consumer")` ... Retrieved 3 symbols (24 ms)
Agent: The Kafka consumer is configured in `src/events/consumer.go`. The specific struct is `UserEventConsumer`, which relies on `AuthService` and `DBConnection` as its primary dependencies. Here is how it's initialized...
Local-first
Runs entirely on your machine
Works with existing MCP clients
Supports enterprise-scale repositories

Why traditional AI workflows fail

Naive retrieval dumps entire files, overflowing context limits and causing hallucinations.

When working with large enterprise codebases, sequential file exploration fundamentally breaks the AI context window. Naive tools like grep or basic AST tree-sitters retrieve raw files blindly. When an agent traces a single bug, it often pulls in 50+ files containing thousands of irrelevant lines of boilerplate, imports, and disconnected logic.

This rapid context bloat guarantees two failure modes. First, the LLM exceeds its context limit and crashes the session. Second, even if the prompt fits, the sheer volume of noise dilutes the attention mechanism. This leads to severe hallucinations where the model invents dependencies or confidently suggests calling methods that do not actually exist in your architecture.

Without Foldwork

AI Agent
Naive Search / grep
50+ files retrieved
18,000 tokens consumed
Hallucination / Context Limit Exceeded

With Foldwork

AI Agent
Foldwork
12 relevant symbols retrieved
1,800 tokens consumed
Correct Answer

Ask your repository.

> Find every Kafka consumer
Searching...
Retrieved 8 symbols
Opening dependency graph...
Done.
Found 3 Kafka consumer structs:
- `UserEventConsumer` (src/events/user.go)
- `BillingConsumer` (src/events/billing.go)
- `NotificationConsumer` (src/events/notify.go)
> Explain authentication flow
Tracing references for 'AuthMiddleware'...
Traversing graph (depth=3)...
Done.
1. HTTP requests pass through `AuthMiddleware` (src/api/middleware.go)
2. Token validation via `ValidateJWT()` (src/auth/token.go)
3. User lookup hits `FindUserByID()` (src/db/users.go)
4. Rate limiting applied by `CheckRateLimit()` (src/redis/limit.go)
> Generate architecture diagram
Calling injector_diagram()...
Done.
```mermaid
sequenceDiagram
  participant API
  participant Parser
  participant SQLite
  API->>Parser: ParseAST(file)
  Parser->>SQLite: UpsertSymbol(sym)
```
> Find circular dependencies
Running cycle detection on Dependency Graph...
Done.
Found 1 circular dependency path:
`UserService` (src/services/user.go) -> `BillingService` (src/services/billing.go) -> `UserService`

Recommendation: Extract common interface into `src/interfaces/user.go` to break the cycle.

How it works

A transparent mental model. No black-box embeddings.

1
πŸ“¦

Incremental Parsing

Foldwork scans your repository instantly using a single-pass AST parser, identifying all interfaces, classes, and function signatures without blocking.

2
πŸ”—

Graph Generation

It deterministically builds two structures: a Symbol Graph for precise definitions, and a Dependency Graph tracking outbound caller/callee relationships.

3
πŸ—„οΈ

Local Catalog

The graphs are durably stored in a local SQLite FTS5 catalog. Indexing happens exactly once per file change, meaning zero overhead during AI prompts.

4
πŸ”Œ

MCP Serving

Your AI agent securely communicates with Foldwork via the Model Context Protocol, fetching sub-graphs in milliseconds without the code ever leaving your machine.

Foldwork replaces black-box vector embeddings with a deterministic, graph-based ingestion pipeline. It uses an incremental AST parser to read your codebase, immediately mapping out two distinct structures: a Symbol Graph containing every interface, class, and function signature, and a Dependency Graph tracking outbound caller/callee relationships.

These graphs are durably stored in a local SQLite catalog. We chose SQLite because it offers robust ACID guarantees, requires zero external dependencies, and supports sub-millisecond querying via FTS5. This local-first catalog means indexing happens exactly once per file change, not on every AI prompt.

When an AI agent requests context, it communicates with the Foldwork Retriever via the Model Context Protocol (MCP). The transport layer securely bridges the gap to the LLM, enabling the agent to fetch precisely the right sub-graphs without the repository ever leaving your machine.

Why engineers trust Foldwork

Trust in developer tools is earned through predictability. Foldwork is built around canonical determinism: by alphabetically sorting directory trees, stripping non-semantic metadata, and applying consistent formatters before cataloging, we ensure that the same repository state always produces the exact same byte-for-byte retrieval output.

This strict determinism is not just an architectural purity goalβ€”it has massive financial implications. Because Anthropic's KV prompt cache requires identical prefix matching, Foldwork's predictable outputs guarantee that subsequent Claude sessions hit the cache 100% of the time, reducing API costs by up to 90% while dramatically accelerating response times. Furthermore, the local-first, air-gapped architecture ensures that your proprietary intellectual property never leaves your machine for indexing.

Deterministic Outputs

Same repository state produces the same retrieval results.

Local-First Architecture

Your repository never leaves your machine.

Incremental Indexing

Only changed files are reprocessed.

Observable Behavior

Transparent retrieval and indexing.

Reproducible Results

Canonical outputs improve prompt cache efficiency and debugging.

Graceful Failure

Recover from real developer workflows instead of failing unexpectedly.

Core Features

Repository Intelligence

Understand repositories as connected graphs rather than disconnected files.

Foldwork maps cross-module boundaries by extracting semantic links between interfaces, implementations, and their callers. Instead of just grepping for a function name, the agent can traverse the call stack up or down, ensuring it understands the entire data flow before attempting a refactor.

Using the injector_diagram tool, Foldwork can autonomously generate crisp Mermaid sequence diagrams of your architecture. An algorithmic layout engine actively prunes language primitives (like String or boolean) and internal framework bounds to keep diagrams focused purely on business logic.

AI Context Engine

Deliver only the context an AI actually needs.

The engine automatically prunes massive files using our Compress-Cache-Retrieve (CCR) algorithm. By stripping out function bodies and leaving only the structural signatures and imports (Folded Maps), we can deliver the blueprint of a 10,000-line file in under 500 tokens, giving the LLM the "shape" of the code without the bloat.

Enterprise Scale

Remain responsive on repositories containing millions of lines of code.

Engineered for 5M+ LOC monorepos, Foldwork implements strict OOM-prevention circuit breakers and uses a stream-oriented JSON-RPC pipeline to handle massive payloads. Background indexing is throttled to respect developer workloads, idling at <45MB of RAM even on massive Java and Go enterprise architectures.

Developer Safety

Protect repositories from unsafe AI-generated edits.

AI agents make mistakes. Foldwork acts as a strict hypervisor that statically analyzes AI write operations. If an LLM hallucinates and tries to overwrite a file using our compressed "Fold Markers", the daemon hard-rejects the payload before it ever touches the disk, mathematically guaranteeing that the AI cannot accidentally delete your business logic.

Additionally, our Shannon entropy filters dynamically redact AWS and SSH keys from the AST before they leave your machine.

The Tools

A full command palette for your AI assistant.

$ injector_search
Search symbols instantly across the entire catalog using FTS5.
$ injector_retrieve
Retrieve exact implementations via SHA-256 retrieval keys.
$ injector_diagram
Autonomously generate Mermaid sequence diagrams for any symbol.
$ injector_regex_search
Native literal and extended regex bridge for punctuation-heavy queries.
$ injector_stats
Live repository metrics and compression ratio telemetry.
$ get_project_map
Returns a compressed, folded structural overview of the workspace.
$ injector_sync
Waits for all pending background file index updates to complete.
$ injector_blast_radius
Analyzes architectural impact by traversing the dependency graph.
$ injector_git_context
Integrates with local Git history to surface commit context and code evolution.
$ injector_inspect_table
Enables direct database introspection capabilities. Requires FOLDWORK_DB_DSN.
$ injector_clear_cache
Wipes the SQLite index cache and triggers a clean cold-start full re-index.
$ injector_write_file
Safe AI-assisted editing with fold-marker collision prevention.

Benchmarks

Real numbers. Reproducible locally.

A tool that takes 5 minutes to index your codebase is useless for a developer in the middle of a debugging session. Foldwork is engineered for instantaneous feedback. By utilizing a highly optimized, single-pass AST parser combined with the zero-overhead FTS5 indexing of SQLite, we achieve indexing speeds that feel entirely synchronous.

Memory footprint is equally critical. Heavy IDE plugins and language servers often consume gigabytes of RAM, starving the host machine. Foldwork's daemon idles at approximately 45MB, ensuring your local environment remains snappy even when working inside massive legacy monorepos.

However, FTS5 tokenizers are notoriously bad at searching for hardcoded punctuation or exact regex patterns. Foldwork solves this with the injector_regex_search tool, which acts as a hybrid engine that gracefully bridges into native git grep -nE/-nF, giving the AI agent flawless literal and regex matching capabilities when semantic search isn't enough.

Benchmark Target
Spring PetClinic (45k LOC)
1.8s
Full Indexing
41MB
Idle Memory
12ms
Search (BM25)
18ms
Retrieve Context

* Measured locally using the Foldwork benchmarking suite. Results are reproducible by running the benchmark tool against the same repository and environment.

Enterprise Readiness

Foldwork is not a weekend prototype; it is an enterprise-grade daemon designed to survive the chaos of real-world development environments. When you switch Git branches containing thousands of file changes, Foldwork gracefully handles the churn through a robust event-debouncing mechanism that prevents redundant re-indexing operations.

When indexing massive 100,000+ file monorepos, hitting Linux inotify file-watcher limits (ENOSPC) is guaranteed. Foldwork doesn't just crash; it safely pauses, opens a direct /dev/tty interactive bridge to prompt the developer to scale their OS limits (via sysctl), and dynamically resumes indexing without requiring a restart.

We've also implemented strict OOM (Out Of Memory) protections that abort operations on pathological files (e.g., a 5MB minified JSON file) rather than crashing the daemon. Automatic schema versioning ensures that when you upgrade the Foldwork binary, the local SQLite catalog is seamlessly migrated without requiring manual cache purges.

Reliability

  • Crash recovery on malformed files
  • Graceful degradation for API limits
  • Complete workspace isolation

Performance

  • Event debouncing
  • Sub-millisecond FTS5 retrieval
  • Zero-OOM streaming architecture

Operations

  • Automatic schema versioning
  • Interactive ENOSPC remediation
  • Local durable cache

Supported Languages

Java
Go
Python
TypeScript
JavaScript
C++
C#
Rust
Vue
Svelte

Use Cases

Trace authentication flow
Find dead code
Generate architecture diagrams
Understand dependency graphs
Locate implementations
Refactor safely
Review pull requests
Navigate large monorepos

Zero Configuration

No cloud account.
No API keys.
No indexing server.

Install it. Point it at a repository. Start coding.

curl -fsSL foldwork.dev/install | sh

Everything is documented.

$12 $99