HN 표시: ContextSpectre – Claude Code 세션을 위한 추론 위생 레이어
hackernews
|
|
📦 오픈소스
#ai 딜
#claude
#claude code
#contextspectre
#추론 위생
#컨텍스트 관리
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
ContextSpectre는 장기화된 Claude Code 세션에서 비용 증가와 성능 저하를 초래하는 불필요한 컨텍스트를 식별하고 정리하는 '추론 위생' 도구입니다. 자동 압축으로 인한 맥락 손실과 '추론 오염' 문제를 해결하기 위해, 사용자는 터미널 사용자 인터페이스(TUI)나 CLI를 통해 150만 개의 토큰을 폐기하며 세션 비용을 절감할 수 있습니다. 이 도구는 세션 파일을 분석해 신호 대 잡음 비율(등급)을 산정하고, 단 60초 만에 잡음을 제거하여 의사결정 품질을 유지하면서도 운영 효율성을 극대화합니다.
본문
Reasoning hygiene layer for Claude Code. Not a cleanup utility - a tool you open at every decision boundary, not just when context is full. See what fills your context, what it costs, cut what no longer matters, and carry forward what does. A real $1,072 session — 7,701 messages, 46.8 MB, Signal F with 159K cleanable tokens. One clean --all later: Signal A, 3K cleanable, 1.5M tokens stripped. Same decisions, no scaffolding. Claude Code conversations grow until automatic compaction triggers at ~165K tokens. Compaction summarizes and discards older context - you lose specificity, decisions blur, and reasoning drifts. After 10+ compactions, Claude is working from a summary of a summary of a summary. Not all context ages equally: exploratory reasoning (temporary, unstable) becomes reasoning contamination once a decision is made - old scaffolding biasing future responses off-vector. A single long session can cost hundreds of dollars. Most of that is cache reads - re-processing the same context every turn. A debugging detour that gets compacted away still cost real money. Across sessions, the re-explanation tax compounds: re-stating the same architecture, re-reading the same files, re-stating the same constraints because prior sessions are inaccessible. ContextSpectre reads Claude Code's local JSONL session files - from both Claude Code CLI and Claude for Mac - and gives you visibility and control over what fills your context window. Visibility - Context meter with compaction history and turn estimates - Session cost attribution from actual API usage data - Vector health score (A-F signal-to-noise grade) - Compaction archaeology and epoch timeline - Scope drift detection with dollar-cost quantification - Ghost context detection (stale compaction summaries referencing modified files) - Per-model cost breakdown (Opus/Sonnet/Haiku) with correct per-model pricing - Cost velocity ($/hour) and configurable cost alert thresholds - Active sessions dashboard with signal grade, cost, and cleanable tokens - Status line telemetry with mtime-based caching (/.claude/ . No extra flags needed. # One-screen session summary (auto-detects from current directory) contextspectre summary --cwd # See your active sessions with signal grades and cost contextspectre active # Quick-clean the most recent session (one command, no session ID needed) contextspectre quick-clean # Live cleanup on an active session (safe between Claude's turns) contextspectre quick-clean --live # Launch the TUI (browse all sessions, drill into details) contextspectre # Show detailed context stats contextspectre stats # Run all cleanup operations contextspectre clean --all # JSON output for scripting contextspectre sessions --format json 60-second demo: Run contextspectre to open the TUI. Pick your largest session. Pressa to select all noise. Read the impact prediction. Pressd to clean. Done. See CLI & TUI Reference for the full command list, keybindings, and cleanup tiers. | Term | Definition | |---|---| | Compaction | Auto-compression at ~165K tokens. You lose specificity. | | Compaction epoch | Period between two compactions. Unit of reasoning history. | | Context deadlock | Too large to continue, too large to compact. See recovery. | | Signal / Noise | Signal = productive reasoning. Noise = progress, stale reads, tangents. | | Reasoning contamination | Old scaffolding persisting in context, biasing future responses. | | Vector health score | A-F grade. A = >95% signal. F = <20% signal. | | Snowball effect | Dead tokens compound — re-read on every turn. 50K stripped early avoids millions of re-reads. | Full glossary: Concepts & Glossary | Phase | Status | Summary | |---|---|---| | 1. Entropy control | Complete | Noise removal, live cleanup, batch operations | | 2. Reasoning economics | Complete | Cost attribution, epoch timeline, compaction archaeology | | 3. Reasoning navigation | Complete | Scope drift, branches, phases, keep markers, vector health, ghost context | | 4. Operational control | In progress | Federated project identity ✓, session search ✓, watch mode ✓, smart watch ✓, cost alerts ✓, savings attribution ✓, per-model cost ✓, TUI responsive columns ✓, TUI tabbed detail ✓, vim navigation + search ✓, active dashboard ✓, status line telemetry ✓, expert hygiene ✓, session analytics ✓, decision economics (CPD/TTC/CDR) ✓, onboarding polish ✓, input purity score ✓, session integrity guard ✓, Vector Control panel ✓, cleanup cadence, budget protection, session timeline | | 5. Reasoning memory | In progress | Project reasoning graph ✓, conflict detection ✓, project memory synthesis ✓, CLAUDE.md sync ✓, decision lineage ✓, reasoning entropy | | 6. Reasoning metrics | In progress | Repo token budget ✓, reasoning half-life ✓, reasoning efficiency map ✓, flight recorder ✓, reasoning diff ✓, throughput metrics ✓ | | 7. Security | In progress | Vector injection detection ✓, cross-project bond ✓, signal-first status line ✓ | - Token estimates are approximate. The 4
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유