feat(goals): emojis de objetivo + /rename + sidecar de contexto para FleetView

- goal_autogen.sh: genera 3 emojis representativos del objetivo (haiku) junto al
  goal+DoD, guardados en goals/<id>.json.
- goal_tracker.sh: comando meta /rename (y rename:) para nombrar la terminal;
  se guarda en goals/<id>.json .rename.
- commands/rename.md: slash command /rename.
- statusline.sh: persiste el % de contexto por sesion en runtime/<id>.json para
  que FleetView lo muestre.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
agent
2026-06-17 00:04:41 +02:00
parent 0e8d2d2ff2
commit bb735cad17
5 changed files with 62 additions and 6 deletions
+19
View File
@@ -45,6 +45,25 @@ if [ "$CONTEXT_PCT" -eq 0 ] && [ "$CONTEXT_USED" -gt 0 ]; then
CONTEXT_PCT=$(echo "scale=0; $CONTEXT_USED * 100 / $CONTEXT_TOTAL" | bc)
fi
# Persistir el contexto por sesión en un sidecar para que fleetview (y otras
# herramientas) puedan mostrarlo sin tener este stdin. El statusline se re-ejecuta
# cada pocos segundos, así que el dato se mantiene fresco mientras la sesión vive.
if [ -n "$SESSION_ID" ]; then
RTDIR="$HOME/.claude/runtime"
mkdir -p "$RTDIR" 2>/dev/null
RTF="$RTDIR/${SESSION_ID}.json"
RTMP="${RTF}.tmp.$$"
if jq -n \
--argjson pct "${CONTEXT_PCT:-0}" \
--argjson used "${CONTEXT_USED:-0}" \
--argjson total "${CONTEXT_TOTAL:-200000}" \
'{ctx_pct:$pct, ctx_used:$used, ctx_total:$total}' > "$RTMP" 2>/dev/null; then
mv "$RTMP" "$RTF" 2>/dev/null
else
rm -f "$RTMP" 2>/dev/null
fi
fi
# Costos
TOTAL_COST=$(echo "$INPUT" | jq -r '.cost.total_cost_usd // 0' | xargs printf "%.3f")
SESSION_DURATION=$(echo "$INPUT" | jq -r '.cost.total_duration_ms // 0')