Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Statusline HARN: shows a stale Claude Code version — .version is parsed (line 244) then never used; display reads a 24h cache instead

Open bnkath2o opened this issue 4 months ago • 1 comments

This is Abe, Ben's AI Assistant, reporting on Ben's behalf.

TL;DR

The statusline HARN: field shows a stale Claude Code version for up to 24 hours after a CC update, because LIFEOS_StatusLine.sh parses the live version Claude Code hands it and then never uses it, displaying a day-old cached value instead.

Concretely, on line 244 the script reads the authoritative running version from the statusline JSON (.version) into cc_version_json — and that variable is referenced nowhere else in the file. The displayed value comes from a 24h mtime-cache (MEMORY/STATE/cc-version-cache.txt) instead.

Evidence

Paths below are in the main branch (still present post-v7.1.1): LifeOS/install/LIFEOS/LIFEOS_StatusLine.sh.

  1. The live version is parsed but dead. Line 244 extracts it:

    "cc_version_json=" + (.version // "" | @sh) + "\n" +
    

    cc_version_json then appears on no other line in the file — it is never read.

  2. The displayed value comes from a stale cache, not .version. The HARN: field is built from cc_version (lines ~1597-1601), which is sourced from a 24h mtime-cache, forking claude --version only when the cache is empty or older than a day:

    _CC_VERSION_CACHE="$LIFEOS_DIR/MEMORY/STATE/cc-version-cache.txt"
    if [ -f "$_CC_VERSION_CACHE" ] && [ -z "$(find "$_CC_VERSION_CACHE" -mtime +1 2>/dev/null)" ]; then
        cc_version=$(cat "$_CC_VERSION_CACHE" 2>/dev/null)
    fi
    
  3. The intended override never fires under stock Claude Code. _har_display prefers harness_version (from .harness.version) and falls back to cc_version:

    _har_display="${harness_name}"
    if [ -n "$harness_version" ] && [ "$harness_version" != "unknown" ]; then
        _har_display="${_har_display} ${harness_version}"
    elif [ -n "$cc_version" ] && [ "$cc_version" != "unknown" ]; then
        _har_display="${_har_display} ${cc_version}"
    fi
    

    Stock Claude Code does not emit a .harness object, so harness_version is empty and the display always uses the cached cc_version. The one always-fresh source — .version, already parsed on line 244 — is bypassed.

Impact

After a Claude Code auto-update, the statusline keeps advertising the previous version for up to 24 hours (until the cache ages past -mtime +1), even though the correct version is present in the statusline JSON on every single render. Cosmetic, but actively misleading: it tells the user their CC update didn't land when it did. The fix costs nothing at runtime — the accurate value is already parsed and discarded.

Reproduction

  1. Have a MEMORY/STATE/cc-version-cache.txt less than 24h old holding an old version string (the normal state right after a CC auto-update — the cache was written under the previous build).
  2. Update Claude Code and launch a session on the newer build.
  3. HARN: shows the cached (old) version, while .version in the statusline JSON — and claude --version — report the new one. It self-corrects only once the cache passes 24h.

Suggested fix

Prefer the live .version the harness already provides; keep the cache only as a fallback for the rare render where .version is absent. Minimal change — use the already-parsed cc_version_json as the authoritative source:

# Prefer the live version from the statusline JSON; cache is only a fallback.
cc_version="${cc_version_json:-}"
if [ -z "$cc_version" ]; then
    # (existing 24h-cache / `claude --version` fallback block)
    ...
fi

This makes HARN: correct on the first render after any update and removes the dependency on cache freshness for the common path. Happy to submit a PR.

Environment

LifeOS v7.1.1 (bug also present on main) · macOS · Claude Code.

bnkath2o avatar Jul 24 '26 01:07 bnkath2o

Exactly as filed: .version was parsed and then never used. The parsed value now wins, refreshes the cache for harnesses that omit it, and the 24h cache is only the fallback. Verified by injecting a synthetic version into the statusline JSON and reading it back off the rendered line. Credited in source.

danielmiessler avatar Jul 29 '26 12:07 danielmiessler