Colors of the Society

auditedFree

Red Rising themed status line. Your context window is your standing in the Society's pyramid: fresh context you rule as GOLD, and as it fills you sink through Silver, Copper, Blue, Green, Orange, Obsidian to RED in the mines. The whole line recolors live. Then Rise: /compact.

by fishmug200 installsred-risingthemedcontextreactivescifi
Claude Code
>
Gold: the Society kneels· Sovereign·House Mars · Opus
8% burned·He3 0.05· razor singing·Sovereign's Leash 90%·+12 carved-2 razed
? for shortcuts⏵⏵ accept edits on
Security auditby claude-opus-4-8

A Red Rising-themed statusline that reads Claude Code session JSON from stdin and uses jq to extract fields (model name, context percentage, cost, lines added/removed, effort level, thinking flag, rate limits). It maps context usage to themed 'Color' tiers, model name to a 'House', and effort to a 'razor' label, then prints two colorized display lines. Its only external calls are jq (parsing) and 'git branch --show-current' (read-only) to show the current branch. No network connections, no file writes, no reading of sensitive files, no env-var exfiltration.

subprocessesenv-vars

Audits are advisory. This script runs on your machine — read it before installing.

The script — read it before you run it

#!/usr/bin/env bash
# ++ Colors of the Society ++  (Red Rising themed status line for Claude Code)
#
# Your context window is your standing in the Society's pyramid. Fresh context,
# you rule as GOLD. As it fills, you sink down the Colors -- Silver, Copper,
# Blue, Green, Orange, Obsidian -- until you hit rock bottom as a RED in the
# mines. Then you Rise: /compact to break the chains and be reborn Gold.
#
# The whole line recolors live to whatever Color you currently burn as, and a
# spectrum strip shows your rung on the pyramid.
#
# Reads Claude Code session JSON on stdin. Requires: jq. Degrades gracefully.

input=$(cat)
j() { printf '%s' "$input" | jq -r "$1" 2>/dev/null; }

MODEL=$(j '.model.display_name // "Peerless"')
PCT=$(j '.context_window.used_percentage // 0' | cut -d. -f1); [ -z "$PCT" ] && PCT=0
COST=$(j '.cost.total_cost_usd // 0')
ADDED=$(j '.cost.total_lines_added // 0')
REMOVED=$(j '.cost.total_lines_removed // 0')
EFFORT=$(j '.effort.level // empty')
THINKING=$(j '.thinking.enabled // false')
FIVEH=$(j '.rate_limits.five_hour.used_percentage // empty')

RESET='\033[0m'; BOLD='\033[1m'; DIM='\033[2m'

# --- The Colors of the Society (top of the pyramid -> bottom) ---------------
NAMES=(Gold   Silver  Copper     Blue      Green         Orange   Obsidian Red)
ROLES=(Sovereign Financier Magistrate Helmsman Technologist Engineer Warrior  Miner)
HUES=(220    253     173        39        40            208      240      196)
CREEDS=(
  "the Society kneels"
  "the coin obeys"
  "you write the law"
  "you chart the void"
  "circuits answer you"
  "you keep her breathing"
  "bred for war, kept in chains"
  "break the chains - RISE (/compact)")

# --- Which Color do you burn as? (context% descends the pyramid) ------------
if   [ "$PCT" -ge 93 ]; then IDX=7
elif [ "$PCT" -ge 85 ]; then IDX=6
elif [ "$PCT" -ge 75 ]; then IDX=5
elif [ "$PCT" -ge 60 ]; then IDX=4
elif [ "$PCT" -ge 45 ]; then IDX=3
elif [ "$PCT" -ge 30 ]; then IDX=2
elif [ "$PCT" -ge 15 ]; then IDX=1
else                         IDX=0
fi

COLOR="${NAMES[$IDX]}"; ROLE="${ROLES[$IDX]}"; CREED="${CREEDS[$IDX]}"
CUR="\033[38;5;${HUES[$IDX]}m"
EMPH=""; { [ "$IDX" -eq 0 ] || [ "$IDX" -eq 7 ]; } && EMPH="$BOLD"  # Gold & Red stand out

