distill-habits

distill-habits is a skill for Codex from betayyang/claude-habit-distiller. It costs 117 tokens per session (3,875 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 Codex

Written for Codex: reads $CODEX_HOME. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

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: 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 117 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,875 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.00117 $0.03875
Opus 5.5 $0.00047 $0.01550
Sonnet 5.5 $0.00023 $0.00775
Haiku 4.5 $0.00012 $0.00387

Measured 11d ago against content hash b9f0308fb312, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 11d 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 · 211 lines

How it starts

The opening of the file, as written. The whole thing — 211 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.

0. Which agent am I running for?

This one skill serves two agents. Everything below is written against the placeholders in this table — resolve them first and use only your column.

  • The headless runner states the agent explicitly in its prompt (agent=claude / agent=codex). That wins.
  • Otherwise: if you are Codex (invoked as $distill-habits, skill loaded from ~/.codex/skills/), use codex; if you are Claude Code, use claude.
Placeholder claude codex
<HOME> $CLAUDE_CONFIG_DIR or ~/.claude $CODEX_HOME or ~/.codex
<INSTRUCTIONS> (execution layer) <HOME>/CLAUDE.md <HOME>/AGENTS.md
Transcripts <HOME>/projects/<project-dir>/*.jsonl, one file per session <HOME>/sessions/YYYY/MM/DD/rollout-*.jsonl, plus <HOME>/archived_sessions/*.jsonl
Input history <HOME>/history.jsonl — display, timestamp (ms), project, sessionId <HOME>/history.jsonl — text, ts (s), session_id
Project of a session the <project-dir> folder name session_meta.payload.cwd (first line of the file)
Default ledger (memory_dir = "auto") <HOME>/knowledge/habits/ <HOME>/knowledge/habits/
State dir <ledger>/.state/claude/ <ledger>/.state/codex/

Reading Codex transcripts correctly

Codex rollout files are JSONL with a top-level type and a payload:

  • The user's words, per session:
    • If the session has any type=event_msg with payload.type=user_message, use those (payload.message) and ignore role=user response items — they repeat the same text, so don't count it twice.
    • Otherwise (older CLI versions only log the turn input), use type=response_item, payload.role=user, the input_text parts of payload.content. Drop parts that are context injected by the harness, not typed by the user: anything starting with < (<environment_context>, <user_instructions>, <recommended_plugins>, <image …>, </image>), # AGENTS.md instructions for …. IDE messages that start with # Files mentioned by the user: keep only the text after ## My request for Codex:.
    • role=developer items, turn_context, tool calls and tool output are never user preference.
  • The assistant's replies (event_msg / agent_message) are context only — use them to understand what the user was correcting or endorsing.
  • Skip sub-agent sessions entirely: if session_meta.payload.source is an object with a subagent key (e.g. guardian approval reviews, thread_spawn children), the "user" messages in it were written by an agent, not the user.
  • Sessions with originator = codex_exec are kept — wrappers and bots often relay real user messages through codex exec. The distiller's own runs are started with --ephemeral and leave no rollout file; if you ever see a session whose first user message starts with [habit-distiller run], skip it.
  • Window by the per-line timestamp (ISO-8601 UTC); file mtime is only a coarse prefilter.

Read the full file on GitHub · 211 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. 11d ago Changed · +35 lines · +30 tokens per session b9f0308fb312
  2. 1mo ago Changed · +55 lines · +6 tokens per session 258cc6400ef0
  3. 1mo 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 12d ago), licensed MIT. It adds 117 tokens to every session and 3,875 once invoked, about $0.0005 per session on Opus 5.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

ccs-align

Run the CCS Align seat's hourly breathing cycle — prove the local claude-mem worker is healthy, pull needle observations through search → timeline → getobservations, land them in a seat-owned middle cache via atomic grab → append → filter exclude-marks → replace, manage exclude marks, and walk house → project → seat…

thedotmack/claude-mem · 136 tokens

weekly-digests

Generate a serial week-by-week narrative digest of a project's full claude-mem timeline. Splits the timeline into per-ISO-week files, then runs one consecutive subagent per week — each receiving the prior week's carry-forward block — to produce one chapter per ISO week of data. Use when asked for "weekly digests"…

thedotmack/claude-mem · 93 tokens

mode-creator

Interactively create, install, activate, and verify custom claude-mem modes, including domain-specific observation types, concept tags, optional Telegram alerts, bot setup, worker restart, and startup-context verification. Use this whenever someone asks to customize what claude-mem remembers, create or change a mode…

thedotmack/claude-mem · 94 tokens

handoff

Generate a HANDOFF.md that captures goal, current state, files touched, failed attempts, and next steps — so a fresh Claude session can continue exactly where this one left off. Use when sessions are getting long, Claude keeps retrying the same broken solution, or the user wants to step away and resume later.

thedotmack/claude-mem · 66 tokens

cloud-sync

Set up or check claude-mem cloud sync with cmem.ai Pro. Use when the user says "set up cloud sync", "sync my memories", "cmem pro", "cloud backup", "sync status", or wants their memory database backed up or synced to their cmem.ai account.

thedotmack/claude-mem · 64 tokens

screenpipe

Search screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.

thedotmack/claude-mem · 46 tokens