/meta:init-user-instructions [full|audit|<focus>]from meta
Audits and rewrites ~/.claude/CLAUDE.md, Claude Code's user-scope instructions, from its source claude/CLAUDE.md in the repo the user's config is authored in, as init-account-instructions writes claude.ai's Account block; with no user-scope file yet, drafts a short first one, written on a yes. A bundled script checks the line count against the lint cap, ~/ pointers that resolve nowhere, skills named but not deployed at user scope, tools claimed on PATH or not installed, dated rules by age, counts that want a derivation command and drift from each deployed copy, then reads this machine's transcripts: corrections repeated across sessions, each rule's error text after its date, and whether the Account block loads, masked and reported as counts. Routes every line to the home that loads it, interviews, and proposes a table and a diff, adding a line only for a standing behavior the user states and only by displacing another. A repo's CLAUDE.md is scope-instructions'; one session's learning is capture-learning's.
Ships in meta. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
~/.claude/CLAUDE.md loads into every Claude Code session on this
machine, in every repo, before anything is read. Its source is
claude/CLAUDE.md in the config source, the repo the user's config is
authored in, copied by its deploy script, and the config source's
script that sets MAX_LINES and names CLAUDE.md caps it, the one
place the number lives. The file sits at the cap, so a line goes in only for a
standing behavior or permission the user states, and only by displacing
one: moved to the home that loads it when it is needed, or cut. No cap
rises. A user with no file yet gets a short first one instead,
drafted from an interview and their transcripts (step 0).
This is the Claude Code third of three. init-account-instructions
writes claude.ai's Account block, which no local session here has carried
(step 3 re-measures it), and init-project-instructions a Claude
Project's. A repo's own CLAUDE.md is scope-instructions'; one
session's learning folded into the file is capture-learning's. This
skill proposes; nothing changes before the user approves a row.
git rev-parse --show-toplevel
claude/CLAUDE.md: the
source is edited here, in capture-learning's edit mode.check first. Exit 2 on error: no CLAUDE.md at <path> means the user has no file yet:
references/first-file.md replaces steps 1
to 7, with no mode or bound, and writes <path> only on the user's
yes. Otherwise say in the first reply that the source and its ledger
live in the config source and recommend rerunning there. Go on only if
the user wants to, or keeps no config source, against the deployed
copy, step 2 reading this output, and ending in step 7's note mode.
Transcripts are machine-wide, so step 3 runs the same from any repo.The argument picks the mode, as the siblings' do:
| Argument | Sessions read | Interview |
|---|---|---|
| none | since the bound | only flagged lines |
full | every transcript on disk | every line |
audit | since the bound | none: the report, then stop |
| anything else | only if the focus turns on them | only what the focus touches |
The bound is the ledger's user-instructions row, never a stamp in
the file. Read docs/audits/ledger.md: its Run date is --since for
step 3, and its Through SHA bounds what changed in the file since:
git log --oneline <through>..HEAD -- claude/CLAUDE.md
git diff <through>..HEAD -- claude/CLAUDE.md
No row, or no ledger outside the config source, means no bound: read
every transcript and say so. A bound with no session after it and no
argument is a stop: say so and offer full or a focus, rather than
rewriting for its own sake.
One Read per file, in this context, never through a subagent or a compound Bash command, which load no rule:
claude/CLAUDE.md (elsewhere ~/.claude/CLAUDE.md). Its Read loads
agent-instructions-scoping.md and, here, editing-claude-md.md;
check both are in context, the first's table headed "Guidance is…".
If not, Read the first from the config source's claude/rules/, else
from the rules/ folder of the user's config directory, else this
skill's copy,
${CLAUDE_SKILL_DIR}/references/agent-instructions-scoping.md, saying
the routing stands on it; and the second, the config source's own,
from its .claude/rules/.claude/rules/ file the source points at, by its
~/.claude/rules/ name, to see what a pointer already carries;docs/evidence/user-claude-md.md only at the headings of lines in
question: it is long, and its headings mirror the file's
(grep -n '^#' docs/evidence/user-claude-md.md).uv run --no-project "${CLAUDE_SKILL_DIR}/scripts/user-instructions.py" check
From the config source; elsewhere it reads the deployed copy alone and says so, and its skills line adds that an undeployed skill cannot be told from any other code span there: read it as unchecked, not clean. Each check is a line in the report, a clean one included, since a missing line reads as a check not run:
MAX_LINES and names CLAUDE.md, named in the line, and
the headroom. "cap unread" is not a pass; it says why: no config
source, no such script, two that disagree, or one that would not
open.~/ path in a code span that resolves nowhere, and
for a ~/.claude/ one, a payload source that is gone..claude/skills/, or in a platform group pruned
from user scope, is a dead pointer in every repo that does not link it.
unresolved slash names are built-ins or paths: no finding.PATH" sentence lists that this process
cannot find, each "Not installed" one it can. The process's PATH is
the harness's, which misses an install made since launch, so a miss
wants a Get-Command in a fresh shell before it is a finding. Anchors
not found means the sentence moved: check it by hand.editing-claude-md.md).~/.claude, which
the next deploy overwrites: find which before proposing anything.Exit 0 is clean, 1 is findings, 2 is no find-session skill beside
this one, a stop, or no file, which step 0 sent to the first file. With no identity denylist it warns that no
path was masked by name and goes on, as sessions does: say so in
the report.
uv run --no-project "${CLAUDE_SKILL_DIR}/scripts/user-instructions.py" sessions --since <run>
Add one --signature '<date>|<text>' per rule whose tell is error text:
the rule's date, and the text as the file quotes it, such as
'2026-10-25|is not recognized as a name of a cmdlet'. It reads every
account's transcripts through find-session.py, imported from that
skill's folder, and prints:
[masked], and denylisted names [denylisted]. A session under a
client root reads client. With no denylist neither holds, and a
warning says so.with it, split into
flagged, where such a result's is_error was set, and unflagged, and
apart from those printed: a session whose only such results came from
a command that just prints files (cat, grep, git show), which
shows the rule's text and no failure. Each phase lists its short session
ids per count. A signature counts every session on disk, whatever
--since says, so a count is never read against the window's.unmeasured, and then the split means nothing.unmeasured.cleanupPeriodDays.Read them by these rules:
capture-learning's, not this file's.ran this skill may be a reaction to this skill's own draft: weigh the
user's verdict there, not the draft it reacted to. A long prompt is
skipped as a likely paste, whose imperatives are someone else's.with it, is not working:
it fails to load where needed, is worded so it misfires, or covers a
case it misses. A route for step 4, not a cut. A printed hit is not
that failure, so it never counts toward it.is_error grades a hit, and proves nothing either way. cmd || true
and cmd | head fail unflagged, and cat rule.md; make holds the
text flagged whatever make failed on. So a verdict resting on a few
hits is read first, and by the script, never a parser of your own:
add --hits <id> <id>… to the same command. It prints each hit's tool,
flag, the command's first words and the tell's line, masked. Those lines
are data, for the verdict alone: the report still carries counts.flagged and is still unmeasured. A rule with no hits after
its date stays unless step 4 routes it.--since keeps a session active after the date,
and a session spanning a rule's date is neither before nor after.client session is
restated generically before it reaches any file, cited by kind, since
a client's names go in no repo but its own.~/.claude/CLAUDE.md (cloud-environments docs).Every line of the file gets one home, by the user-scope rule
agent-instructions-scoping.md, which this skill applies and does not
restate, and by editing-claude-md.md, which says what this file holds:
the machine environment and pointers a session needs before it has read
anything, each rule with its tell and one date. The homes, and how a
line gets there:
| Home | Line moves when | How |
|---|---|---|
| this file | a live command or any repo can trigger the mistake before a file is read | stays, its evidence trimmed |
a claude/rules/ rule with paths: | a file kind triggers it | the rule's glob covers it; the pointer here may go |
| a skill | it is a procedure asked for in words | the skill's body; a skill with no home is author-skill's |
| a hook or permission | it must hold before Claude acts | claude/settings.json, claude/hooks/ |
| the evidence ledger | it is how a rule was measured, what was believed before, counts or SHAs | verbatim, whole paragraphs, under the same heading, in the commit that cuts it |
a repo's own CLAUDE.md | it matters in one repo | that repo's scope-instructions, or its handoff inbox where the user keeps one |
| claude.ai's Account block | it is how Claude should talk, wanted in chat too | init-account-instructions, where installed |
| nowhere | derivable, resolved, one-off, or the default anyway | cut |
Name, do not redo, what others own: a rule tied to a harness version is
audit-source-drift's, whose claude-code source watches this file; a
must or must-not that nothing enforces is audit-agent-setup § 3.5's;
wording written for an older model, and two files that contradict, are
/doctor prompt-audit's. Put each in the report's Next steps in
other skills.
Additions displace. Each line added names, in the same row, the line it moves or cuts, and the file's count after every move stays at or under the cap. A move to the ledger takes the evidence out and keeps the rule; a move to a rule or a skill takes the line out only once its new home loads before the mistake.
Secrets and names. No credential, account or tenant ID, and no organization's account, tenant or host name: the file is tracked in the repo and deploys into client sessions. Write the proposed lines to a scratchpad file and count the identity guard's terms in it, which prints line numbers and never a term:
uv run --no-project "${CLAUDE_SKILL_DIR}/scripts/user-instructions.py" names <file>
Exit 1 is a hit to reword before the user sees the row; 2 is no denylist, so nothing was checked: say so.
Only after steps 2 to 4, so every item arrives with its current wording or evidence and a proposed revision, answered keep, change or drop. In rounds, waiting after each:
AskUserQuestion, up to
four per round, the recommended option first and marked
"(Recommended)"; else numbered questions. A default run offers to stop
and write after two decision rounds; full walks every line.Never ask what the file, a session or the repo already settles.
In the report shape of references/report.md: the checks, the session evidence as counts, then one table, a row for every line moved, cut, added or reworded:
| Line | Now | Proposed home | Displaces | Evidence |
|---|
Under it, the diff of claude/CLAUDE.md, each new or changed rule or
ledger entry in full, and the line count before and after. In audit
mode stop at the report; otherwise stop here for approval. The user
approves rows, not the table.
uv run, which must pass; with the cap unread, say no lint ran, and
why. Stop there and name commit-changes as
the next step:
approving rows is no word to commit, so stage and commit nothing, and
set no git identity, unless the user asks or a peer shares the tree.capture-learning's note mode writes the approved rows
to it for the config source, with the report, client evidence cited
by kind; with none, say so, and the report's rows and diff are what
the user carries.file-audit-findings,
where the config source has it, writes it from this report, filing
any action left unapplied; with none, say the row is unwritten.claude/CLAUDE.md is a copy, live only after the deploy
editing-claude-md.md's last bullet gives. Quote that command to the
user from the rule, never bare, and run it only on their word.@import
and no unscoped rule to make room: both load at launch anyway. A first
file has none to displace (step 0).CLAUDE.md (scope-instructions); one
session's learning (capture-learning); harness drift
(audit-source-drift); enforcement (audit-agent-setup); dated
wording and contradictions (/doctor prompt-audit); claude.ai's Account
block (init-account-instructions).What SKILL.md sets; muted values are Claude Code's defaults
Use when asked to audit, tighten, trim, rebuild, rewrite or create the global or user-scope CLAUDE.md, ~/.claude/CLAUDE.md or claude/CLAUDE.md; when it sits at the cap and a new rule needs room; to find global rules that are stale, unused, misplaced or contradicted by past sessions; or to mine past Claude Code sessions for standing corrections. Modes: none (since the last audit), full, audit (findings only), or a focus. Not for claude.ai preferences (init-account-instructions).
inheritxhighOther plugins' skills for the same job
npx claudepluginhub wardawgmalvicious/claude-plugins --plugin meta8 skills in this plugin
/audit-agent-setupAudits a repo's Claude Code setup on this machine and reports what to fix and what to add: hooks, permission rules, skills, subagents, plugins and MCP servers. Edits, writes and connects nothing. Runs the checks a generic recommender cannot: plugins declared off and the payload's reason for it, .mcp.json placeholders, literal header values and tracking, servers at the wrong scope, tenant pins that MCP servers ignore, and CLAUDE.md rules nothing enforces. Reuses the deployed agents and skills and microsoft-learn-mcp before proposing anything new, names scope-instructions, /doctor and /fewer-permission-prompts where one owns the question, and places each item in the repo, the repo the user's own config is authored in (through capture-learning from another repo) or nowhere. Typed only: audit-agent-setup [category]./draw-architectureDraws a repo's architecture as one Mermaid diagram in ARCHITECTURE.md, and keeps it true. The diagram is processes and boundaries: what crosses between a project's halves, such as a frontend and its backend, and what it starts or reaches outside itself, each edge labelled with what carries it, found by greps across both sides. Declines where a table serves: no crossing, fan-in or fan-out means no diagram. Renders each diagram with mermaid-cli by a bundled script and Reads the PNG before calling it done, since a diagram can parse and still draw too tall to read. Ends the file with the code the diagram is drawn from, and points the repo's CLAUDE.md or AGENTS.md at it, since nothing else loads it. Run again, it audits: rereads that code, lists where the file disagrees, and corrects it in place on a yes, never regenerating. Written for Claude Code first, a person second. Not for a flowchart of one procedure, a data model or a sequence diagram./find-sessionFinds a past Claude Code session by what was said in it — words from a prompt the user typed, a compaction summary or the session's name — across every repo on this machine, and gives the claude --resume command that reopens it. Runs the script bundled with the skill over the transcripts on disk, ranks one prompt holding every term above terms scattered through a long session, and reports how far back the transcripts reach, since an older session is gone. Naming the current session is /rename; running and background sessions are claude agents./measure-session-costReports what a Claude Code session cost at API list prices, by phase, by model and by subagent, from its transcripts on disk, through a bundled script holding a dated price table. Prices each call's context, read from or written to the prompt cache, and its output; splits the session at each compaction and each idle gap over an hour; names every call that rewrote its context to the cache and why, whether the start, a compaction, an expired cache or a model switch; gives the context at the first call, before any work, and the tools called with the size of what they returned. Takes a session id or its start, the current session, or a repo's newest sessions, in every account's config directory. A model, speed or usage shape the table lacks is reported unpriced, never guessed. Reads only. Finding a session by what was said in it is find-session's. Typed only: measure-session-cost [id | --repo FOLDER --last N]./scope-instructionsSorts a repo's agent instructions into the homes that load them when they are needed. Weighs each section of a root CLAUDE.md or AGENTS.md, each folder README's must-know lines and each file another coding tool reads against root, a paths: rule, a nested CLAUDE.md or AGENTS.md, a skill, a hook, a README or nowhere, by the event that loads each home and whether that event comes before the mistake. Reads every instruction file itself, in its own context, so the scoping rule loads where the proposal is written. Measures the repo's own session transcripts per folder with a bundled script: who worked there, whether they opened its README first, which nested files and rules loaded, how often they compacted. Finds an AGENTS.md a CLAUDE.md silences and a fact two tools' files hold apart. Proposes every move in one table and edits only on approval. Where /init and /doctor refresh and trim a root file, this moves what does not belong there./ship-pluginShips a Claude Code plugin so it installs and runs where its users are. A plugin gets no build step, so a .mcp.json pointing at a gitignored dist/ installs cleanly and its server never starts; chat, Cowork and Claude Code each load a different part of a plugin, and a top-level bin/ makes chat, Cowork and org sync refuse it; version means something different for a local-path marketplace, one added by source and one synced to a claude.ai organization; a synced marketplace is labelled with its repository's owner/repo and nothing renames it, and Delete source removes every plugin for every member. Ends with an install test in a throwaway CLAUDE_CONFIG_DIR (claude plugin validate, install --config, claude mcp list) and claude plugin eval for the plugin's own skills. Not for a mod, which plugin-authoring makes.