distill-habits

distill-habits is a skill for Claude Code, Codex from betayyang/claude-habit-distiller. It costs 87 tokens per session (2,847 once invoked), scanned A, original, MIT.

A local review of recent Claude Code conversations that identifies repeated user habits and preferences and stores them for future sessions.

In plain words
What is it for?
Use it to update long-term memory and maintain a “My Habits” section in the global CLAUDE.md file.
Why use it?
It keeps recurring preferences from being forgotten while leaving out one-off task details.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Good fit Use it to update long-term memory and maintain a “My Habits” section in the global CLAUDE.md file.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/betayyang/claude-habit-distiller/distill-habits
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add betayyang/claude-habit-distiller --skill distill-habits
Clone the repo
git clone --depth 1 https://github.com/betayyang/claude-habit-distiller

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for distill-habits

README.md
[![agentmods](https://agentmods.dev/badge/skills/betayyang/claude-habit-distiller/distill-habits/github.svg)](https://agentmods.dev/skills/betayyang/claude-habit-distiller/distill-habits)
Your own site
<a href="https://agentmods.dev/skills/betayyang/claude-habit-distiller/distill-habits"><img src="https://agentmods.dev/badge/skills/betayyang/claude-habit-distiller/distill-habits/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for distill-habits

Your own site · 80×15
<a href="https://agentmods.dev/skills/betayyang/claude-habit-distiller/distill-habits"><img src="https://agentmods.dev/badge/skills/betayyang/claude-habit-distiller/distill-habits.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,847 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00087 $0.02847
Opus 5 $0.00044 $0.01424
Sonnet 5 $0.00017 $0.00569
Haiku 4.5 $0.00009 $0.00285

Measured 5d ago against content hash 258cc6400ef0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

distill-habits scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (run.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/distill-habits/SKILL.md · 176 lines

How it starts

The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.

distill-habits — automatic habit distillation

Goal: extract the stable habits / preferences / feedback a user shows across sessions and turn them into a long-term asset, so every future conversation starts out knowing them. One-off task details are not distilled — only reusable patterns.

Two layers (keep the responsibilities separate)

Layer Location How it loads What belongs here
Execution the sentinel block in ~/.claude/CLAUDE.md loaded in full on every single turn — has a hard character budget The imperative. The one sentence the AI should just follow.
Ledger memory_dir (see below) read on demand, never auto-loaded The Why, raw evidence, cases, dates, numbers, superseded conclusions, how a belief evolved

Core invariant: evidence, cases, dates and specific numbers live in the ledger only. If they show up in the execution layer, that is the signal to push them down.

Why the ledger is not under projects/<slug>/memory/: Claude Code isolates that directory per project directory. If a user works in git worktrees or multiple checkouts — most people do — every new working directory gets a fresh, empty memory dir, and everything ever distilled becomes unreadable. The ledger must live at a single fixed path instead.

Paths and config

Config is read from ~/.config/claude-habit-distiller/config.toml (or ./config.toml), falling back to the built-in defaults.

  • Conversation transcripts: ~/.claude/projects/<project-dir>/*.jsonl (one file per session, across all projects)
  • User input history: ~/.claude/history.jsonl (each line has display / timestamp (ms) / project / sessionId)
  • Habit ledger: memory_dir. When "auto", use ~/.claude/knowledge/habits/, with INDEX.md as its index. Do not resolve "auto" to a per-project memory dir — see the note above.
  • Execution layer: the sentinel-managed region in ~/.claude/CLAUDE.md
  • Last-run timestamp: <skill-dir>/.last-run (Unix seconds; if absent, look back window_days)
  • Audit cursor: <skill-dir>/.last-audit

Read the full file on GitHub · 176 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago Changed · +55 lines · +6 tokens per session 258cc6400ef0
  2. 12d ago First seen · 121 lines · 81 tokens per session scan A e66d5dad4ec6

Subscribe to this mod's changes

distill-habits is a skill published in the GitHub repository betayyang/claude-habit-distiller (2 stars, last pushed 7d ago), licensed MIT. It adds 87 tokens to every session and 2,847 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

takenotes

Saves durable knowledge into permanent storage — typed memory, CLAUDE.md, or a docs/ file — and corrects anything already stored that has gone stale. Handles both a single fact and a whole-session harvest. Use when the user says "takenotes", asks you to remember or record something, asks you to save what was learned…

cabaynes/charles-claude-skills · 134 tokens

putdown

Writes a session handoff file that a fresh Claude Code session reads via /pickup, harvests durable knowledge into memory and CLAUDE.md (via /takenotes when installed), then commits and pushes all session work. Use when the user says "putdown", when ending or stepping away from a working session, or when the context…

cabaynes/charles-claude-skills · 98 tokens

pickup

Loads the most recent putdown handoff file for the current project and primes the session with full prior context. Use when the user says "pickup", asks "where were we" after opening a fresh window, or wants to resume work from a prior session that ended with /putdown. Do NOT use for reopening a previous Claude…

cabaynes/charles-claude-skills · 94 tokens

shipkit-work-memory

Log session progress and save resume state. Infers from conversation and git. Triggers: 'log progress', 'session summary', 'checkpoint', 'save progress', 'end session'.

stefan-stepzero/shipkit · 42 tokens

shipkit-claude-md

Update CLAUDE.md with learnings, preferences, or project context. Use when user says "update claude.md", "add to claude.md", or wants to persist something.

stefan-stepzero/shipkit · 45 tokens

init-project-memory

Use when the user says "init memory", "set up memory", "scaffold memory", "init project memory", or invokes /init-project-memory — creates the .claude/ session memory system in a new project.

jkm-4314/claude-code-skills · 48 tokens