Init mentoring
Skill RedAvocado22/claude-code-mentoring/.claude/skills/init-mentoring
Install the self-updating memory automation for this mentoring setup. Copies the hook scripts into the current project and registers them in .claude/settings.json. Run once, right after cloning/copying claude-code-mentoring into a project.From its SKILL.md
npx -y skills add RedAvocado22/claude-code-mentoring --skill init-mentoringAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.2 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it
Install the memory automation into the current project (${CLAUDE_PROJECT_DIR}), so ./memory/ keeps growing on its own instead of relying on anyone remembering to update it by hand.
What this does
Three scripts, two hooks:
memory-filter.sh(Stophook) — fires after every response. Readstranscript_path/cwdfrom stdin and immediately forksmemory-filter-worker.shas a detached background process, then exits. This must stay near-instant:Stopis synchronous (Claude Code waits for it), so the actual work cannot happen here.memory-filter-worker.sh(background only, never registered as a hook) — does the real work. Pulls the last real user message plus every bit of assistant narration since then out of the transcript, sends it to a cheap/fast model (Haiku) with a rubric asking "is this a decision / feedback / progress update / pattern worth remembering?", and ifYES, writes a one-line summary to.claude/hooks/.memory-pending.json. ANOwrites nothing — costs nothing, leaves no trace anywhere.memory-pending-check.sh(UserPromptSubmithook) — fires when the user submits their next message. Reads.memory-pending.jsonif it exists, surfaces it asadditionalContextfor that prompt, then deletes it (read-once). At that point the main agent (not Haiku) decides what to actually write and where, followingmemory/mentoring_rules.md's SESSION UPDATE PROTOCOL — the filter never writes memory itself.
Why split into three instead of one hook doing everything: measured
latency for a real headless claude -p call is ~5-35s (mostly CLI/network
overhead, not the model). A single synchronous Stop hook would add that
delay after every single response, which defeats the point of a "cheap"
background check. Splitting the slow part into a detached background
process means Stop returns in single-digit milliseconds — the check
still happens, it just surfaces on the next turn instead of blocking this
one. Best-effort, not guaranteed-immediate: if the user replies faster than
the worker finishes, that one reminder is skipped and the next turn's
worker run catches up instead.
Steps
-
Check dependencies. Run
command -v jqandcommand -v claude. If either is missing, stop and tell the user which one — everything here fails open (never breaks a session) but is a no-op without them. -
Copy the hook scripts.
mkdir -p ${CLAUDE_PROJECT_DIR}/.claude/hooks- Copy this skill's
memory-filter.sh,memory-filter-worker.sh, andmemory-pending-check.sh(all co-located next to thisSKILL.md) to${CLAUDE_PROJECT_DIR}/.claude/hooks/. chmod +xall three copies.- If files already exist at the destination, diff each against its source first — if identical, skip; if different, ask the user before overwriting (they may have customized it).
-
Register both hooks in
.claude/settings.json.- Read the file if it exists; otherwise start from
{}. - This is a merge, never a blind overwrite — preserve every existing
key. Add (or extend, if either array already has entries) this block:
Both timeouts are short on purpose —{ "hooks": { "Stop": [ { "type": "command", "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/memory-filter.sh", "timeout": 10, "suppressOutput": true } ], "UserPromptSubmit": [ { "type": "command", "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/memory-pending-check.sh", "timeout": 5, "suppressOutput": true } ] } }memory-filter.shonly forks a background process, andmemory-pending-check.shonly reads/deletes a small file. Neither should ever take more than a second or two; if one does, something is broken, not just slow. - Idempotency: before adding, check whether these hooks are already registered — if so, don't duplicate the entries.
- If the
update-configskill is available in this session, prefer delegating this merge to it instead of hand-editing the JSON — it knows the current settings.json schema authoritatively and this skill's copy of the schema can drift out of date.
- Read the file if it exists; otherwise start from
-
Gitignore the pending file. Add
.claude/hooks/.memory-pending.jsonto.gitignoreif it's not already covered — it's ephemeral scratch state (may briefly contain a snippet of conversation content) and should never be committed. -
Verify
memory/feedback_log.mdexists. The filter's rubric routes "confirmation of a working approach" signals there. If the project copied an older version of this template without that file, create it frommemory/feedback_log.mdin this repo (or prompt the user to pull the latest template). -
Confirm to the user in one or two sentences: both hooks installed,
Stopreturns instantly (background worker does the real check), a flagged turn surfaces as a reminder on the next message rather than blocking the current one. Mention they can remove it by deleting both hook entries from.claude/settings.json.
Do not
- Do not put the Haiku call directly in the
Stophook —Stopis synchronous, so anything slow there blocks the user after every single response. Always fork it intomemory-filter-worker.shin the background. - Do not make either hook
decision: blockthe turn — that risks loops if the filter is noisy, and defeats the non-blocking design. Both hooks only ever useadditionalContext. - Do not run this skill's logic silently as a side effect of something else
— it edits
settings.json, which is whydisable-model-invocation: trueis set. Only run it when the user explicitly asks (/init-mentoring).
What ships with it: 3 files
5.4 KB alongside SKILL.md, 3 of them executable
- memory-filter.shruns816 B
- memory-filter-worker.shruns3.8 KB
- memory-pending-check.shruns883 B