tt
See which docs your AI actually discovers with local, zero-token telemetry. Subcommands; /tt status, /tt watch [demo|replay], /tt insights, /tt instructions, /tt suggestions, /tt badge, /tt gate, /tt note <text>, /tt doctor, /tt setup, /tt uninstall, /tt help.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 16
- Forks
- 1
01 前言 Front Matter
- name
- tt
- arguments
- [ "subcommand", "option" ]
- description
- See which docs your AI actually discovers with local, zero-token telemetry. Subcommands; /tt status, /tt watch [demo|replay], /tt insights, /tt instructions, /tt suggestions, /tt badge, /tt gate, /tt note <text>, /tt doctor, /tt setup, /tt uninstall, /tt help.
- allowed-tools
- Bash, Read, Write, Artifact
- disable-model-invocation
- true
03 SKILL.md 正文
/tt — trigger-tree
Execute the subcommand in $1 (option/text in $2 and beyond; $ARGUMENTS holds everything).
Output discipline — the most important rule: work silently. No plan up front, no intermediate status lines, no explanation of what you are about to do or just did. Execute the steps and show only the end result in the format specified per subcommand below. Report an error in exactly one line.
Terminology — maturity model: a file with zero reads is untouched, never "dead".
Only when the stats JSON reports maturity: "mature" may untouched files be presented
as dead-path candidates. During cold-start and warming the measurement is simply
too young to judge.
Scripts live in ${CLAUDE_PLUGIN_ROOT}/scripts/. Project data lives in
${CLAUDE_PROJECT_DIR}/.trigger-tree/.
$1 = "help" or empty
Show exactly this, nothing above or below it:
🌳 trigger-tree — measures which documentation your agents actually use
Command Does /tt statusSnapshot: current heat, lifetime reads, untouched paths /tt watchLive dashboard; recency colors, heat bars, injected context, privacy settings, and focus/hot/cold/A–Z/Z–A sorting /tt watch demoDashboard with synthetic events (writes nothing) /tt watch replayDashboard replaying the real history, accelerated /tt insightsAnalysis report: heat/cold map, untouched paths, hunting, trend + HTML /tt instructionsPer-directive adherence, observability, and always-loaded cost /tt suggestionsMax 5 prioritized, concrete router fixes — apply after confirmation /tt badgeWrite .trigger-tree/badge.json; immature data publishes onlymeasuring…/tt note <text>Annotate the timeline (e.g. "sharpened UX router") — shows up in the trend /tt doctorVerify hooks, privacy, statusline, and telemetry with actionable fixes /tt setup [truncate|hash|off]Wire the project; choose recognizable previews or privacy-first prompt markers /tt gateDeterministic discoverability score; CI-ready gate with committed baseline /tt uninstallRemove statusline wiring; keep local telemetry for explicit deletion /tt helpThis overview Telemetry runs automatically via hooks; the statusline shows the live session counter.
$1 = "status"
- Silently run
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-stats.py" --client claudeand read the JSON. - Show only this block:
🌳 trigger-tree status (period: <observed_from> → <observed_to>, <sessions> sessions) <reads> reads · <scans> searches · <skill_uses> skill uses · <touched_current_files>/<evaluable_files> current files touched Health: <health.grade> (<health.score>/100) — append "(provisional)" unless maturity is
matureCurrent heat: exclude
state != "current", then sortfilesbyheatdescending and show the top 5 aspath (h<heat>, <reads>× lifetime), comma-separated. Untouched: <count of untouched> — followed by the maturity suffix:
cold-start: "(measurement just started — nothing can be called dead yet)"warming: "(early signal — more sessions needed before judging)"mature: "(dead-path candidates — see /tt insights)"
$1 = "watch"
- Silently run
TT_CLIENT=claude "${CLAUDE_PLUGIN_ROOT}/scripts/tt-open.sh" $2($2empty,demoorreplay). The explicit client marker is required so the detached dashboard can load Claude-specific maintenance tips. - Answer with exactly the confirmation line the script prints (it reports tmux split / new window / used terminal). If the script fails, report the cause in one line (on first use macOS may ask for Automation permission; mention that if the error points to it).
$1 = "insights"
- Silently run
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-stats.py" --client claudeand read the JSON. - If
maturityiscold-start: answer in one line —🌳 Not enough data yet (<reads> reads, <sessions> sessions) — check back after a few working sessions.Stop. - Silently run
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-report.py" --client claude— it writes.trigger-tree/report.htmland prints the path. - Publish that file with the Artifact tool (favicon
🌳, description "trigger-tree documentation telemetry report"). No Artifact tool available → use the local path as the link. - Show only the final report, with a hard maximum of 15 lines:
🌳 trigger-tree insights (period, #sessions, maturity)
Health — grade + score with its three drivers, one line ("(provisional)" unless mature). Key figures — reads, searches, skill uses, touched current files / evaluable files; mention always-loaded files separately so the inventory equation reconciles. Agent personas — when
agents.captureisonandagents.usageis non-empty: name the most and least used persona with counts. Listagents.never_invokedas a review prompt, never a removal recommendation, and say nothing about never-invoked whenagents.never_invoked_statusisawaiting-capture. Whenagents.captureisoffandagents.definedis above zero, say instead that N personas are defined but usage is not being recorded, and that/tt setupenables it; do not imply they are unused. Folder heat/cold map — fromfolders: name the hottest folder by current decayedheat(also state 30-day and lifetime reads) and the least-covered folder, one line each. Cold means inactive now, not obsolete. Untouched paths — whenmature: one line per path with a category — 🗑 remove/merge, 🧭 sharpen router (with a concrete proposal), 📦 intentional archive. Useuntouched_detail: a path with zeroinbound_refsis a router gap (no doc links to it) — that's nearly always 🧭.is_router: trueis an unread router signal, never a template.template: truemay support 📦 but is not a removal verdict. Whenwarming: present as untouched with the note that judgment needs more data; no categories. Trend — only whentrendhas 2+ periods: issearch_ratiofalling or rising, and does that correlate with anynotes(router changes)? Never say a note or edit caused the change. Search activity — only if scans > 20% of reads: usesearch_activityto report the tool mix, sessions/total_sessions, andpattern. A search event is an explicit search in a watched path, not proof of failed routing. Treatconcentratedactivity as possible bulk/research workflow; onlydistributedrecurrence may support a routing hypothesis. Task clusters — top 2-3 fromclusters: "tasks like <example prompt> consistently use <paths>" — flag when a cluster misses an obvious doc. Router proposals — zero to three, never a quota. Use onlyrouter_coverageentries where bothrouterand target already exist and the target is inunlisted. Before presenting a proposal, silently verify against the repository that the router still exists and still does not mention the target. If verification fails or evidence is insufficient, omit it. “No evidence-backed router proposals” is a valid result.📊 Full report: <artifact link or file path>
Analysis rules (do not repeat them in the output): lifetime read counts never decay;
current heat uses the heat_model 30-day half-life and is distinct from untouched;
read counts and heat are signals, not verdicts;
the schema's scan counts are narrow search telemetry and do not establish why a search occurred;
files in always_loaded_inventory are never dead by definition (system-prompt injection);
retired_files are historical evidence and must not appear in current rankings; a file
younger than the measurement period is new, not untouched; subagent reads (the agents
field) count fully; skill uses make .claude/skills/** measurable — an invoked skill's
SKILL.md counts as touched.
$1 = "suggestions"
Silently run python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-suggestions.py" --no-apply-prompt
(fall back to python if needed). The script keeps full stats off stdout and changes
nothing. Its output is tiered: at most five numbered, appliable router edits (each
verified against existing files, with evidence numbers), up to two unnumbered
"Worth a look" observations, and one summary line for low-read but likely-critical
files — and the tool result already shows it to the user, so do not repeat or
reformat the script output. Reply with exactly one line: Apply any of these? Reply with the numbers. when numbered edits exist, otherwise Nothing to apply.
Apply only numbered edits the user explicitly confirms, then suggest recording the
change with /tt note.
$1 = "instructions"
Silently run python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-instructions.py" (fall back
to python if needed), passing through every argument after instructions, including
--init, --selftest, --explain ID, --json, --check, --min-rate N, and --min-measured N. Show the script
output verbatim; do not summarize or reformat it. --init creates or refreshes only a
hash-bound scaffold. Never invent, add, or apply probes without showing the proposed
directive entries and receiving explicit user confirmation. Treat unobserved as missing
evidence, never as a violation; capture-disabled probes are excluded from rates.
$1 = "tips"
Silently run python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-tips.py" --client claude
(fall back to python if needed) and show its concise output verbatim. These are
maintenance recommendations only; do not edit memory or instruction files automatically.
$1 = "badge"
Silently run python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-stats.py" --client claude --badge
and answer with exactly one line: 🌳 Docs-health badge written to <path>. The endpoint
JSON never exposes a provisional letter; before mature measurement it says measuring….
$1 = "note"
- Take everything after the subcommand as the note text. Silently run:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-log.py" note "<text>"(the session id is picked up automatically from CLAUDE_CODE_SESSION_ID, or CLAUDE_SESSION_ID / TT_SESSION_ID when a client or hook sets those instead). - Answer with exactly one line:
🌳 Noted: "<text>" — it will show up in the trend timeline.Empty text →Usage: /tt note <text>in one line.
$1 = "setup"
- If
$2is absent, ask which local prompt mode to use:truncate(recommended; first 200 characters),hash(no prompt text), oroff(marker only). Then runpython3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-setup.py" --prompt-mode "$MODE". If$2is alreadytruncate,hash, oroff, use it without asking. An existing config is preserved only when the script is run without an explicit mode. - Show the script's summary lines verbatim (they report created/updated/skipped per step), nothing else.
$1 = "doctor"
Silently run python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-doctor.py" (fall back to
python if needed). Show its output verbatim. A failed check is a diagnostic result,
not a skill error: still show the complete output.
$1 = "gate"
Silently run python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-gate.py" (fall back to
python if needed), passing through any extra arguments (--update-baseline,
--min-score, --badge). The score, components, and findings are static repository
facts — no telemetry — and the tool result already shows them; do not repeat them.
Reply with exactly one line: Gate passed — score <N>%. or
Gate failed — see the findings above.
$1 = "uninstall"
Silently run python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tt-uninstall.py" and show its
summary verbatim. It removes only trigger-tree's statusline registration and copied
script; .trigger-tree/ telemetry and .gitignore entries remain for explicit deletion.
Any other $1
Answer with exactly one line: Unknown subcommand '$1' — try /tt help.