Skip to content

[FEATURE] Status bar widget — ZeroDB memory count and sync state - #23

Merged
urbantech merged 1 commit into
mainfrom
feature/11-statusline
Apr 25, 2026
Merged

urbantech merged 1 commit into
mainfrom
feature/11-statusline

Conversation

@urbantech

Copy link
Copy Markdown
Contributor

Summary

  • Adds statusline/zerodb-status.sh — a lightweight status bar widget for Claude Code that shows ZeroDB memory state without hitting the API on every poll
  • Registers the script in .claude-plugin/plugin.json via the new statusline field
  • Updates hooks/session-end.sh to write a saving state to the cache immediately before persist runs
  • Updates hooks/session-start.sh to write a synced state to the cache after recall completes

How it works

The statusline script reads from a local cache file (${TMPDIR:-/tmp}/zerodb-status/status.json) written by the session hooks. This avoids API calls on every status bar poll. Display states:

ZeroDB: 24 memories ✓   # synced with count
ZeroDB: saving...        # session-end hook is running
ZeroDB: 0 memories       # synced, no memories yet
ZeroDB: offline          # error state
ZeroDB: ready            # no cache yet (first session)

If ZERODB_API_KEY is not set, the script exits 0 silently so the status bar shows nothing.

Test Plan

  • Set ZERODB_API_KEY and verify status bar renders ZeroDB: ready on first run
  • After a session with memories, confirm ZeroDB: N memories ✓ displays
  • Confirm ZeroDB: saving... appears briefly during session-end hook execution
  • Unset ZERODB_API_KEY and confirm status bar shows nothing (no clutter)
  • Manually write error state to cache and verify ZeroDB: offline renders

Risk/Rollback

Low risk — additive only. The statusline script is read-only and cache-based. Hooks write a small JSON file to /tmp; no API calls, no side effects on existing session behavior. Rollback: remove statusline field from plugin.json.

Closes #11

…ine script

- Add statusline/zerodb-status.sh: cache-based status widget with four display
  states (saving, synced, 0 memories, offline/error)
- Register statusline script in .claude-plugin/plugin.json
- Update hooks/session-end.sh to write saving state to status cache before persist
- Update hooks/session-start.sh to write synced state to status cache after recall
- Cache lives at ${TMPDIR:-/tmp}/zerodb-status/status.json to avoid API polling

Refs #11
@urbantech
urbantech merged commit 6468a77 into main Apr 25, 2026
2 checks passed
@urbantech
urbantech deleted the feature/11-statusline branch April 25, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Status bar widget — memory count and sync state

1 participant