用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mironmax/claudecode-plugins --skill kg-scout命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Operations runbook for the knowledge-graph plugin: install and first run, plugin updates, server lifecycle (start/stop/restart/logs), autostart via systemd, connecting Claude Desktop/Cowork, configuration, the quota-gauge status line (reading your own 5h/7d limits), backup and restore, and troubleshooting (tools offline, -32000 errors, stale data, Desktop issues). Use when something needs setting up, breaks, or the user asks to manage the memory server or "read the docs and do what's needed".
Knowledge Graph — persistent, granular, evolving memory. Part of memory initially arrives preloaded: a "KG MEMORY PRELOADED" block carrying the session_id and most important portion of memory. Then the full read is on you: kg_read(cwd="<project root>") comes before any work, whatever the task. Full read still brings up only most important memories. Memory is highly optimised and served in layers. Recall: if needed details are not in preload/read and there is a gist that points in the right direction, recall full node; Capture: at the moment of learning, once the dots connect; Connect rather than duplicate — an edge beats a new node; Search for more — the read/sync shows the top of graph, not all of it. In a rich graph the fact you need is often buried under fresher work; search reaches every tier. Endorse at wrap-up: kg_useful(ids) on the ≤5 nodes that demonstrably changed this session's outcome. That credit is what keeps a node alive — it is never earned by being read, only by being named at the end. Mech
Knowledge graph maintenance — a bounded, resumable pass that pays down the graph's DEBT line (rendered after HEALTH in every kg_read). Run it when invoked, when DEBT shows HIGH, or as a dispatched maintenance subagent. Always-on reactive triggers (no pass needed, act mid-conversation): User correction → update the stale node before continuing. Node just proved useful → add one edge to current context. Gist feels vague after using it → sharpen while context is live. Just saved a node → check: duplicate? adjacent nodes need updating? Archival is automatic and reversible — leave archived nodes alone. Deletion is a last resort, only for the factually wrong and unfixable.
| name | kg-scout |
| user-invocable | true |
| description | Mine conversation history for patterns and insights worth preserving |
Scout extracts knowledge from Claude Code conversation history using a tension-driven, tiered approach: lightweight scanning first, deep investigation only when signals indicate value.
The goal is not to extract everything — it's to find patterns worth preserving while being economical with tokens.
No special tools needed. You read history files directly with Read/Bash. Progress persists via kg_progress.
Before scouting, ensure:
kg_read(cwd="<project root>") # Load graph + get session_id
kg_progress(session_id, task_id="scout") # Check where you left off
~/.claude/history.jsonl (Always scan first){"display": "...", "project": "/path", "timestamp": ..., "sessionId": "..."}~/.claude/projects/{encoded-path}/{session}.jsonl (Selective)/home/user/project becomes -home-user-projectDon't read full sessions blindly. Use history.jsonl to identify tension signals:
| Signal | What it looks like in history.jsonl | Action |
|---|---|---|
| Repetition | Same topic appears 3+ times | Deep-dive one session to capture pattern |
| Correction | "no I meant", "that's wrong", "actually" | Check session for preference/clarification |
| Decision | "let's use", "I chose", "going with" | Capture rationale |
| Frustration | "again", "still not", "keeps failing" | Find what was eventually solved |
| Meta | "always do", "never", "remember that" | Direct extraction candidate |
No tension signal → skip deep investigation.
kg_progress(session_id, task_id="scout")
If progress exists, continue from last_ts. If empty, start from beginning.
Read ~/.claude/history.jsonl (or tail recent lines if very large). Group by:
Present findings to user before deep-diving.
For sessions with tension signals:
~/.claude/projects/{encoded-project-path}/{sessionId}.jsonlAssistant message parsing: Content is nested: .message.content[] | select(.type == "text") | .text
Use standard memory tools:
kg_put_node(level="user", id="...", gist="...", notes=["mined from session {id}, {date}"])
kg_put_edge(level="project", from="...", to="...", rel="...")
Always:
notes: ["mined from session {id}"]kg_progress(session_id, task_id="scout", state={
"last_ts": 1770000000,
"sessions_reviewed": ["abc123", "def456"],
"patterns_found": ["docker-networking", "pytest-fixtures"],
"patterns_extracted": ["docker-networking"]
})
| Activity | ~Tokens | Frequency |
|---|---|---|
| Scan history.jsonl (500 lines) | 2-3k | Once, then incremental |
| Review patterns, decide | ~500 | Per scan |
| Fetch one session (filtered) | 1-3k | Only for tension signals |
| Extract & create nodes | ~500 | Per session |
Total productive scout: 5-10k tokens. Compare: blindly reading 10 sessions = 50-100k tokens, mostly noise.
Good times:
Bad times:
User-level (cross-project):
Project-level:
Skip: Generic greetings, one-off questions, raw code without insight, session mechanics ("continue", "yes").
Before creating any node/edge:
基于 SOC 职业分类