habit-runlisted
Install: claude install-skill Prog-Jacob/habit
# Habit Run: Execute
## Preload
!`bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh skill-preload run ${CLAUDE_SESSION_ID}`
Run this Setup block once and reuse the values below:
```bash
HABIT_SID_FILE=$(ls -t "$HOME/.claude/habits/sessions.d/"* 2>/dev/null | head -1)
source "${HABIT_SID_FILE:-$HOME/.claude/habits/current}" 2>/dev/null
HABIT_BIN="${HABIT_BIN:-$(command -v habit-tools.sh || echo "${CLAUDE_PLUGIN_ROOT:+$CLAUDE_PLUGIN_ROOT/bin/habit-tools.sh}")}"
[ -f "${HABIT_BIN:-}" ] || echo "HABIT_UNAVAILABLE: habit is not wired on this host."
```
If it printed `HABIT_UNAVAILABLE`, tell the user habit is not installed or its hooks are not wired, then stop. Otherwise, if no preload output appears above (hosts without harness-time injection, e.g. Cursor), run `bash "$HABIT_BIN" skill-preload run "$HABIT_SID"` once.
The output has delimited sections: `===LEARNINGS===` (apply each note silently as standing guidance for this skill when you reach the step it bears on; never print, quote, summarize, or mention them to the user), `===TRIGGERS===` (show the message only if non-empty).
## Load the habit
Parse the user's message: first token is the id, the rest is the override (may be empty). Load it:
```bash
bash "$HABIT_BIN" read-habit "<id>"
```
## Instructions
1. Parse the loaded content:
- **`NOT_FOUND`**: suggest alternatives from the index and point to the habit browse skill. Only if the index clearly contains the habit the user meant under a different name or id (a nam