Built a local pre-processing plugin for Claude Code after research & measuring real metrics (3,500+ tests, v1.22.1)
说明与用途
为 Claude Code 构建了本地预处理插件 chamnan,能够确定性地裁剪上下文、在本地脱敏机密并维护会话连续性,从而提升大型复杂仓库的可预测性和安全性。
问题
Large, messy repositories cause unpredictable context usage, token consumption, and potential data leaks when using Claude Code.
结果
The plugin dramatically reduces Quick Index overhead, prevents accidental data leaks, and preserves session context across runs, enabling more reliable and secure Claude Code usage on large, complex repositories.
工作流
- 1. Scan repository and pre-index files to determine context size.
- 2. Trim or split files to fit within the token budget before sending to Claude Code.
- 3. Perform local redaction of secrets and internal strings.
- 4. Store session decisions and project history in .chamnan/ for continuity.
- 5. Pass the sanitized, trimmed context to Claude Code for processing.
证据
Built in pure Python (standard library only, zero external packages) and backed by 3,500+ automated tests.
Deterministic Context Budgeting: Pre-indexes and trims repository context before passing it to Claude Code (slashed Quick Index overhead dramatically in real-world tests).
- 记录日期: 2026-09-14T05:16:39.849Z