finds.dev← search

// the find

255308153/CtxGuard

★ 203 · Python · MIT · updated Oct 2026

面向 AI Agent 的高并发、低延迟上下文治理与 Prompt Cache 守护网关 (Tree-sitter AST / Tool Delta / 50%~80% Token 削减)

A reverse proxy that sits between coding agents (Claude Code, Cursor, Codex) and model providers, rewriting outbound requests to cut token usage and keep prompt caches warm. Aimed at anyone running long agentic sessions who's eating Anthropic/OpenAI prefix-cache misses and bloated tool-output context. Single-maintainer Python project, MIT licensed.

The tool-schema alphabetical resort to fix prefix-cache invalidation from unordered JSON dict serialization is a real, specific problem with provider prompt caching and a legitimate fix. Tree-sitter based AST skeletonization with an ast fallback for 9+ languages is the right approach for folding unchanged function bodies without breaking syntax. The Jaccard-similarity shadow state machine for diffing repeated ls/git-status/find_by_name output is a genuinely clever, narrow technique rather than generic summarization. Secret redaction for API keys, PEM blocks, and connection strings before they hit the model is a sane default for a MITM proxy handling agent traffic.

It's a man-in-the-middle proxy for API keys and full coding-session context, and there's no mention of a security review, threat model, or even TLS story for the upstream hop — that's a lot of trust to hand a single-maintainer tool. The 'self-evolving' learn engine writes directly into AGENTS.md/.cursorrules based on LLM-inferred causality extraction, which means hallucinated or wrong rules can get silently persisted into a project's instructions. The production numbers (10,868 requests, $214.85 saved, 65.97% compression) come from one person's local sqlite file, not an independent benchmark, despite being presented with benchmark-table precision. Lossy folding plus a 'ctx_expand' virtual-tool interception layer means the proxy is deciding what the model doesn't get to see — if the relevance heuristic is wrong, the agent degrades silently with no visible signal to the user.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →