[FEATURE] Status bar widget — ZeroDB memory count and sync state - #23
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
statusline/zerodb-status.sh— a lightweight status bar widget for Claude Code that shows ZeroDB memory state without hitting the API on every poll.claude-plugin/plugin.jsonvia the newstatuslinefieldhooks/session-end.shto write asavingstate to the cache immediately before persist runshooks/session-start.shto write asyncedstate to the cache after recall completesHow 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:If
ZERODB_API_KEYis not set, the script exits 0 silently so the status bar shows nothing.Test Plan
ZERODB_API_KEYand verify status bar rendersZeroDB: readyon first runZeroDB: N memories ✓displaysZeroDB: saving...appears briefly during session-end hook executionZERODB_API_KEYand confirm status bar shows nothing (no clutter)ZeroDB: offlinerendersRisk/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: removestatuslinefield fromplugin.json.Closes #11