weighted-compact is a local context compression and memory substrate tool for Claude Code. It reads session logs under ~/.claude/projects/, parses them into pairwise objects (correction text, premise text, span level, session anchor), and attaches six types of signals: density features, four-tier span coverage (keep/maybe/skip/think), and an optional human label. Artifacts are stored in $XDG_DATA_HOME/weighted-compact/ and are not uploaded.
Main capabilities: first, recap, which generates session reviews segmented by task, using only the standard library, with no model and no review, at about 5ms/session, and claims to pass four faithfulness invariants on 1007/1007 sessions: coverage, conservation, provenance, and determinism; second, manifesto control, where keep/skip labels act as hard constraints rather than soft weighting, with keep labels retained 100% of the time at k≤0.7 (compared with 62% for the recency baseline); third, substrate queries, which can retrieve over the pairwise signal columns. The project explicitly states that the six-signal importance mixture was not measured to outperform the recency or bm25 baselines at the current sample size.
Usage: provides Docker/Windows installation instructions, an operations guide, benchmark comparisons with claude-mem, stability commitments, and extension recipes. recap can be rechecked with weighted-compact recap --all; rem-pass runs by default at 04:00 via a bundled systemd-user timer, applying a wall-clock half-life multiplier (yesterday ×0.91, one week ago ×0.50, one month ago ×0.05).
Applicable scenarios: users who want an auditable, locally controllable Claude Code session memory substrate that can be guided by a manifesto. Limitations: recap is a lossy navigation map rather than a lossless archive; for lossless archiving, zstd -19 is recommended; compression quality has not been proven to outperform cheap baselines; the label signal is optional, and the lower bound of the ablation confidence interval crosses zero; some comparison data is based on simulated /compact rather than real prompts.