SiftrCode V2 • Outcome-Aware Context Optimization

Context optimization, outcome-aware

Discovers, ranks, and composes compiler-verified repository context bundles — maximizing coding-agent task success while eliminating 90% of token bloat under strict economic budget ceilings.

🎯 Edit Targets Protected ⚡ AST Interface Skeletons 📐 Submodular Synergy 🔒 100% Local • Zero Egress
Explore Interactive Optimizer
$ npx siftrcode context "task prompt"
Local CPU Zero Network Egress
Task Prompt: 100% Recall@20
Budget Cap: 16k tok / $0.05 max
Presets:
cplan_9bf2a481 • ContextPlan
Submodular Synergy Bundle
EDIT TARGET (FULL IMPLEMENTATION BODY PROTECTED) RESOLUTION 5 (FULL)
src/webhooks/signature_verifier.ts
Identified via stack trace match & exact prompt symbols. Retained 100% body to allow editing without hallucination.
1,420 tok
100% Retained
DEPENDENCY INTERFACES (AST SKELETON SYNTHESIS) −92% TOKENS
src/auth/jwt.ts Interface skeleton: 4 types, 2 public methods
480 tok 4,120
src/db/session.ts Interface skeleton: SessionManager, TransactionClient
520 tok 5,800
src/queue/event_bus.ts Interface skeleton: EventPublisher, DeadLetterQueue
610 tok 6,400
SUPPRESSED DEADWEIGHT (ZERO CONTEXT POLLUTION) 14 Files Omitted
tests/e2e/legacy.test.ts, scripts/deploy.sh, docs/arch.md, src/frontend/Header.tsx, src/billing/tax.ts...
Raw Context
94,200 tok
V2 Bundle
3,030 tok
Turn Cost
$0.0091
−96.8% Tokens Save $0.273 / turn

Works with Claude Code & Cursor

Select your coding agent to view instant setup commands.

Connect to Claude Code

Guide →

Registers SiftrCode's Stdio MCP server to prune code before Claude reads it.

$ claude mcp add siftrcode -- npx -y siftrcode mcp
Or optimize context directly from terminal:
$ siftr context "task description"
Standard Model Context Protocol (MCP) Tools 8 NATIVE TOOLS
siftr_context

Primary V2 outcome-aware context optimizer enforcing budgets & cost caps.

siftr_expand

Progressive disclosure tool expanding skeletons into full implementation bodies.

siftr_outcome

Reports verification evidence (tests, builds, regressions) to close the learning loop.

siftr_rank

Explainable candidate ranker with transparent multi-channel scoring breakdowns.

siftr_session

Inspects multi-turn session telemetry, trajectory events, and budget burn rate.

siftr_skeleton

AST interface extractor for TypeScript, Python, Go, and Rust source files.

siftr_audit

Audits codebase token footprint and calculates potential team ROI savings.

siftr_pack

Generates whole-directory pruned context packs for task-focused areas.

PIPELINE SPECIFICATION

The 6-Stage Optimization Engine

How SiftrCode V2 delivers 100% recall on critical edit targets while compressing token payloads by up to 90%.

STAGE 01 Recall@20: 100%

Multi-Channel Candidate Recall

Blends Exact symbol matches, BM25 text retrieval, Stack Trace log parsing, Semantic AST Context Graph, and Git Co-Change intelligence to never miss relevant code.

STAGE 02 ContextFeaturesV1

Point-in-Time Versioned Features

Extracts deterministic feature vectors with strict FeatureCutoff timestamps, strictly eliminating data leakage and lookahead contamination.

STAGE 03 ContextRank

Transparent Heuristic Ranker

Scores candidates with fully inspectable component breakdowns. Applies deterministic penalties to lockfiles, generated code, and unrelated tests.

STAGE 04 BundleComposer

Submodular Synergy Bundler

Assembles bundles with diminishing marginal returns. Maximizes task evidence coverage while suppressing same-file symbol redundancy and dead weight.

STAGE 05 ResolutionRank

Safe Variable Degradation

Protects direct edit targets at FULL/BODY resolution. Degrades surrounding modules into compiler-verified AST skeletons, and non-code files safely.

