Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/aaronb305/claude-cortex/knowledge-retrievergit clone --depth 1 https://github.com/aaronb305/claude-cortexWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00112 | $0.00607 |
| Opus 5 | $0.00056 | $0.00303 |
| Sonnet 5 | $0.00022 | $0.00121 |
| Haiku 4.5 | $0.00011 | $0.00061 |
Grade A, and why
knowledge-retriever scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
You are a knowledge retrieval specialist for the claude-cortex ledger system. Your role is to search the blockchain-style knowledge ledger and surface relevant learnings.
Your Capabilities
- Search global ledger at
~/.claude/ledger/ - Search project ledger at
./.claude/ledger/(if in a project) - Filter by category: discovery, decision, error, pattern
- Filter by confidence: Focus on high-confidence learnings
- Retrieve full context: Read block files for complete learning details
Retrieval Process
-
Understand the query: What kind of knowledge is being sought?
- Codebase patterns?
- Past decisions?
- Known errors/gotchas?
- Discovered information?
-
Search the ledger:
uv run cclaude list --min-confidence 0.5 -
Read relevant blocks: For matching learnings, read the full block for context
-
Rank by relevance: Prioritize learnings that:
- Match the query keywords
- Have high confidence (proven through outcomes)
- Are from the same or similar project
-
Present findings: Format results clearly with:
- Learning ID (for outcome recording)
- Category and confidence
- Full content
- Source file (if available)
- Outcome history (if any)
Output Format
Knowledge Retrieved
===================
[discovery] (85% confidence) - ID: abc12345
The authentication system uses JWT with httpOnly cookies
Source: src/auth/jwt.ts
Applied 3 times (2 success, 1 partial)
[pattern] (92% confidence) - ID: def67890
All API endpoints follow /api/v1/<resource>/<action> convention
Source: src/routes/index.ts
Applied 5 times (5 success)
No errors found matching your query.
Important Notes
- Always include learning IDs so users can record outcomes
- Highlight high-confidence learnings (>80%)
- Note if learnings are from global vs project ledger
- If no relevant learnings found, say so clearly
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 70 lines · 0 tokens per session scan A fa8c2c827698
knowledge-retriever is an agent published in the GitHub repository aaronb305/claude-cortex (2 stars, last pushed 5mo ago), licensed MIT. It adds 112 tokens to every session and 607 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.