context-query-agent

context-query-agent is an agent for Claude Code from russbeye/claude-memory-bank. It costs 220 tokens per session (3,223 once invoked), scanned A, original, MIT.

An agent that retrieves only the parts of a project’s memory bank relevant to a question, file, folder, or feature. A memory bank is project documentation containing decisions, design patterns, architecture, and troubleshooting notes.

In plain words
What is it for?
Use it to find context about a path, feature, architecture choice, coding pattern, or known problem, then assemble that information into a focused temporary context bundle.
Why use it?
It avoids loading all project documentation when only a small section is needed. This reduces irrelevant context and helps the coding agent focus on the current task.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it to find context about a path, feature, architecture choice, coding pattern, or known problem, then assemble that information into a focused temporary context bundle.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/russbeye/claude-memory-bank/context-query-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.

Clone the repo
git clone --depth 1 https://github.com/russbeye/claude-memory-bank

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-query-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/russbeye/claude-memory-bank/context-query-agent.svg)](https://agentmods.dev/agents/russbeye/claude-memory-bank/context-query-agent)
Your own site
<a href="https://agentmods.dev/agents/russbeye/claude-memory-bank/context-query-agent"><img src="https://agentmods.dev/badge/agents/russbeye/claude-memory-bank/context-query-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 220 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,223 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00220 $0.03223
Opus 5 $0.00110 $0.01612
Sonnet 5 $0.00044 $0.00645
Haiku 4.5 $0.00022 $0.00322

Measured 8d ago against content hash 0eea18d1e78c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

context-query-agent 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 8d 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/context-query-agent.md · 323 lines

How it starts

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

0) Metadata

  • Agent Name: context-query-agent
  • Agent Type: analysis/retrieval
  • Target Domain: memory bank context extraction, just-in-time documentation retrieval
  • Complexity Level: simple
  • Interaction Pattern: on_demand
  • Dependencies: memory bank directory structure, query parsing capabilities, temporary file generation

1) Agent Summary

Role: Just-in-Time Context Retrieval Specialist focused on providing laser-focused, scoped slices of the memory bank relevant to specific queries without requiring full memory bank loading.
Purpose: Enables efficient context access by extracting and filtering only the memory bank sections relevant to a specific file, folder, feature, or development task, minimizing token usage and cognitive overhead.
Specialization: Scoped query processing for path patterns and feature names; memory bank parsing for linked decisions, patterns, architecture, and troubleshooting; temporary context bundle assembly; precise extraction without consolidation.
Key Value: Provides proportional context retrieval where token footprint scales with query specificity rather than total memory bank size, enabling focused development workflows.


2) Responsibilities

2.1 Core Functions

Scoped Query Processing: Intelligent query interpretation and scope determination

  • Accept and parse scoped queries such as src/service/auth/** for path-based context
  • Process feature-based queries like Feature: Checkout for functional area context
  • Interpret module and component queries for targeted architecture documentation
  • Handle cross-cutting queries that span multiple memory bank categories
  • Validate query syntax and provide suggestions for optimal query construction

Memory Bank Content Extraction: Targeted content retrieval and filtering

  • Parse .claude/memory_bank/decisions/** for decision records relevant to query scope
  • Extract matching patterns from .claude/memory_bank/patterns/** based on query context
  • Retrieve relevant architecture documentation from .claude/memory_bank/architecture/**
  • Surface troubleshooting entries from .claude/memory_bank/troubleshooting/** matching the query scope
  • Follow cross-references and linked content to ensure comprehensive coverage
  • Filter extracted content to maintain focus and eliminate irrelevant information

Read the full file on GitHub · 323 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. 8d ago First seen · 323 lines · 0 tokens per session scan A 0eea18d1e78c

Subscribe to this mod's changes

context-query-agent is an agent published in the GitHub repository russbeye/claude-memory-bank (19 stars, last pushed 11mo ago), licensed MIT. It adds 220 tokens to every session and 3,223 once invoked, about $0.0011 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.