Skip to content

v0.4.1 — Self-locating wrapper shim

Choose a tag to compare

@Flagrare Flagrare released this 03 Jun 14:16

Durability fix: /plugin update llm-tutor followed by /reload-plugins now picks up new statusline behavior immediately — no /tutor-statusline-install rerun, no Claude Code restart.

Behaviour

  • Self-locating wrapper shim: /tutor-statusline-install now writes a six-line bash file at ~/.claude/llm-tutor/statusline-wrapper.sh (previously a symlink). Each render, the shim runs ls | sort -V | tail -1 against ~/.claude/plugins/cache/llm-tutor/llm-tutor/ to find the latest installed version, then execs its wrapper. The shim itself never needs updating; wrapper logic lives in the cache and self-updates with every plugin upgrade.
  • Segment symlink self-heals on each render: the wrapper now lazily refreshes ~/.claude/llm-tutor/statusline-segment.sh (the path documented for direct shell-out users) so it always points at the current version's segment script. One readlink + string compare per render; ln -sf only fires when the target has actually drifted.
  • SessionStart hook removed: the self-locating shim makes the hook redundant. One less moving part.

Why this matters

v0.3.0 and v0.4.0 used a symlink under ~/.claude/llm-tutor/ that was refreshed by a SessionStart hook on Claude Code session start. But /plugin update followed by /reload-plugins does not fire a SessionStart event — so a user who updated mid-session kept seeing the previous cache version's render until they fully restarted Claude Code or re-ran /tutor-statusline-install. This was the failure mode that surfaced when v0.3.0 → v0.4.0 testing showed the old design persisting after /plugin update.

The shim approach removes that staleness window entirely. The shim doesn't care which version was current at install time; it asks the filesystem on every render.

Migration

Users on v0.2.0 through v0.4.0 should run /tutor-statusline-install once to overwrite the symlink at ~/.claude/llm-tutor/statusline-wrapper.sh with the new shim. After that single migration, all future plugin upgrades self-heal automatically.

Architecture rationale

The ADR (docs/decisions/2026-06-03-statusline-integration-architecture.md) is updated with the new mechanism, an explanation of why the symlink approach left a staleness gap, and a new entry on the migration path from pre-v0.4.1 installs.