STAGE 06 BudgetSolver

Constrained Cost Optimization

Strictly enforces token caps (e.g. 16,000 max) and economic cost ceilings (e.g. $0.05/turn) with precise pricing models for Sonnet 3.7 and GPT-4o.

Outcome-Aware Context Economics

Token Economics & ROI

Smarter context allocation, not naive stripping. SiftrCode V2 maximizes marginal agent utility per token—cutting typical context payloads by 60%–88% while guaranteeing 100% full implementation fidelity on direct edit targets.

Budget Profile: Balanced (Default) • Optimal Quality & Cost
Variable-Resolution Allocation (85,000 Raw Tokens) Stage 05 • ResolutionRank
100% BODY RESOLUTION 16.5% of raw
Edit & Failure Targets
14,000 tokens • 0% fidelity loss

Full function bodies preserved for files the agent modifies or inspects. Zero missing lines, zero hallucinated edits, zero re-try loops.

88% AST COMPRESSION 4.9% of raw
Structural Dependencies
4,200 tokens • Signatures & Types

Distant callers and imports synthesized into compiler-verified AST skeletons. Retains all interfaces, types, and docs while collapsing bodies.

100% PRUNED BLOAT 78.6% dropped
Transitive Distractors
66,800 tokens • 0 ingested

Unrelated services, test fixtures, and noise files omitted safely before prompt ingestion, shielding the LLM from distraction and context drift.

Context Window

Payload per Turn

−78.6% Tokens
85k
42k
85,000
raw tokens (100%)
Raw
−78.6%
18,200
optimized
V2
Without Siftr
SiftrCode V2

100% full bodies on edit targets • 88% AST skeletons on dependencies.

Claude Spend

Monthly Cost / Dev

Save $280 / mo
$357
$178
$357.00/mo
$4,284 / yr
$0.255/turn
Save $280
$76.44/mo
$917 / yr
$0.055/turn
Without Siftr
SiftrCode V2

Saves $0.20/turn • $3,367 net annual savings per engineer.

Multi-Model Impact per Turn (85k Raw → V2 Optimized) Current Frontier Pricing
Claude 3.7 Sonnet $3.00 / MTok
$0.255 $0.055 / turn
−78.6%
OpenAI GPT-4o $2.50 / MTok
$0.213 $0.046 / turn
−78.6%
Claude 3 Opus / o1 $15.00 / MTok
$1.275 $0.273 / turn
Save $1.00/t
Net ROI
+$3,367/ dev
Prompt Speed
4.7xfaster
10-Dev Team
+$33.7k/ yr
$ npx siftrcode optimize --profile balanced
Truthful Token Accounting • TokenizerRegistry Calibrated
Tracks estimatedRenderedTokens calibrated against Claude BPE (~3.7 chars/tok) and GPT cl100k/o200k (~3.6 chars/tok) with measured actualProviderInputTokens reconciliation. Zero hidden context overflow.
Audit telemetry →

* Modeled on typical 85k-token repository payload at 50 turns/day, 28 work days/mo (1,400 turns/mo per dev). Claude 3.7 Sonnet ($3.00/MTok in), GPT-4o ($2.50/MTok in), Claude 3 Opus ($15.00/MTok in).

Simple Licensing

Free open-source CLI for individuals. Paid caching for teams.

OPEN SOURCE
INDIVIDUAL DEVELOPERS

Community CLI

$0 Free forever (MIT)
  • V2 Context Engine (siftr context)
  • Multi-Channel Candidate Recall (100% Recall@20)
  • Safe Variable Degradation & Edit Target Protection
  • AST Interface Skeletons (TS, Py, Go, Rust)
  • Stdio & HTTP/SSE Model Context Protocol (MCP)
TEAM PRO
FOR STARTUPS & TEAMS

SiftrCode Pro

$19 / seat / mo
  • Everything in Community CLI
  • Team Cross-Repo Semantic Context Cache
  • Exposure-Aware Outcome Telemetry & Analytics
  • CI/CD PR Context Gates & Custom Budget Ceilings