claude-pace 0.8.5 → 0.8.6
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.
- package/claude-pace.sh +7 -2
- package/package.json +1 -1
package/claude-pace.sh
CHANGED
|
@@ -129,13 +129,18 @@ _stale() { [ ! -f "$1" ] || [ $((NOW - $(stat -f%m "$1" 2>/dev/null || stat -c%Y
|
|
|
129
129
|
|
|
130
130
|
# ── Parse stdin + settings in one jq call ──
|
|
131
131
|
# Fields: MODEL DIR PCT CTX COST EFF HAS_RL U5 U7 R5 R7
|
|
132
|
+
# Read settings into a shell var rather than process substitution so the jq
|
|
133
|
+
# --argjson path works on Windows Git Bash (where /proc/<pid>/fd/N used by
|
|
134
|
+
# <(...) is unavailable and --slurpfile silently fails, yielding empty fields).
|
|
132
135
|
HAS_RL=0
|
|
136
|
+
_SETTINGS=$(cat "$HOME/.claude/settings.json" 2>/dev/null)
|
|
137
|
+
echo "$_SETTINGS" | jq -e . >/dev/null 2>&1 || _SETTINGS='{}'
|
|
133
138
|
IFS=$'\t' read -r MODEL DIR PCT CTX COST EFF HAS_RL U5 U7 R5 R7 < <(
|
|
134
|
-
jq -r --
|
|
139
|
+
jq -r --argjson cfg "$_SETTINGS" \
|
|
135
140
|
'[(.model.display_name//"?"),(.workspace.project_dir//"."),
|
|
136
141
|
(.context_window.used_percentage//0|floor),(.context_window.context_window_size//0),
|
|
137
142
|
(.cost.total_cost_usd//0),
|
|
138
|
-
(.effort.level//$cfg
|
|
143
|
+
(.effort.level//$cfg.effortLevel//"default"),
|
|
139
144
|
(if .rate_limits then 1 else 0 end),
|
|
140
145
|
(.rate_limits.five_hour.used_percentage//null|if type=="number" then floor else "--" end),
|
|
141
146
|
(.rate_limits.seven_day.used_percentage//null|if type=="number" then floor else "--" end),
|