From habit
Use when the user wants to extract reusable patterns from their session, restructure the habit inventory, or scan all project sessions for patterns. Triggers on: distill, sweep session, extract patterns, clean up habits, inventory maintenance.
How this skill is triggered — by the user, by Claude, or both
Slash command
/habit:distill [maintain | project][maintain | project]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Runs in forked subagent. All data is pre-loaded below. Use only Bash commands from the Operations reference for writes. Summaries must be human-friendly. Do not mention file names, counters, timestamps, or pruning stats.
Runs in forked subagent. All data is pre-loaded below. Use only Bash commands from the Operations reference for writes. Summaries must be human-friendly. Do not mention file names, counters, timestamps, or pruning stats.
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-transcript ${CLAUDE_SESSION_ID}
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-index merged
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-pending-distill
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-log
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-meta global
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-meta project
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-shared PROCESSING.md
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-shared OPERATIONS.md
Arguments: $ARGUMENTS
Before routing: If the arguments contain feedback about the plugin beyond the routing keyword (complaints, questions about behavior, suggestions), log each piece as an observation before proceeding: bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh log-observation ${CLAUDE_SESSION_ID} '<feedback>'.
Pick the first matching branch. Do not read or execute other branches. Only the Project branch may call list-new-sessions and read-sessions. Maintain and Regular work exclusively with the data already preloaded above.
Scan new or modified project sessions incrementally and restructure the full inventory. Ignore the preloaded session transcript above; all session data is loaded fresh here.
bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh list-new-sessions. If it returns "No new project sessions." or "No project sessions found.", return that message and stop.bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-transcript <path1> <path2> ... <path5>. Run Sweep on the batch data. After each batch, mark processed: bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh mark-sessions-distilled <path1> ... <path5>.Session sweep followed by full inventory restructure and plugin self-improvement. Data sources: the preloaded session transcript and pending sessions above. Do not call read-sessions or load sessions by any other means.
bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-transcript <path1> <path2> .... Missing files are skipped automatically. Run Sweep on gathered data (current session + pending transcripts) if any usable prompts exist.Data sources: the preloaded session transcript and pending sessions above. Do not call read-sessions or load sessions by any other means.
bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-transcript <path1> <path2> .... Missing files are skipped automatically. If zero usable prompts remain after fetching, return "Nothing to extract yet." and stop.update_counter >= 20 in either scope, continue to Maintain step 3 (skip step 5; Maintain ends with its own Cleanup).Each branch specifies its own opening line. After that, include:
write-habit command (see Operations).bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-habit <id> and confirm frontmatter is valid, description starts with a verb and is under 120 chars, instruction is self-contained. If not, rewrite.log-observation. These feed Self-improve later in the flow.ts→typescript, js→javascript).[a-z0-9-] format. Flag renames in summary.bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh self-heal global and bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh self-heal project to rebuild indexes.bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh reset-meta global and reset-meta project.bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh prune-log global and prune-log project.Read observations: bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-observations. If none, skip.
For each observation, identify the plugin source file responsible (under ${CLAUDE_PLUGIN_ROOT}/skills/ or ${CLAUDE_PLUGIN_ROOT}/bin/). Read the file, apply the smallest edit that resolves the friction. Preserve existing structure and style. If no source file in ${CLAUDE_PLUGIN_ROOT}/skills/ or ${CLAUDE_PLUGIN_ROOT}/bin/ clearly maps to the observation, skip that observation and note it in the summary instead of editing anything.
bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh clear-pending-distill.bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh clear-observations.bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh reset-prompt-count ${CLAUDE_SESSION_ID}.npx claudepluginhub prog-jacob/habit --plugin habitGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.