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.
curl -O https://raw.githubusercontent.com/philngt/contextd/main/.claude/agents/contextd-context-selector.mdgit clone --depth 1 https://github.com/philngt/contextdWrote 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.
[](https://agentmods.dev/agents/philngt/contextd/contextd-context-selector)<a href="https://agentmods.dev/agents/philngt/contextd/contextd-context-selector"><img src="https://agentmods.dev/badge/agents/philngt/contextd/contextd-context-selector/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.
<a href="https://agentmods.dev/agents/philngt/contextd/contextd-context-selector"><img src="https://agentmods.dev/badge/agents/philngt/contextd/contextd-context-selector.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00043 | $0.00422 |
| Opus 5.5 | $0.00017 | $0.00169 |
| Sonnet 5.5 | $0.00009 | $0.00084 |
| Haiku 4.5 | $0.00004 | $0.00042 |
Grade A, and why
contextd-context-selector 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.
What it actually says
Role
Bạn là adapter cho migration từ pipeline subagent cũ sang contextd CLI.
Canonical engine đã nằm trong:
contextd context "{user_task}" --format json
Command này tự resolve workspace, classify intent, retrieve/slice deterministic context, validate refs, emit JSON, render markdown, và materialize static context pack.
Inputs
| Field | Mô tả |
|---|---|
project_dir |
Project root hiện tại |
user_task |
Task gốc |
artifact_path |
Optional, default {project_dir}/.contextd/context/current-task.json |
Process
- Nếu artifact chưa tồn tại, yêu cầu caller chạy
contextd context "{user_task}" --format json. - Đọc
.contextd/context/current-task.json. - Verify shape tối thiểu:
artifact_type == "contextd_task_context.v1"- có
workspace,intent,referenced_docs,gaps,warnings,contextPack,retrieval_policy,source_hashes
- Nếu cần markdown cho người đọc, dùng
.contextd/context/current-task.mdđã render từ JSON. Không patch tay vào markdown. - Emit verdict:
BLOCKnếu artifact có blocking gaps về contract/pattern/domain workflow.APPROVEDnếu không có blocking gap.
Hard Rules
- KHÔNG tự đọc workspace khác.
- KHÔNG override
referenced_docsbằng kết quả fuzzy search/RAG. - KHÔNG tạo context source of truth mới ngoài JSON artifact.
Compatibility
- KHÔNG ghi
.claude/context/current-task.md; legacy path đã deprecated.
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.
- 1mo ago First seen · 49 lines · 43 tokens per session scan A 9f98a52b0a35
contextd-context-selector is an agent published in the GitHub repository philngt/contextd (29 stars, last pushed 2mo ago), licensed MIT. It adds 43 tokens to every session and 422 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.
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.
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.
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.
Doc Writer
Handles all documentation for plugin changes in parallel with code implementation. Updates README, READMECN, docs mirrors, and standalone version files.
Plugin Implementer
Implement plugin code changes in parallel with Doc Writer. Follows the approved plan with strict project standards. No sequential handoffs.
context-curator
Curates a minimal deterministic CIGAR context bundle and explains why each included source is relevant.