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.
npx agentmods add commands/open-latch/latch/latch-treegit clone --depth 1 https://github.com/open-latch/latchWhat 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 | $0.00012 | $0.00516 |
| Opus 5 | $0.00006 | $0.00258 |
| Sonnet 5 | $0.00002 | $0.00103 |
| Haiku 4.5 | $0.00001 | $0.00052 |
Grade A, and why
latch-tree 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.
What it actually says
Full rebuild of the RAPTOR-style tree for the per-project knowledge base
under <KB_HOME>. One pass:
- Retire prior summaries — all existing
depth > 0nodes are markedstale(audit trail preserved, excluded from retrieval). Their children'sparent_idis cleared. - Landmarks — leaf nodes with
ref_count >= 5are preserved as-is: they stay atdepth=0withparent_id=NULL. Frequently-consulted knowledge sits alongside summaries rather than being absorbed. - Cluster the rest — bounded average-linkage (UPGMA) agglomerative
clustering on cosine similarity (default threshold
0.65, max cluster size 40). Average-linkage merges only on mean pairwise similarity, so a single bridge edge can't chain unrelated topics into one mega-cluster (the single-link percolation collapse; KB id=1529/id=1560). Single-link remains available as a non-defaultlinkage="single"fallback. Clusters with >= 3 members earn one LLM-generated summary node (kind='summary',status='canonical',depth=1). Members'parent_idis set to the summary. - Singletons and sub-minimum clusters stay at
depth=0withparent_id=NULL.
Each summary LLM call uses the selected maintenance model backend (Claude by
default; adapter env can select Codex) and counts against the daily budget. If
the cap is hit mid-run, the remaining clusters are left without summaries this
cycle — report that via budget_blocked.
Run with the Bash tool:
python "<KB_HOME>/src/maintenance.py" tree "$(pwd)"
Report the JSON summary: linkage, leaves, landmarks, clusters,
largest_cluster, p95_cluster_size, summaries_generated, singletons,
oversized_skipped, budget_blocked, llm_failed, prior_summaries_staled.
Retrieval is unchanged — summary nodes live in the same FTS+vector pool as
leaves (collapsed-tree search). If anything fails, check
<KB_HOME>/maintenance.log and tree.log.
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.
- 2d ago First seen · 43 lines · 12 tokens per session scan A 0bc32d30c306
latch-tree is a command published in the GitHub repository open-latch/latch (9 stars, last pushed 2d ago), licensed Apache-2.0. It adds 12 tokens to every session and 516 once invoked, about $0.0001 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-31.
Other commands, from other repositories
ctx
Search agent history or trace code to its original agent session.
add-agent
引导新增一个 Agent 适配器。用法 /add-agent.
check
跑全套本地校验(前端 lint/test/build + Rust check)。.
handoff-export
Read .claude/skills/handoff/SKILL.md completely and dispatch its export workflow. Use any supplied command arguments only as the requested bundle path; preserve the skill's sourceagent, direct checks, optional verification, and safety boundaries.
handoff
Export a Waybill Bundle by default, or import one when requested.
waybill
Alias that exports by default or imports when requested.