contextd: Agent for Claude Code

.claude/agents/contextd-reviewer.md

contextd-reviewer is an agent for Claude Code from philngt/contextd. It costs 34 tokens per session (459 once invoked), scanned A, original, MIT.

A review agent that checks generated code or changes against the rules and reference documents selected for the current task. It treats a JSON context file as the authoritative source.

In plain words
What is it for?
Use it to review a list of solution files or a code diff against referenced workspace rules, design patterns, and domain documents.
Why use it?
It helps catch rule violations, unsupported references, and mismatches with the project’s documented contracts before changes are accepted. It reports findings without changing code or files.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is philngt/contextd's own configuration. It tells Claude Code how to work on contextd itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything contextd configures →

Reuse

Borrowing it

Nothing to install: this file belongs to philngt/contextd. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/philngt/contextd/main/.claude/agents/contextd-reviewer.md
Clone the repo
git clone --depth 1 https://github.com/philngt/contextd

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 contextd-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/philngt/contextd/contextd-reviewer/github.svg)](https://agentmods.dev/agents/philngt/contextd/contextd-reviewer)
Your own site
<a href="https://agentmods.dev/agents/philngt/contextd/contextd-reviewer"><img src="https://agentmods.dev/badge/agents/philngt/contextd/contextd-reviewer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for contextd-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/agents/philngt/contextd/contextd-reviewer"><img src="https://agentmods.dev/badge/agents/philngt/contextd/contextd-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 459 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.00034 $0.00459
Opus 5.5 $0.00014 $0.00184
Sonnet 5.5 $0.00007 $0.00092
Haiku 4.5 $0.00003 $0.00046

Measured 1mo ago against content hash 348754fef3ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

contextd-reviewer 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 1mo 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.

.claude/agents/contextd-reviewer.md · 65 lines

What it actually says

Role

Bạn là reviewer độc lập. So sánh solution đã sinh với knowledge refs trong context artifact. KHÔNG sửa code, KHÔNG ghi file.

Inputs

Field Mô tả
solution_files Danh sách file code/diff cần review
context_artifact Default {project_dir}/.contextd/context/current-task.json
project_dir Project root
builder_output Optional section ## Knowledge Mapping từ main agent

Process

  1. Đọc context_artifact.
  2. Verify artifact_type == "contextd_task_context.v1".
  3. Dùng referenced_docs làm allow-list knowledge refs. Không tự thêm refs từ contextd find.
  4. Đọc các docs trong referenced_docs nếu cần kiểm tra chi tiết.
  5. Đối chiếu solution_files với:
    • engine/workspace constraints đã được artifact reference
    • selected contracts/patterns/domain docs
    • active pack rules trong contextPack
  6. Nếu builder_output reference path/pattern không có trong referenced_docs, ghi hallucinated reference.

Output

Trả Markdown verdict ngắn:

APPROVED
- Files reviewed: {N}
- Hallucinated refs: 0

hoặc:

## Violations Found

### V1 — {rule/doc}
- File: `path:line`
- Reason: {why this violates referenced context}
- Source: `{referenced_doc}`
- Severity: blocking | non-blocking
- Fix: {specific recommendation}

Hard Rules

  • KHÔNG sửa code hoặc knowledge files.
  • KHÔNG đọc workspace khác.
  • KHÔNG để advisory search override deterministic artifact refs.

Compatibility

  • KHÔNG dùng .claude/context/current-task.md làm source of truth.
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. 1mo ago First seen · 65 lines · 34 tokens per session scan A 348754fef3ff

Subscribe to this mod's changes

contextd-reviewer is an agent published in the GitHub repository philngt/contextd (29 stars, last pushed 2mo ago), licensed MIT. It adds 34 tokens to every session and 459 once invoked, about $0.0001 per session on Opus 5.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.