From agentops
Injects relevant prior knowledge from .agents context into the current session. Deprecated legacy adapter; prefer `ao lookup` for on-demand retrieval.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agentops:injectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **DEPRECATED (removal target: v3.0.0)** — Use `ao lookup --query "topic"` for on-demand learnings retrieval and phase-scoped context packets. This skill and the `ao inject` CLI command still work as compatibility adapters, but they are not the canonical context path and are not called from default hooks or other skills.
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.
To update installed skills: re-run the install one-liner — bash <(curl -fsSL https://raw.githubusercontent.com/boshu2/agentops/main/scripts/install.sh). (There is no update skill; skill refresh is an install-script concern.)
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 |
session-bootstrap + using-agentops route heresession-bootstrap → ao session bootstrap. The Universal AgentOps init prompt
for starting or onboarding a fresh agent session is the ao session bootstrap
orientation report — run it first, then pull decay-ranked context on demand with
ao lookup / ao inject.using-agentops → this skill (skill dir removed; embedded CLI copy retired with
it). Use when asked to Explain AgentOps workflows: start with ao session bootstrap
for orientation, then walk the on-demand surfaces here (ao lookup, ao inject,
ao knowledge brief) for the workflow tour.In the default hookless startup path, no startup injection occurs. Run ao session bootstrap for the standard orientation report, then prefer ao lookup / ao inject for on-demand retrieval and bounded per-phase packets. Use /inject or ao inject only for legacy compatibility.
If you author an opt-in SessionStart hook or run a legacy hook profile, it may call:
# 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 trigger: an externally authored or legacy session-start.sh may run 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 hookless path, run ao session bootstrap and then pull context explicitly with ao lookup or ao inject.
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 |
knowledge-activation, cp-auc)inject and ao lookup retrieve knowledge for the current session. Activation is the complementary capability — folded in here from the former knowledge-activation skill — that operationalizes a mature .agents corpus into durable operator surfaces (beliefs, playbooks, briefings, gaps). Where inject reads, activation promotes; the two are the read and write-to-surface halves of the same flywheel. Activation is the fourth step of the global-corpus workflow:
$curate --mode=harvest — gather artifacts from many rigs into ~/.agents/learnings/$compile — synthesize raw artifacts into .agents/compiled/$curate --mode=dream overnight — bounded compounding loop$compile remains the hygiene loop; activation owns corpus operationalization. Use it when the problem is no longer "capture more knowledge" but: promote the strongest recurring claims into a belief system, turn healthy topics into reusable playbooks, compile a small goal-time briefing, and surface thin topics and promotion gaps before they calcify.
The stable product surface is the ao knowledge command family:
ao knowledge activate --goal "turn agents into usable information" # full outer loop
ao knowledge beliefs # refresh belief book only
ao knowledge playbooks # refresh candidate playbooks
ao knowledge brief --goal "fix auth startup" # goal-time briefing
ao knowledge gaps # thin topics, promotion gaps, weak claims, next work
ao owns the belief/playbook/brief/gap product surfaces directly; the skill owns routing, sequencing, interpretation, and next-step recommendations. ao lookup and ao codex start consume these outputs as operator context — matched briefings are the preferred dynamic startup surface, while selected beliefs and healthy playbooks provide bounded supporting guidance. When a retrieved briefing, belief, or playbook changes a recommendation, record it with ao metrics cite "<path>" --type applied 2>/dev/null || true (use --type retrieved for loaded-but-unused context).
.agents/ exists. To run ao knowledge activate, verify at least one evidence substrate is present: packet builders (source_manifest_build.py, topic_packet_build.py, corpus_packet_promote.py, knowledge_chunk_build.py) under .agents/scripts/; or the harvest fallback .agents/harvest/latest.json; or the native operator surfaces (ao knowledge beliefs|playbooks|brief|gaps).ao knowledge beliefs then ao knowledge playbooks materialize consumer surfaces under .agents/knowledge/ and .agents/playbooks/.ao knowledge brief --goal "...". Keep it small, cite source surfaces, warn when a selected topic is thin.ao knowledge gaps reports thin topics, missing promotions, weak claims needing review, and the next recommended mining work.ao knowledge activate --goal "..." sequences evidence consolidation, belief/playbook refresh, optional briefing compilation, and a gap summary in one pass.Consumer-facing outputs: .agents/knowledge/book-of-beliefs.md, .agents/playbooks/index.md, .agents/playbooks/<topic>.md, .agents/briefings/YYYY-MM-DD-<goal>.md, .agents/retro/. Substrate surfaces: .agents/packets/, .agents/topics/, .agents/packets/chunks/catalog.jsonl. See references/knowledge-activation-output-surfaces.md and references/knowledge-activation-script-contracts.md for trust boundaries and the builder inventory.
ao inject CLI command behavior (header, JSON contract, --for filtering), linked to cmd tests (soc-jnfgi)ao knowledge command ownershipnpx claudepluginhub boshu2/agentops --plugin agentopsGuides efficient use of context-mem MCP tools: compress large outputs, search before re-reading files, persist knowledge across sessions, and manage token budget.
Captures insights as markdown files, searches prior learnings, and promotes patterns to CLAUDE.md using tiered backends (local, qmd, agent-fs) for knowledge across projects.