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/commands/README.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/commands/philngt/contextd/readme)<a href="https://agentmods.dev/commands/philngt/contextd/readme"><img src="https://agentmods.dev/badge/commands/philngt/contextd/readme/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/commands/philngt/contextd/readme"><img src="https://agentmods.dev/badge/commands/philngt/contextd/readme.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.00000 | $0.02718 |
| Opus 5.5 | $0.00000 | $0.01087 |
| Sonnet 5.5 | $0.00000 | $0.00544 |
| Haiku 4.5 | $0.00000 | $0.00272 |
Grade A, and why
README 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.
How it starts
The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Slash Commands — Index
Đây là slash commands cho workflow contextd-aware. Trong migration window chúng vẫn cài dưới .claude/commands, nhưng canonical engine/config là contextd CLI + <cwd>/.contextd/config.json. Pipeline kiến trúc tổng thể: agents/pipeline/README.md.
Quy tắc chung:
- Mỗi command có Bước 0 resolve workspace +
knowledge_rootbằng shared resolver trước khi làm bất cứ gì. - Mọi knowledge access scope CHỈ trong workspace active (không cross-workspace).
- Command edit knowledge docs (update-contextd, rebase-contextd, evidence-apply) delegate qua
contextd-curatorsubagent + main agent verify path sau khi curator return.
Workspace setup & navigation
| Command | Purpose | When to use |
|---|---|---|
/contextd-setup |
Bootstrap .contextd/config.json |
Lần đầu tích hợp contextd vào codebase mới, hoặc đổi workspace |
/contextd-detect |
Validate config/workspace + scan dependency để propose update | Sanity check sau khi setup, hoặc khi /use-contextd lỗi resolve |
/switch-workspace {name} |
Đổi workspace field trong config hiện tại, ưu tiên .contextd/config.json |
Khi cùng codebase phục vụ nhiều domain workspace, hoặc khi clone codebase nội bộ |
/new-workspace {name} |
Scaffold workspace mới trong {knowledge_root}/workspaces/{name}/ từ template |
Khi join công ty/dự án mới, cần knowledge sandbox riêng |
/list-workspaces |
In bảng mọi workspace + đánh dấu workspace của codebase hiện tại | Khám phá workspace nào có sẵn trước khi /switch-workspace |
Context Usage (per-task pipeline)
| Command | Purpose | When to use |
|---|---|---|
/use-contextd |
Gọi canonical contextd context để sinh .contextd/context/current-task.json + markdown render + materialized pack |
Trước MỌI task implement_feature / fix_bug / design / incident / review |
/find <keywords> |
Advisory fuzzy discovery patterns + contracts + services + packs — không override artifact deterministic | Quick lookup khi đã biết mình cần gì; trước khi mở /use-contextd đầy đủ |
/update-contextd |
Sync knowledge docs với code đã thay đổi (git diff → curator áp dụng) | Sau khi code merge để knowledge không drift; tự detect engine vs workspace scope |
/rebase-contextd |
Quét knowledge docs vs codebase thực tế để vá mọi chỗ docs nói khác code chạy | Định kỳ (hằng tuần/tháng) hoặc khi nghi knowledge lỗi thời lớn |
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 · 137 lines · 0 tokens per session scan A e90ec34f34fa
README is a command published in the GitHub repository philngt/contextd (29 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,718 tokens. 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 commands, from other repositories
bm
Ask basemind anything about the current codebase — outlines, refs, callers, git history, blame, diffs, docs, memory.
gaai-ask
Search workspace memory — ranked entries with 1-hop graph context (cognitive guarantee).
gaai-bootstrap
Initialize or refresh project context via Bootstrap Agent.
dream
Run a curator pass over the memory dir. Produces a proposal artifact for /dream-apply. Default curator: rot.
vault
Build/refresh a unified Obsidian vault (knowledge + all repo wikis).
moves
Explain the live KMP memory and ChronoLoom moves.