claude-pace 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/claude-pace.sh +12 -1
  2. package/package.json +1 -1
package/claude-pace.sh CHANGED
@@ -65,6 +65,17 @@ _write_cache_record() {
65
65
  printf '%s\n' "$*"
66
66
  ) >"$tmp" && mv "$tmp" "$path"
67
67
  }
68
+ # Avoids rewriting the quota cache when the live snapshot is unchanged.
69
+ _write_quota_snapshot_if_changed() {
70
+ local path="$1" u5="$2" u7="$3" r5="$4" r7="$5"
71
+ if [ -f "$path" ] && [ ! -L "$path" ] && [ -r "$path" ] && _load_cache_record_file "$path"; then
72
+ [[ "${CACHE_FIELDS[0]:-}" == "$u5" ]] &&
73
+ [[ "${CACHE_FIELDS[1]:-}" == "$u7" ]] &&
74
+ [[ "${CACHE_FIELDS[2]:-}" == "$r5" ]] &&
75
+ [[ "${CACHE_FIELDS[3]:-}" == "$r7" ]] && return 0
76
+ fi
77
+ _write_cache_record "$path" "$u5" "$u7" "$r5" "$r7"
78
+ }
68
79
  # Computes remaining whole minutes until a future epoch. Missing or expired
69
80
  # timestamps return an empty string so callers can skip countdown formatting.
70
81
  _minutes_until() {
@@ -214,7 +225,7 @@ if [[ "$HAS_RL" == "1" ]]; then
214
225
  RM5=$(_minutes_until "$R5")
215
226
  RM7=$(_minutes_until "$R7")
216
227
  if [[ -n "$QC" ]] && _valid_quota_snapshot "$U5" "$U7" "$R5" "$R7"; then
217
- _write_cache_record "$QC" "$U5" "$U7" "$R5" "$R7" || true
228
+ _write_quota_snapshot_if_changed "$QC" "$U5" "$U7" "$R5" "$R7" || true
218
229
  fi
219
230
  else
220
231
  U5="--" U7="--" RM5="" RM7=""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-pace",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Claude Code statusline and rate limit tracker. Pure Bash + jq, single file.",
5
5
  "bin": {
6
6
  "claude-pace": "cli.js"