contextd: Agent for Claude Code

.claude/agents/contextd-curator.md

contextd-curator is an agent for Claude Code from philngt/contextd. It costs 59 tokens per session (1,179 once invoked), scanned A, original, MIT.

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

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

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/philngt/contextd/contextd-curator/github.svg)](https://agentmods.dev/agents/philngt/contextd/contextd-curator)
Your own site
<a href="https://agentmods.dev/agents/philngt/contextd/contextd-curator"><img src="https://agentmods.dev/badge/agents/philngt/contextd/contextd-curator/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-curator

Your own site · 80×15
<a href="https://agentmods.dev/agents/philngt/contextd/contextd-curator"><img src="https://agentmods.dev/badge/agents/philngt/contextd/contextd-curator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00059 $0.01179
Opus 5.5 $0.00024 $0.00472
Sonnet 5.5 $0.00012 $0.00236
Haiku 4.5 $0.00006 $0.00118

Measured 1mo ago against content hash 27b9179c42a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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-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 có ## 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. 1mo 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 2mo ago), licensed MIT. It adds 59 tokens to every session and 1,179 once invoked, about $0.0002 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.

Related

Other agents, from other repositories

gsd-mempalace-curator

Ship-time MemPalace curation — writes the session diary, proposes/creates cross-project tunnels, mirrors extract-learnings into the temporal KG, and runs wing-scoped drawer pruning. Spawned at ship:post by the mempalace capability.

open-gsd/gsd-core · 59 tokens

Plugin Tester

End-to-end plugin testing agent for OpenWebUI. Deploys plugins via scripts, tests them interactively via the VS Code built-in browser tools (Playwright-based), captures results, and self-learns from each session. Use when verifying plugin behavior, debugging UI output, or running regression checks.

Fu-Jie/openwebui-extensions · 63 tokens

Release Prep

Finalizes version bumps, creates standalone version docs, and drafts bilingual commit messages. Only triggered by Orchestrator or Coordinator when user says "发布" / "release" / "commit". Never commits or pushes without explicit approval.

Fu-Jie/openwebui-extensions · 49 tokens

Doc Writer

Handles all documentation for plugin changes in parallel with code implementation. Updates README, READMECN, docs mirrors, and standalone version files.

Fu-Jie/openwebui-extensions · 29 tokens

Plugin Implementer

Implement plugin code changes in parallel with Doc Writer. Follows the approved plan with strict project standards. No sequential handoffs.

Fu-Jie/openwebui-extensions · 29 tokens

context-curator

Curates a minimal deterministic CIGAR context bundle and explains why each included source is relevant.

hashgraph-online/hol-cigar · 23 tokens