Repository navigation
Releases
Releases · dropdevrahul/nexum
v0.5.0
Added
- Caveman prompts — telegraphic plans + dispatch prompts (
caveman_prompts_enabled, default true)./nx-plannow writes the plan's prose fields (task summary, steptitle/objective/contract/scope) in clipped, telegraphic English — articles, copulas, and filler dropped — and/nx-buildbuilds its executor dispatch prompts the same way. The plan is re-read by every executor and the shared dispatch prefix ships on every step, so trimming function words from them is a recurring token saving. Strict carve-outs stay verbatim and unambiguous: file paths, identifiers, signatures, config keys, code, and the runnableacceptancecommand — terseness never costs precision. Setfalsefor normal prose. - Grep narrowing — a working PreToolUse context-savings lever (
scripts/scan_guard.py). An unscoped/broad search now has its output capped instead of being hard-denied: theGreptool gets ahead_limitinjected and an unscoped recursive Bashgrep/rggets| head -n Nappended (via PreToolUseupdatedInput, which current Claude Code honors — unlike PostToolUse output shrink). The model still gets a bounded answer with no retry round-trip. Searches into ascan_deny_pathsdirectory, and Glob (nohead_limit), still deny; a Bash grep that already pipes falls back to deny; an explicit callerhead_limitis never overridden. Config:grep_narrow_enabled(default true),grep_head_limit(default 80). - Confidence-aware, bidirectional routing calibration (
store.calibration_advice,store.py calib-adviceCLI). Replaces the raw first-try pass ratio with a Wilson score lower bound, so a short lucky/unlucky streak no longer flips a route. Advice is now bidirectional: nudge a route up a tier when low-confidence (lower bound <route_calib_min_success_ratio) and down a tier when a cheaper tier reliably suffices (lower bound ≥route_calib_downgrade_ratio, default 0.9). Falls back to a cross-repo_globalprior when a repo lacksroute_calib_min_samplesof its own history./nx-planconsumes the newcalib-adviceJSON (action/reason/samples/lower/source). Config:route_calib_downgrade_ratio(default 0.9; 1.0 disables downgrades). - Honest savings split in
/nx-report(scripts/report.py,store.savings_by_source). The report now separates savings into three buckets so the headline never overclaims the inert PostToolUse lever: Realized (PreToolUse, measured —predup's exact denied-repeat tokens), Bounded interventions (read_guard/grep_narrow— output capped, exact saving unknowable, counted only), and Theoretical (dedup/truncate— PostToolUse shrink that is inert because Claude Code ignoresupdatedToolOutputfor built-in tools, tracking #65403). read-guard and grep-narrow now record a 0-token intervention row so the bounded count is visible. PreCompacthook (scripts/precompact.py). Fires at the exact compaction boundary to (a) invalidate this session'stool_callsrows — so predup can never deny a re-read of output the compaction just evicted — and (b) write a deterministic handoff skeleton. Never blocks compaction. Closes the predup-after-compaction correctness gap that thepredup_max_age_secondstime guard could only approximate.SessionStartreset/prune hook (scripts/session_reset.py). Onsourceclear/compact, clearstool_callsfor the same reason as PreCompact (filtered in-script, not via matcher). Also runs the throttled retention prune.SubagentStophook (scripts/subagent_usage.py) → real per-tier usage. Maps a nexum executor agent (nexum-impl-{haiku,sonnet,opus}) to its tier and records ausagerow with token totals parsed best-effort from the subagent transcript (store.transcript_usage_totals), so the cost-report breakdown reflects measured spend rather than the plan-preview estimate. (The SubagentStop payload carries no usage fields, so attribution is transcript-based and best-effort — documented as such.)- Retention/pruning (
store.prune,store.maybe_prune,store.py pruneCLI). Rows older thanretention_days(default 14) are pruned from the ephemeral tables (tool_calls,savings,outputs,usage,memo,file_activity), throttled to at most once/day on session start, keeping the SQLite file and predup lookups bounded.0disables. (route_calibration/step_ledgerare persistent and intentionally not age-pruned.) - Fable pricing.
store.PRICINGgainsfable($10/$50 per MTok) andcost_report._model_keyrecognises it (and orders matching most-specific-first), so Fable-class usage is no longer mispriced as Sonnet. Bedrock/Vertexanthropic.-prefixed IDs still map correctly. - Wasted-context analytics +
/nx-report(inspired by the open-sourceclaude-context-optimizer). A PostToolUse tracker (extendsdedup.py, now also matchingEdit|Write|MultiEdit) records per-file read/edit counts and injected-token estimates in a newfile_activitytable. The new/nx-reportcommand (scripts/report.py) prints a deterministic, no-LLM session digest: the cost summary plus a wasted-context analysis — total tokens read, tokens spent on files read but never edited, a waste ratio, an S–F efficiency grade, a per-file useful/WASTED table, and concrete "drop X → save ~N tokens" suggestions. Newstorehelpers:record_file_read,record_file_edit,file_activity_rows,wasted_files. Configfile_activity_enabled(default true). - Tiered budget alerts (C).
context_watchnow compares the session's real metered cost (the status-linesession_costsnapshot) tobudget_usd, and cumulative input+output tokens tobudget_tokens, emitting an escalating, once-per-tier non-blockingsystemMessageatbudget_alert_tiers(default 50/70/80/90%). At ≥70% it names the biggest never-edited files to drop (from the wasted-context tracker); at ≥90% it urges/compact. Both budgets default to0(disabled).
Changed
- predup recall — canonicalised signatures.
store.tool_call_signow realpath-canonicalisesfile_path/pathbefore hashing, so./foo.py,foo.py, and the absolute path collapse to one signature and predup catches the repeat. Distinct read ranges (offset/limit) and patterns stay distinct. Newstore.clear_tool_calls.
v0.4.0
Added
- Estimated per-tier usage recording in
/nx-buildso the cost report breakdown is populated with token estimates per execution tier, giving visibility into where the session's cost is incurred. - Per-repo routing calibration that biases
/nx-planfrom historical step outcomes, routing subsequent steps based on learned success rates and execution patterns rather than static tier assignments. - Throttled SessionStart audit nudge (
scripts/audit_nudge.py, SessionStart hook) that checks ignore-config rot on session start without spamming the user, surfacing a one-line reminder when the ignore config has actionable findings (missing ignore file, unignored noise dirs, or large/binary files). Throttled to once per repo peraudit_nudge_throttle_hours. Config:audit_nudge_enabled(default true),audit_nudge_throttle_hours(default 24).
Changed
max_steps_per_dispatchdefault lowered 6 → 4. A 6-step grouped Sonnet dispatch stalled the stream watchdog mid-batch (600s no-progress) and lost the whole batch; smaller batches bound both the per-dispatch context and a single failure's blast radius.- Size-aware dispatch batching.
/nx-buildnow partitions a route tier withplan_preview.py --plan … --indices …, which estimates each step's context load (per-step base + declared-file bytes ÷ 4) and bounds each sub-batch by bothmax_dispatch_context_tokens(default 50000) and themax_steps_per_dispatchcount cap — so a few large-file steps split off while a single over-budget step still dispatches alone (steps are never split). Newstore.partition_steps_by_size; configmax_dispatch_context_tokens,dispatch_step_base_tokens. The count-onlystore.py plan-batcheshelper remains for when no plan file is available.
Fixed
- predup freshness guard. A recorded
tool_callsrow only proves an output was injected once, not that it is still in the live context — subagents share the parent's DB, and compaction/resume evicts output while the row persists, so predup could deny a legitimate read whose content was no longer (or never) in context. predup now lets a call through when its prior row is older thanpredup_max_age_seconds(default 900; 0 restores the prior ever-recorded behaviour).
v0.2.1
Added
- Absolute-token compaction trigger:
statusline_compaction_warn_tokens(default 80,000). The⚠ /compactstatus line warning now fires when EITHER the percentage threshold (statusline_compaction_warn_pct) OR the absolute token count threshold is reached. This ensures large context windows (e.g. Opus's 1M-token window) still warn at a meaningful, cost-relevant size rather than waiting until 800k tokens are consumed.
Fixed
/nexum-statuslineand the README now install a version-independentstatusLinecommand (python3 "$(ls -dt ~/.claude/plugins/cache/nexum/nexum/*/scripts/statusline.py | head -1)") instead of a hardcoded${CLAUDE_PLUGIN_ROOT}path, which pointed at the versioned cache dir and broke on every/plugin update. Also documented that a plugin cannot self-register the mainstatusLine(pluginsettings.jsononly supportsagentandsubagentStatusLine).
v0.2.0
Added
- Session-usage status line (
scripts/statusline.py) that displays model, context percentage, token count, cumulative cost, and dedup-hook savings in the Claude Code UI. Wire it with the new/nexum-statuslinecommand, which resolves the absolute path and offers to merge thestatusLinekey into yoursettings.json.
Fixed
- The compaction warning is now driven by Claude Code's real
context_window.used_percentagevia the status line (configurablestatusline_compaction_warn_pct, default 80), replacing the prompt-token estimate that undercounted and rarely fired.
v0.1.1
Fixed
- Hook scripts (
truncate.py,context_watch.py, anddedup.pyvia its import
oftruncate) crashed on Python 3.9 because of PEP 604X | Nonetype
annotations evaluated at runtime. Addedfrom __future__ import annotations
so the documented Python 3.9+ support actually holds. Caught by CI.