From hive-mind
You MUST invoke this (or ask the user) whenever an architecture decision is made, a non-obvious bug is diagnosed, a reusable code pattern emerges, or something surprising is learned about the repo, tooling, or developer workflow.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hive-mind:session-noteThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Extract insights from the current Claude Code session and write a structured
Extract insights from the current Claude Code session and write a structured note to hive mind knowledge base.
The vault path is defined by the HIVE_MIND_PATH environment variable.
The qmd collection name is defined by HIVE_MIND_COLLECTION (default: hive-mind).
The note author is defined by HIVE_MIND_AUTHOR (a wikilink to a people/ entry).
If any of the vars are unset, abort and flag to the user.
Full session — /hive-mind:session-note
Extract all notable insights from the entire session.
Focused — /hive-mind:session-note <focus>
Extract insights related only to the specified focus area.
The focus text is available as $ARGUMENTS.
When $ARGUMENTS is provided, filter extraction to ONLY content relevant
to that focus. Ignore session activity unrelated to the focus.
Determine the target repo directory dynamically from the current working directory and the vault structure.
pwdUse the basename of the current working directory (or its git root) as the repo slug. Use the name exactly as-is — do not strip suffixes or transform it.
Search for the sessions directory for the repo slug anywhere under $HIVE_MIND_PATH/projects:
find "$HIVE_MIND_PATH/projects" -type d -path "*/repos/<repo-slug>/sessions" | head -1
$SESSIONS_DIR).Extract the project name from the resolved sessions path:
PROJECT=$(echo "$SESSIONS_DIR" | sed 's|.*/projects/||' | cut -d'/' -f1)
The repo slug (from step 1) populates repo:. The extracted project name
populates project:. There is no corresponding tag.
All tags MUST exist in $HIVE_MIND_PATH/TAGS.md. Read that file every
time you generate a note — do not rely on a cached or hardcoded list.
Review the full conversation context (it is already loaded — do NOT attempt to parse JSONL transcript files). Then extract ONLY the following categories. Skip any category that has nothing meaningful to report.
New information discovered during the session. Things the user (or agent) did not know before and now does. Examples:
--forked flag on macOS for module isolation"Write each learning as a standalone, self-contained statement. Someone reading this note 6 months from now should understand the learning without needing the session context.
Choices made during the session that affect architecture, implementation strategy, tooling, or approach. For each decision, capture:
Example:
Chose JWT Bearer Flow over VisualForce Session ID for off-platform auth because VF pages can't be embedded in external sites without iframe restrictions. This means each customer org needs a Connected App configured.
Reusable patterns, snippets, or techniques discovered or created. Only include patterns that are:
Include a short code block with the pattern and a 1-2 sentence explanation of when to use it. Strip repo-specific variable names in favor of generic ones where possible.
Bugs fixed, errors resolved, or blockers unblocked. For each, capture:
Only include problems where the root cause was non-obvious or the fix is worth remembering. Skip trivial typos and syntax errors.
Use the template from $HIVE_MIND_PATH/templates/session-note.md as the
structural starting point. Populate each section following these guidelines:
Omit any section that has no content. Do not include empty sections.
YYYY-MM-DD-session-<slug>.md
The slug should be 2-4 hyphenated words derived from the primary topic.
Examples:
2026-02-21-session-jwt-auth-strategy.md2026-02-21-session-batch-apex-debugging.md2026-02-21-session-docker-compose-refactor.md[[path|Title]] syntax from the linking context.
Do not guess at links — only link to notes confirmed to exist by search.Read $ARGUMENTS to determine mode (full vs focused).
Determine repo slug from pwd (basename of working directory or git root).
Resolve vault path from $HIVE_MIND_PATH. Find the repo's sessions directory
using find "$HIVE_MIND_PATH/projects" -type d -path "*/repos/<repo-slug>/sessions" | head -1.
Read $HIVE_MIND_PATH/TAGS.md and $HIVE_MIND_PATH/templates/session-note.md
to get the current valid tag list and the note template. Use the template as
the structural starting point for the generated note — it defines the
frontmatter fields and body sections.
Scan current session context for extractable content per the 4 categories.
Discover vault context for linking. If qmd is not installed, skip
this entire step — the note will be created without wikilinks, same as
before. Otherwise, execute sub-steps 6a–6f:
6a. Extract search entities — From the extracted content (step 5), identify every named entity that plausibly exists as its own vault note. Entity types by priority:
| Priority | Entity type | Examples | Always query? |
|---|---|---|---|
| 1 (highest) | People / attendees | person names | Yes — never drop |
| 1 (highest) | Repositorys | repo slugs from step 2 | Yes — never drop |
| 2 | Glossary terms / internal jargon | TDS, Command Center, Mascot | Yes |
| 2 | Named tools / frameworks | qmd, Salesforce Shield, Next.js | Yes |
| 3 | Named concepts / decisions | JWT Bearer Flow, ECA auth | If distinctive |
| 4 (lowest) | Generic agenda items / action items | "review PR", "update docs" | Drop first |
No hard cap on query count. The entity count in the content is the natural bound. Soft ceilings per note type:
If approaching the soft ceiling, drop priority 4 and 3 entities first. Never drop a person or repo query.
6b. BM25 query formatting — CRITICAL
WARNING: BM25 tokenizes on hyphens and slashes. This vault is full of hyphenated content. Failing to de-hyphenate queries will produce poor or empty results.
Always convert hyphens and slashes to spaces before running BM25 queries:
What you want to find Wrong query Correct query Notes about trusted-services-lite trusted-services-litetrusted services liteNotes tagged salesforce/lwc salesforce/lwcsalesforce lwcNotes about jwt-auth jwt-authjwt authNotes about session-token handling session-tokensession tokenThis does NOT apply to semantic search — the embedding model handles hyphens and compound terms naturally.
6c. Run searches — Two search strategies, used together:
BM25 (per entity) — One query per named entity from 6a:
qmd search "<de-hyphenated entity>" --json -n 5 -c $HIVE_MIND_COLLECTION
Semantic (one pass for primary topic) — One vsearch query for
the note's overall topic, phrased as a natural language concept:
qmd vsearch "<conceptual description of the note's topic>" --json -n 5 -c $HIVE_MIND_COLLECTION
The semantic query should be a 5–15 word natural language description, not a keyword list. Example: "authentication strategy for external Salesforce API callouts" rather than "auth salesforce api".
If total BM25 hits across all entity queries already exceed 8 unique notes, the semantic pass may be skipped — the vault has been adequately sampled.
No qmd update here — that runs in the final step after the note is
written.
6d. Build linking context — From combined BM25 + semantic results, deduplicate by path and discard:
index.md)For each remaining result, record:
qmd://vault/ prefix and .md extension)[[<vault-path>|<title>]]qmd get "<filepath>" -l 20
for 2–3 top results to read their frontmatter tags)Note which domain tags recur across related notes — this is a signal (not a directive) for tag selection in step 8.
6e. Duplicate detection — If any result has a title or topic that closely matches the note being created (same repo, overlapping subject matter), flag it:
Potential duplicate detected:
[[path|Title]]covers a similar topic.
Present the warning to the user and ask whether to:
Do NOT silently create a duplicate.
6f. Use context during generation — Carry the linking context into step 7. During note generation:
[[path|Title]] wikilinks where the note's content naturally
references a related note's topic. Link on first mention only.type: term), wikilink
to it on first mention using [[glossary/<slug>|<Title>]].Generate the note content following the output format. Use the linking
context from step 6 to insert [[wikilinks]] to related vault notes
where the content naturally references their topics. Link on first
mention only; do not add a separate "Related Notes" section.
Validate that ALL tags in frontmatter exist in $HIVE_MIND_PATH/TAGS.md.
For any tag that doesn't exist, apply the three-check protocol from
TAGS.md. If it passes, add the tag to TAGS.md and keep it. If it fails,
replace it with the closest broader existing tag. Cross-reference domain
tags observed on related notes in step 6d. If a recurring tag from
related notes is relevant to the new note and was not already selected,
consider adding it (still subject to the 2–5 tag limit). Use related
notes' tags as a weak signal — do not blindly copy them.
Determine target directory:
find in step 3.Write the file to the target directory.
Update the qmd index so the new note is immediately searchable:
qmd update 2>/dev/null && qmd embed 2>/dev/null
If qmd is not installed, skip silently.
Report to the user: file path, title, which sections were populated, the number of wikilinks added, and which notes were linked.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub arctype-ventures/arctype-plugins --plugin hive-mind