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.
npx skills add betayyang/claude-habit-distiller --skill distill-habitsgit clone --depth 1 https://github.com/betayyang/claude-habit-distillerWrote 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.
[](https://agentmods.dev/skills/betayyang/claude-habit-distiller/distill-habits)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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_msgwithpayload.type=user_message, use those (payload.message) and ignorerole=userresponse 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, theinput_textparts ofpayload.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=developeritems,turn_context, tool calls and tool output are never user preference.
- If the session has any
- 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.sourceis an object with asubagentkey (e.g.guardianapproval reviews,thread_spawnchildren), the "user" messages in it were written by an agent, not the user. - Sessions with
originator = codex_execare kept — wrappers and bots often relay real user messages throughcodex exec. The distiller's own runs are started with--ephemeraland 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.
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.
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.
- 11d ago Changed · +35 lines · +30 tokens per session b9f0308fb312
- 1mo ago Changed · +55 lines · +6 tokens per session 258cc6400ef0
- 1mo ago First seen · 121 lines · 81 tokens per session scan A e66d5dad4ec6
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.
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…
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"…
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…
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.
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.
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.