Token compression
for AI coding
agents.
Senkani is a native macOS binary that sits between your coding agent and your filesystem. Every file read is compressed, every shell output filtered, every symbol search answered from a local index — before a single token reaches the model. Claude Code, Cursor, Copilot, any MCP-compatible agent.
Perception shrinks before the LLM sees it.
Senkani compresses at three places: the tool output (filter pipeline), the tool call itself (smart denials for redundant re-reads), and the model's response (terse mode). All three run in the same binary. All three are measurable.
- 24+ command filters.
npm install: 428 lines → 2.git clone: 312 → 4. Mutating commands pass through unchanged. - Symbol-level reads. Outline by default (50 tokens); full content only when you pass
full: true. - Smart denials. Re-read the same file 40 s later? The hook answers from cache; the LLM never sees the redundant call.
20 tools your agent actually wants.
Every senkani MCP tool is designed for a specific friction point in an agent-driven coding session. Compressed reads, filtered shells, symbol lookups, sandboxed parse, local embed + vision, budget-bounded repo bundles.
- Perception tools —
senkani_read,senkani_search,senkani_fetch,senkani_outline,senkani_explore,senkani_deps. Backed by 25-language tree-sitter index + FTS5. - Local ML —
senkani_embed(MiniLM, 384-dim) +senkani_vision(Gemma). Zero API cost. Fully offline. - External —
senkani_web(JS-rendered + SSRF-guarded),senkani_search_web(DuckDuckGo Lite, no key,guard-research-filtered),senkani_repo(GitHub, host-allowlisted).
20 panes. One canvas. Your layout.
A horizontal canvas of typed panes. Each pane is a primitive — Terminal, Code Editor, Browser, Hook Timeline, Analytics, Knowledge Base, Sprint Review — and you arrange them however makes sense for what you're doing right now. Senkani persists the layout per project.
- ⌘K command palette. Search-as-you-type for any of the 20 pane types — derived directly from the Add-Pane gallery so what's listed is what launches.
- Per-pane toggles. F/C/S/I/T controls run independent compression per pane — a terse research pane next to a full-fidelity build pane.
- Sub-3 ms renders. SwiftTerm + Metal on M-series. p50 ~2.1 ms, p99 ~3.4 ms.
It gets better the more you use it.
Senkani mines your own sessions for patterns and surfaces four artifact types — filter rules, context docs, instruction patches, workflow playbooks. Proposals flow .recurring → .staged → .applied. You accept or reject each one; nothing touches instructions without explicit OK.
- Laplace-smoothed confidence gates every promotion. Threshold 0.7 by default, with ≥3 distinct sessions of evidence.
- Instruction patches never auto-apply. Schneier gate — human-in-the-loop for anything touching the agent's tool hints.
- Sprint + quarterly cadence.
senkani learn reviewweekly;senkani learn auditquarterly to retire stale applied artifacts.
A project graph that survives hand-edits.
Every project gets a knowledge base — entities, links, decisions — stored as markdown at .senkani/knowledge/*.md. SQLite is a rebuilt index, not the source of truth. Hand-edit the markdown; the index follows. Corrupt the SQLite; rebuild from markdown.
- FTS5 search + BM25 ranking.
senkani_knowledgeorsenkani kb search. - Enrichment validator flags information loss, contradiction, excessive rewrite before any Gemma enrichment commits.
- Rollback + timeline. Every change is append-only history;
senkani kb rollbackreverts;senkani kb timelineshows the full chronology. - Portable vault.
senkani kb migrate --to ~/My-Vaultrelocates the markdown out of the project tree; per-project slug keeps multi-repo vaults isolated. Idempotent migrate / unmigrate, conflict detection, no silent overwrite.
A trust boundary, not a plugin host.
v0.3.0 defaults are all secure: prompt-injection guard on, SSRF hardening on, secret redaction on, schema migrations versioned + crash-safe. Opt-outs are explicit env vars, not hidden flags. Every defense increments a counter you can inspect via senkani stats --security.
- SSRF guard. DNS-pre-resolve + redirect re-validation +
WKContentRuleListsubresource blocklist. 169.254.169.254 and friends are unreachable. - 14 secret-detector families + entropy fallback. 1 MB benign input: ~25 ms. Every tool output scanned before the model sees it.
- Socket-auth handshake. Opt-in via
SENKANI_SOCKET_AUTH=on. Flipping to on by default next release.
Numbers from senkani bench on your hardware.
Every number here is reproducible. Run senkani bench to verify on your machine.
tools/perf-gate.sh; senkani doctor surfaces green / warn / burn per SLO.Install in three minutes.
Clone, build with Swift Package Manager, launch SenkaniApp, then register hooks per project. Idempotent — safe to re-run.
# clone + build git clone https://github.com/ckluis/senkani cd senkani swift build -c release # launch the workspace (auto-registers global MCP + hook wrapper) .build/release/SenkaniApp # register PreToolUse + PostToolUse hooks for THIS project cd /path/to/your/project /path/to/senkani/.build/release/senkani init # verify /path/to/senkani/.build/release/senkani doctor