# --- House of the Institute (from model) ------------------------------------
case "$MODEL" in
  *Opus*)   HOUSE="House Mars" ;;      # Omnis Vir Lupus - every man a wolf
  *Sonnet*) HOUSE="House Minerva" ;;
  *Haiku*)  HOUSE="House Mercury" ;;
  *Fable*)  HOUSE="House Apollo" ;;
  *)        HOUSE="House Jupiter" ;;
esac

# --- The razor (effort level) -----------------------------------------------
case "$EFFORT" in
  low)    RAZOR="razor sheathed" ;;
  medium) RAZOR="razor drawn" ;;
  high)   RAZOR="razor singing" ;;
  xhigh)  RAZOR="the Reaper rises" ;;
  max)    RAZOR="the Reaper unleashed" ;;
  *)      RAZOR="" ;;
esac

# --- Spectrum strip: the pyramid, Gold(left) -> Red(right), you marked ◆ -----
SPECTRUM=""
for i in "${!NAMES[@]}"; do
  h="\033[38;5;${HUES[$i]}m"
  if [ "$i" -eq "$IDX" ]; then SPECTRUM="${SPECTRUM}${h}${BOLD}◆${RESET}"
  else                         SPECTRUM="${SPECTRUM}${DIM}${h}█${RESET}"; fi
done

# --- Width-aware assembly ---------------------------------------------------
COLS=${COLUMNS:-80}
SEP="  ${DIM}·${RESET}  "; SEP_W=5
add() {
  local vis="$1" col="$2" add_w=$(( ${#1} + SEP_W ))
  [ -z "$PLAIN" ] && add_w=${#1}
  if [ $(( ${#PLAIN} + add_w )) -le "$COLS" ]; then
    [ -z "$PLAIN" ] && { LINE="$col"; PLAIN="$vis"; } \
                    || { LINE="${LINE}${SEP}${col}"; PLAIN="${PLAIN}  ·  ${vis}"; }
  fi
}

# --- Line 1: spectrum, your Color + creed, House, front ---------------------
LINE="${SPECTRUM}  ${CUR}${EMPH}${COLOR}: ${CREED}${RESET}"
PLAIN="◆◆◆◆◆◆◆◆  ${COLOR}: ${CREED}"
add "${ROLE}" "${CUR}⟐ ${ROLE}${RESET}"
add "${HOUSE} · ${MODEL}" "${DIM}${HOUSE} · ${MODEL}${RESET}"
BRANCH=$(git branch --show-current 2>/dev/null)
[ -n "$BRANCH" ] && add "front: ${BRANCH}" "${CUR}front: ${BRANCH}${RESET}"
LINE1="$LINE"

# --- Line 2: burn %, He-3, razor, Sovereign's Leash, carved/razed, scheme ---
LINE="${CUR}${EMPH}${PCT}% burned${RESET}"; PLAIN="${PCT}% burned"
HE3=$(printf 'He3 %.2f' "$COST")
add "${HE3}" "${CUR}${HE3}${RESET}"
[ -n "$RAZOR" ] && add "${RAZOR}" "${CUR}⚔ ${RAZOR}${RESET}"
if [ -n "$FIVEH" ]; then
  LEASH=$(awk "BEGIN{printf \"%d\", 100-$FIVEH}")
  add "Sovereign's Leash ${LEASH}%" "${DIM}Sovereign's Leash ${LEASH}%${RESET}"
fi
if [ "$ADDED" != "0" ] || [ "$REMOVED" != "0" ]; then
  add "+${ADDED} carved -${REMOVED} razed" \
      "\033[38;5;40m+${ADDED} carved${RESET} \033[38;5;196m-${REMOVED} razed${RESET}"
fi
[ "$THINKING" = "true" ] && add "scheming like a Gold" "${CUR}⟐ scheming like a Gold${RESET}"
LINE2="$LINE"

printf '%b\n' "$LINE1"
printf '%b\n' "$LINE2"

Reviews

no reviews yet