AIC
About
Local-first MCP server that sits transparently between your AI editor and any model, classifying intent, selecting the right files, and compiling focused context — with zero manual invocation
Details
- Author
- jatbas
- Categories
- Developer Tools
Jump to
Setup
Install AIC in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/jatbas/agent-input-compiler
Follow the installation instructions in the repository README, then restart your MCP client.
Local-first MCP server that compiles focused context for Cursor and Claude Code — classifies intent, selects relevant files, strips noise, and blocks secrets before they reach the model.
AIC doesnotreplace your editor. It runs alongside MCP-compatible editors and improves the context they send to the model.
AI coding tools often pull in too much irrelevant context. That wastes tokens, weakens instruction-following, and increases hallucinations.
AIC adds a compilation step before the model runs:
- classifies the task
- selects the most relevant files
- blocks sensitive or irrelevant content
- compresses the result to fit a token budget
- returns a bounded context package the model can reason over
The result is a smaller, more relevant, and more inspectable input.
The examples below mirror theshared stdout frameprinted by the diagnostic CLI (status,last,chat-summary,projects,quality— orpnpm aicwhen developing this repo withdevMode): each table starts with a title line and full-width rule, then aheroline (always present), another rule, fixed-widthbodyrows (padRowlabels are32characters wide inshow aic statusand30characters wide in the other diagnostic tables except the multi-columnprojectsroster), and an optional closing rule plusfootnote(both omitted on theprojectsroster, which ends after its body rows). Values arerepresentative(not a single verbatim session); totals come from yourlocaldatabase (~/.aic/aic.sqlite) and thecurrent project, so your output will not match these figures exactly.
Status = project-level AIC status. ────────────────────────────────────────────────────────────────────────────── AIC optimised context across 8,743 context builds; cumulative raw → sent tokens 6.80B → 100.57M (68:1 ratio); 37.1% cache hit rate; 98.5% context precision (weighted). ────────────────────────────────────────────────────────────────────────────── Context builds (total) 8,743 Context builds (today, UTC) 94 Cumulative raw → sent tokens 6.80B → 100.57M (68:1 ratio) Tokens excluded 6,695,482,938 ────────────────────────────────────────────────────────────────────────────── Context window used (last run) 72.4% Cache hit rate 37.1% Context precision (weighted) 98.5% ────────────────────────────────────────────────────────────────────────────── Guard scans (lifetime) count command-injection 670,061 excluded-file 59 prompt-injection 4,743 secret 16 Top request types count share general 5,043 69.9% docs 1,098 15.2% bugfix 1,072 14.9% Sessions total time 509h 14m Last compilation fix session time always showing — in status 4 / 591 files · 1,842 tokens · 2 min ago ────────────────────────────────────────────────────────────────────────────── Installation (global MCP server) OK ────────────────────────────────────────────────────────────────────────────── Context precision (weighted): % of repo content automatically filtered per context build. Context window used: % of token budget filled.
Arolling time windowon status (show aic status 7dorstatus --window 7) adds aTime rangebody row (Last 7 dayswhenNis 7) and switches the guard block header fromGuard scans (lifetime)toGuard scans (Nd)(sameNas the window) so the label matches the guard aggregate window. Seeimplementation-spec.md—aic_statusand[mcp/src/format-diagnostic-output.ts.
Last = most recent compilation. ────────────────────────────────────────────────────────────────────────────── AIC optimised context by intent: files forwarded 5 of 567; tokens compiled 595 of 123,500 allocated (0.5% of token budget); token reduction 99.9% (raw to compiled). ────────────────────────────────────────────────────────────────────────────── Context builds 7,666 Intent task 318 spec-compile-cache migration 004 SqliteSpecCompileCacheStore Files 5 selected / 567 total Tokens compiled 595 Compiled in 2.4 s Context window used 0.5% Compiled 2 min ago Editor claude-code Session time 2h 14m Cache miss Guard (this run) 2 findings across 5 files (2 files blocked) Compiled prompt Available (595 tokens) — .aic/last-compiled-prompt.txt (project root) ────────────────────────────────────────────────────────────────────────────── Context window used: % of token budget filled.
Chat = this conversation's AIC compilations. ────────────────────────────────────────────────────────────────────────────── AIC optimised context by intent across 42 compilations (88:1 ratio, 40.0% cache hit rate). ────────────────────────────────────────────────────────────────────────────── Project path /dev/AIC Context builds 42 Cumulative raw → sent tokens 8.80M → 100,000 (88:1 ratio) Tokens excluded 5.00M ────────────────────────────────────────────────────────────────────────────── Cache hit rate 40.0% Context precision (weighted) 55.2% ────────────────────────────────────────────────────────────────────────────── Last compilation refactor diagnostic output · 2 min ago Session time 3h 12m Top request types count share refactor 20 62.5% general 12 37.5% ────────────────────────────────────────────────────────────────────────────── Context precision (weighted): % of repo content automatically filtered per context build.
Projects = known AIC projects. ────────────────────────────────────────────────────────────────────────────── 1 project(s); 7,796 compilations; latest activity 2 min ago. ────────────────────────────────────────────────────────────────────────────── Project ID Path Last seen Compilations 018f0000-0000-7000-8000-00000000aa01 /Users/dev/AIC 2 min ago 7,784
Quality = context build quality metrics. ────────────────────────────────────────────────────────────────────────────── AIC optimised context by intent across 137 compilations in the last 7 days (median 99.6% filtered, 38.0% cache hit rate). ────────────────────────────────────────────────────────────────────────────── Time range Last 7 days Compilations 137 ────────────────────────────────────────────────────────────────────────────── Median context precision 99.6% Median selection ratio 1.1% Median budget used 3.1% Cache hit rate 38.0% Tier mix full 100.0% sig+doc 0.0% sigs 0.0% names 0.0% Task class mix count share budget refactor 4 2.9% 0.4% bugfix 12 8.8% 0.7% feature 9 6.6% 0.5% docs 24 17.5% 3.1% test 4 2.9% 0.7% general 84 61.3% 14.6% Classifier mean 7.5% Daily compilations ▁▁▁▁▁▁█ Tue Wed Thu Fri Sat Sun Mon ────────────────────────────────────────────────────────────────────────────── Context precision % of repo content automatically filtered per context build. Selection ratio: % of repo files selected per build. Budget used: % of token budget consumed per build. Cache hit rate: % of builds served from cache without recompiling. Tiers: full = entire file · sig+doc = signatures + docs · sigs = signatures only · names = symbol names only. Compilations Builds AIC performed in this window (cache hits included). Task class mix How AIC classified each build, with its share and median token budget used. Higher "budget" means AIC allocated more context for that task type. "general" is the classifier's fallback when confidence is low. Classifier mean Mean confidence of the task classifier (0-100%). Low values mean frequent fallback to "general" — not a quality problem by itself, but worth noting when most builds are "general".
The CLI defaults to a7-daywindow when you omit flags (show aic qualityoraic quality). With compilations in the window, the body also includes median rows, tier mix, task-class columns, optional sparklines, and the same multi-line glossary footnote shown below for the empty case.
Requirements: Node.js >= 22 (see.nvmrcfor the reference Node major used to develop and test AIC).
-
…
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





