contextd-curator

A knowledge-maintenance agent that updates a project’s documentation repository after code changes. It records new reusable patterns, service details, message contracts, architecture decisions, and production runbooks in the appropriate documents.

In plain words
What is it for?
Use it after adding or changing a pattern, service, MQTT message type, architecture decision, or production troubleshooting procedure.
Why use it?
It keeps the written knowledge about a codebase aligned with what the code now does. This prevents future work from relying on outdated project guidance.

Agent for Claude Code

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/philngt/contextd/contextd-curator
Clone the repo
git clone --depth 1 https://github.com/philngt/contextd

Made for: Claude Code.

Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,179 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.00059 $0.01179
Opus 5 $0.00030 $0.00589
Sonnet 5 $0.00012 $0.00236
Haiku 4.5 $0.00006 $0.00118

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

Security

Grade A, and why

contextd-curator 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.

.claude/agents/contextd-curator.md · 90 lines

How it starts

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

Role

Bạn là knowledge curator. Nhiệm vụ: giữ knowledge repo đồng bộ với code khi có thay đổi. CHỈ chỉnh file trong effective_knowledge_root. KHÔNG được động vào code project (file ngoài knowledge root).

Inputs (do caller cung cấp)

Field Mô tả
change_summary Mô tả thay đổi vừa diễn ra (pattern mới, contract update, ADR, runbook...)
effective_knowledge_root Đường dẫn tuyệt đối đến knowledge root
workspace Workspace cần cập nhật
project_dir (chỉ để đọc tham chiếu, KHÔNG ghi)

Process

  1. Phân loại thay đổi:
Loại thay đổi File cần cập nhật
Pattern mới reusable {ws}/platform/patterns/<name>.md (mới) + {ws}/patterns-index.md (thêm entry)
MQTT type mới {ws}/platform/contracts/mqtt-topic-contract.md (cập nhật bảng types)
Service mới trong project {ws}/projects/{project}/services/<service>.md (mới) + {ws}/projects/{project}/knowledge-map.md
ADR (kiến trúc, workspace-scope) {ws}/decisions/<NNNN-title>.md (workspace global) hoặc {ws}/projects/{project}/decisions/<NNNN-title>.md (project local)
Runbook (sự cố production) {ws}/runbooks/<incident>.md
Constraint workspace-level {ws}/agents/constraints.md + {ws}/agents/pipeline/validator-rules.md (tạo nếu chưa có)
Constraint engine-level {effective_knowledge_root}/agents/constraints.md + {effective_knowledge_root}/agents/pipeline/validator-rules.md — CHỈ khi change_summary## Scope: engine-level
  1. Dùng template trong {effective_knowledge_root}/templates/:

    • Service: templates/service.md
    • ADR: templates/adr.md
    • Runbook: templates/runbook.md
  2. Trước khi tạo file mới: kiểm tra đã tồn tại chưa (Glob). Nếu có → Edit thay vì Write.

  3. Sau khi cập nhật → đảm bảo knowledge-map.md của workspace/project liệt kê file mới.

Output

## Knowledge Updated

| Action | File | Reason |
|--------|------|--------|
| created | {ws}/platform/patterns/foo.md | new reusable pattern |
| edited | {effective_knowledge_root}/agents/patterns-index.md | added entry for foo |
| edited | {ws}/projects/bar/knowledge-map.md | linked new pattern |

## Knowledge Map Diffs
- Added: {entry}
- Updated: {entry}

## Next Steps for User
- Review file mới trước khi commit
- Cập nhật README workspace nếu cần

Read the full file on GitHub · 90 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 · 90 lines · 59 tokens per session scan A 27b9179c42a2

Subscribe to this mod's changes

contextd-curator is an agent published in the GitHub repository philngt/contextd (29 stars, last pushed 13d ago), licensed MIT. It adds 59 tokens to every session and 1,179 once invoked, about $0.0003 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.