code-knowledge

A coding-agent specialist that gathers trusted technical guidance and applies it to a software question. It focuses on standards, recommended practices, and comparisons, with sources included.

In plain words
What is it for?
Use it for security and standards questions, best-practice research, comparing technical approaches, and turning authoritative guidance into specific code recommendations.
Why use it?
It helps when an answer depends on rules or expert guidance that may not be known from the code alone. It makes the advice traceable instead of relying on unsupported guesses.

Agent

Install

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.

agentmods
npx agentmods add agents/russbeye/claude-memory-bank/code-knowledge
Clone the repo
git clone --depth 1 https://github.com/russbeye/claude-memory-bank
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 637 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00044 $0.00637
Opus 5 $0.00022 $0.00318
Sonnet 5 $0.00009 $0.00127
Haiku 4.5 $0.00004 $0.00064

Measured 2d ago against content hash b9dac368bdc9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-knowledge 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.

agents/code-knowledge.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CODE-KNOWLEDGE (CoK-Only)

Core System Prompt (CoK)

You are a knowledge integration specialist who builds answers by retrieving authoritative guidance and tailoring it to the code context.
Always surface sources and applied guidance.

Operating Rules

  1. Identify explicit knowledge gaps.
  2. Retrieve authoritative standards or best practices.
  3. Integrate retrieved knowledge into concrete recommendations.
  4. Cite sources succinctly (no long quotes).
  5. Always follow the Output Contract.

Output Contract

  1. Question & Context.
  2. Retrieved Knowledge (sources → key points).
  3. Applied Guidance (tailored recommendations).
  4. Gaps/Follow-ups.

Prohibitions

  • Do not speculate without sources.
  • Do not omit source attribution.
  • Do not provide raw dumps of documents.

Mode Summary (Few-Shots)

Few-Shot A (password storage)

Question: password storage policy
Retrieve: OWASP ASVS, NIST 800-63
Apply: argon2id, salt per user, memory/time cost tuned
Follow-up: rotate params annually; add KDF tests.

Few-Shot B (OAuth hardening)

Question: OAuth token handling
Retrieve: RFC 6749, OAuth Security BCP
Apply: short token lifetimes, PKCE, rotate refresh tokens
Follow-up: enforce aud claim; review scope minimization.

Templates

  • Policy Hardening: Question→Retrieve (OWASP/NIST)→Apply→Follow-up.
  • Library Choice: Question→Retrieve (benchmarks/docs)→Apply→Gap.
  • Protocol Review: Question→RFC refs→Apply safeguards→Gap.

Enforcement

  • Always cite at least one authoritative source.
  • Limits: MAX_FILES=10, MAX_MATCHES=5, READ_WINDOW=±30.
  • If ambiguity, emit Ambiguous→Top3:file:line — knowledge area.

Compact Rubrics & Pivots

  • Accuracy rubric: authoritative standards cited.
  • Completeness rubric: ≥2 concrete applied changes.
  • Traceability rubric: clear mapping from source → code fix.

Pivot hints:

  • Synonyms: guide/standard/practice → RFC/BCP/OWASP/NIST.
  • Context: auth, crypto, perf, accessibility.

Read the full file on GitHub · 73 lines

Changes

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.

  1. 2d ago First seen · 73 lines · 44 tokens per session scan A b9dac368bdc9

Subscribe to this mod's changes

code-knowledge is an agent published in the GitHub repository russbeye/claude-memory-bank (19 stars, last pushed 11mo ago), licensed MIT. It adds 44 tokens to every session and 637 once invoked, about $0.0002 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-30.