用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill inject命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
LLM token logprobs and calibration. Per-decision confidence, ECE, Brier, reliability diagrams, low-confidence triage.
Analyze LLM token logprobs and calibration. Use for per-decision confidence, ECE, Brier scores, reliability diagrams, and low-confidence triage.
回顾最近 N 天的 Claude Code 使用记录——扫描原始会话数据,按主题分组汇总"我都做了什么",并从个人操作系统视角输出模式、风险与增删建议。当用户说 /recap、"看看我这几天做了什么"、"回顾一下我最近的会话"、"这两天我用 claude 干了啥"、"活动回顾" 时使用。
基于 SOC 职业分类
正在显示 SKILL.md
| name | inject |
| description | Load relevant .agents context. |
| practices | ["wiki-knowledge-surface","pragmatic-programmer"] |
| hexagonal_role | driving-adapter |
| consumes | [] |
| produces | [] |
| context_rel | [] |
| skill_api_version | 1 |
| user-invocable | false |
| context | {"window":"fork","intent":{"mode":"none"},"sections":{"exclude":["TASK"]},"intel_scope":"full"} |
| metadata | {"tier":"background","dependencies":[],"internal":true} |
| output_contract | stdout: injected knowledge summary |
DEPRECATED (removal target: v3.0.0) — Use
ao lookup --query "topic"for on-demand learnings retrieval and phase-scoped context packets. This skill and theao injectCLI command still work as compatibility adapters, but they are not the canonical context path and are not called from default hooks or other skills.
On-demand knowledge retrieval. Not run automatically at startup (since ag-8km).
It is read-only: it only reads knowledge for injection and never writes to .agents/.
Load relevant prior knowledge into the current session as a legacy adapter.
| Field | Value |
|---|---|
| Lease | retire-candidate |
| Replacement port | retrieve_context / assemble_context |
| Replacement adapters | ao lookup, knowledge brief artifacts |
| Current allowed use | manual compatibility lookup only |
| Not allowed | default startup injection, hidden hook delivery, task planning |
In the default manual startup mode, MEMORY.md is auto-loaded by Claude Code and no startup injection occurs. Prefer ao lookup for on-demand retrieval and bounded per-phase packets. Use /inject or ao inject only for legacy compatibility.
In lean or legacy startup modes (set via AGENTOPS_STARTUP_CONTEXT_MODE), the SessionStart hook runs:
# lean mode (MEMORY.md fresh): 400 tokens
ao inject --apply-decay --format markdown --max-tokens 400 \
[--bead <bead-id>] [--predecessor <handoff-path>]
# legacy mode: 800 tokens
ao inject --apply-decay --format markdown --max-tokens 800 \
[--bead <bead-id>] [--predecessor <handoff-path>]
This legacy path searches for relevant knowledge and prints a bounded summary.
When --bead is provided (via HOOK_BEAD env var from Gas Town):
When --predecessor is provided (path to a handoff file):
Given /inject [topic]:
With ao CLI:
ao lookup --query "<topic>" --limit 5
Without ao CLI, search manually:
# Global operating memory
sed -n '1,120p' ~/.agents/MEMORY.md 2>/dev/null
# Recent learnings
ls -lt .agents/learnings/ | head -5
# Recent patterns
ls -lt .agents/patterns/ | head -5
# Recent research
ls -lt .agents/research/ | head -5
# Global learnings (cross-repo knowledge)
ls -lt ~/.agents/learnings/ 2>/dev/null | head -5
# Global patterns (cross-repo patterns)
ls -lt ~/.agents/patterns/ 2>/dev/null | head -5
# Legacy patterns (read-only fallback, no new writes)
ls -lt ~/.claude/patterns/ 2>/dev/null | head -5
Use the Read tool to load the most relevant artifacts based on topic.
Present the injected knowledge:
After presenting injected knowledge, record which files were injected for the feedback loop:
mkdir -p .agents/ao
# Record each injected learning file as a citation
for injected_file in <list of files that were read and presented>; do
echo "{\"artifact_path\": \"$injected_file\", \"cited_at\": \"$(date -Iseconds)\", \"session_id\": \"$(date +%Y-%m-%d)\", \"workspace_path\": \"$PWD\"}" >> .agents/ao/citations.jsonl
done
Citation tracking enables the feedback loop: learnings that are frequently cited get confidence boosts during /post-mortem, while uncited learnings decay faster.
| Source | Location | Priority | Weight |
|---|---|---|---|
| Global Memory | ~/.agents/MEMORY.md | Highest | 1.0 |
| Learnings | .agents/learnings/ | High | 1.0 |
| Patterns | .agents/patterns/ | High | 1.0 |
| Global Learnings | ~/.agents/learnings/ | High | 0.8 (configurable) |
| Global Patterns | ~/.agents/patterns/ | High | 0.8 (configurable) |
| Research | .agents/research/ | Medium | — |
| Retros | .agents/learnings/ | Medium | — |
| Legacy Patterns | ~/.claude/patterns/ | Low | 0.6 (read-only, no new writes) |
Knowledge relevance decays over time (~17%/week). More recent learnings are weighted higher.
Hook triggers: session-start.sh runs at session start with AGENTOPS_STARTUP_CONTEXT_MODE=lean or legacy
What happens:
ao inject --apply-decay --format markdown --max-tokens 400 (lean) or --max-tokens 800 (legacy).agents/learnings/, .agents/patterns/, .agents/research/ for relevant artifactsResult: Prior learnings, patterns, and research are available for legacy hook profiles. This is not the default AgentOps 3.0 path.
Note: In the default manual mode, MEMORY.md is auto-loaded by Claude Code and this hook emits only a pointer to on-demand retrieval commands (ao search, ao lookup).
User says: /inject authentication or "recall knowledge about auth"
What happens:
ao lookup --query "authentication" --limit 5Result: Topic-specific knowledge retrieved and summarized, enabling faster context loading than full artifact reads.
| Problem | Cause | Solution |
|---|---|---|
| No knowledge injected | Empty knowledge pools or ao CLI unavailable | Run /post-mortem to seed pools; verify ao CLI installed |
| Irrelevant knowledge | Topic mismatch or stale artifacts dominate | Use --context "<topic>" to filter; prune stale artifacts |
| Token budget exceeded | Too many high-relevance artifacts | Reduce --max-tokens or increase topic specificity |
| Decay too aggressive | Recent learnings not prioritized | Check artifact modification times; verify --apply-decay flag |
ao inject CLI command behavior (header, JSON contract, --for filtering), linked to cmd tests (soc-jnfgi)