memory-lint

memory-lint is a skill for Claude Code from KerberosClaw/kc_ai_skills. It costs 95 tokens per session (6,144 once invoked), scanned A, original, MIT.

A read-only quality check for a Claude Code memory directory, where saved notes guide future coding sessions. It looks for inconsistent indexes, broken links, outdated project information, duplicate rules, naming problems, missing metadata, and oversized files.

In plain words
What is it for?
Use it to scan a memory directory and receive a report before deciding which issues to repair.
Why use it?
It helps find problems in stored memory before they cause confusing or contradictory guidance. Fixes are kept separate from the initial inspection.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Good fit Use it to scan a memory directory and receive a report before deciding which issues to repair.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kerberosclaw/kc_ai_skills/memory-lint
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 KerberosClaw/kc_ai_skills --skill memory-lint
Clone the repo
git clone --depth 1 https://github.com/KerberosClaw/kc_ai_skills

Made for: Claude Code.

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 memory-lint

README.md
[![agentmods](https://agentmods.dev/badge/skills/kerberosclaw/kc_ai_skills/memory-lint/github.svg)](https://agentmods.dev/skills/kerberosclaw/kc_ai_skills/memory-lint)
Your own site
<a href="https://agentmods.dev/skills/kerberosclaw/kc_ai_skills/memory-lint"><img src="https://agentmods.dev/badge/skills/kerberosclaw/kc_ai_skills/memory-lint/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 memory-lint

Your own site · 80×15
<a href="https://agentmods.dev/skills/kerberosclaw/kc_ai_skills/memory-lint"><img src="https://agentmods.dev/badge/skills/kerberosclaw/kc_ai_skills/memory-lint.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,144 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00095 $0.06144
Opus 5 $0.00048 $0.03072
Sonnet 5 $0.00019 $0.01229
Haiku 4.5 $0.00010 $0.00614

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

Security

Grade A, and why

memory-lint 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 10d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/scan.py), 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.

memory-lint/SKILL.md · 320 lines

How it starts

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

memory-lint — Memory 品質健檢

Phase 1  唯讀掃描 ──► 報告(預設只做這段,不動任何檔案)
                        │  user 逐條拍板要修哪些
Phase 2  執行修正 ──► commit(開工前先記回退點)
                        │  改完全部提交 = 凍結
Phase 3  獨立複驗 ──► 過 → 收工 / 不過 → 回退到 Phase 2 前

🔴 收到 lint 觸發詞的預設動作是出報告。 user 必須明確點名要修哪幾條 (或明說「全部修掉」)才准進 Phase 2。Phase 1 期間不准順手合併、順手刪、順手歸檔。

跟 llm-wiki-lint 差異:本 skill 針對 memory 目錄(prefix-based 平鋪結構); llm-wiki-lint 針對 Karpathy LLM Wiki repo(wiki/ + raw/ + SCHEMA.md 三層)。


Phase 1 — 唯讀掃描

Step 1: 找到 memory 目錄

依序嘗試,命中第一個就用:

順序 來源
1 $ARGUMENTS 第一個位置參數
2 環境變數 $CLAUDE_MEMORY_DIR
3 settings.jsonautoMemoryDirectory
4 ~/.claude/memory/
5 都找不到 → 停止,告訴 user「偵測不到 memory 目錄」,不要瞎猜

第 3 條要看當前設定目錄(多帳號並存時 $CLAUDE_CONFIG_DIR 會指到別處):

CFG="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
MEMORY_PATH=$(jq -r '.autoMemoryDirectory // empty' "$CFG/settings.json" | envsubst)

Step 2: 跑機械掃描

# <skill_dir> = 本 SKILL.md 所在的目錄;掃描標的由參數帶入,
# 所以在哪個工作目錄呼叫都不影響結果
python3 <skill_dir>/scripts/scan.py "$MEMORY_PATH"

只用標準函式庫、唯讀、輸出 JSON。目標目錄由參數帶入,所以在哪個工作目錄呼叫都一樣。 沒有 MEMORY.md 會回 {"fatal": ...} 並以 exit 1 結束。

腳本已經處理掉幾個會讓檢查靜默失效的坑,不要自己在對話裡改寫成 shell 一行流

  • 不用 shell glob(zsh 未匹配 glob 會在指令執行前中止,而且 2>/dev/null 擋不住)
  • 不用固定路徑暫存檔(並行執行會互相覆蓋、失敗留髒資料)
  • 不 import 第三方套件(唯讀階段不該動 user 的 Python 環境;離線環境也裝不了)
  • [[...]] 掃描先剝掉 fenced 與行內 code,且檔名與 frontmatter name 兩種都算解析成功
  • 索引目標的 ./ 前綴會正規化

輸出欄位:

欄位 意義
layout 單層(只有 MEMORY.md)/兩層(MEMORY.md 只留路由、細目在 index_*.md
index_declared_missing MEMORY.md 指到但磁碟上沒有的子索引
index_orphaned 磁碟上有、但沒人指向的孤立子索引
orphan / missing 有檔沒被索引/索引指向不存在的檔
frontmatter namedescription(只認頂層)或 type(頂層或 metadata.type
wiki_broken / wiki_external [[...]] 解析不到的/指向子目錄或外部的
oversize 超過 300 行的檔(行數語意同 wc -l
prefixes / no_prefix 命名前綴分布與例外

🔴 兩層結構下若只拿 MEMORY.md 當索引來源,會把整庫誤判成 orphan。 腳本已處理, 但若你另外手寫檢查,這是最容易踩的一個。

Read the full file on GitHub · 320 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. 10d ago First seen · 320 lines · 95 tokens per session scan A a079744c9fc8

Subscribe to this mod's changes

memory-lint is a skill published in the GitHub repository KerberosClaw/kc_ai_skills (79 stars, last pushed 2d ago), licensed MIT. It adds 95 tokens to every session and 6,144 once invoked, about $0.0005 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-30.