trajectory-garden
One repeatable gardening pass over a trajectory corpus — the JSONL of per-turn Turn rows a fak trajectory.Recorder exports. Uses the `fak traj` toolkit (the…
от anthony-chaudhary★ 50 звёзд на GitHub
Установить trajectory-garden в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
trajectory-garden — find the bad/redundant trajectories, propose the prune, never delete
What this does. An agent that records its trajectories accumulates two kinds of cruft: redundant work (the same question asked five different ways) and bad trajectories (a loop the kernel kept refusing, a turn that burned a huge context budget). Left ungardened, both rot a memory store — the redundancy inflates retrieval cost, the bad trajectories poison few-shot recall. This pass turns "the memory feels messy" into a concrete, sourced work-list: the exact turns to look at, ranked worst-first, with a proposed prune you approve before anything is removed.
The shape: export/locate the corpus → score it with the reference scorers →
read the findings worst-first → propose prunes (fak traj gc) → hand the operator
the prune list to approve. Nothing here deletes a user's trajectory data — fak
ships the observability, the gardening decision stays with you.
This skill is also the reference application of fak's trajectory primitives
(internal/simhash, internal/trajectory, internal/trajhook, the fak traj
verbs). If you want a different analysis — a semantic-embedding dedupe, a
per-tool cost report, a regression detector over two corpora — fork the steps
below and swap the scorer. That swap is the whole point: fak gives you the data
and the seam, you write the policy.
The one rule that overrides everything: PROPOSE, never delete
fak traj gc emits prune candidates. This skill surfaces them and stops. The
operator (or a downstream store with its own retention policy) decides what to
actually remove. fak never deletes trajectory data, and neither does this pass —
a wrong auto-prune is unrecoverable, and the cost of a missed prune is just a
slightly larger corpus. Always err toward keeping.
What a "corpus" is
A trajectory corpus is the JSONL a trajectory.Recorder exports — one
trajectory.Turn per line (trace id, seq, query, tool, verdict, reason, taint,
token/byte cost, optional simhash embedding). Three ways one exists:
- A live fak kernel with recording enabled (
FAK_TRAJECTORY=1, andFAK_TRAJECTORY_EMBED=1to stamp query vectors): the recorder folds the adjudication stream into Turn rows, exportable via the gateway / a front door. - An offline run that drove a
trajectory.Recorderand calledExportTo. - The shipped demo —
examples/trajectory/sample-corpus.jsonl— to dry-run the verbs with no live kernel.
If no corpus exists yet, say so and point the operator at enabling
FAK_TRAJECTORY; do not fabricate one.
The pass, step by step
Run from the repo root. Replace CORPUS with the corpus path (use the shipped
demo to rehearse).
CORPUS=examples/trajectory/sample-corpus.jsonl
# 1. Score the whole corpus with the three reference scorers, worst-first.
go run ./cmd/fak traj score --corpus "$CORPUS"
# 2. Look up whether a specific NEW query is redundant with past work.
go run ./cmd/fak traj similar --corpus "$CORPUS" --query "look up the refund policy" --k 5
# 3. Map the redundancy: cluster near-duplicate queries.
go run ./cmd/fak traj cluster --corpus "$CORPUS"
# 4. Propose prune candidates (later near-duplicates). JSON for a downstream store.
go run ./cmd/fak traj gc --corpus "$CORPUS" --json
score is the headline. It runs three reference scorers and lists findings
worst-first:
| label | what it flags | act on it by |
|---|---|---|
duplicate_query |
a turn whose query near-duplicates an EARLIER one (simhash) | prune the later one, or cache the result |
cost_outlier |
a turn in the expensive tail of the token distribution | investigate why it was so big; compress its inputs |
high_deny_rate |
a TRACE the kernel refused on ≥50% of turns | read the trace — a confused or adversarial loop |
Read the findings, then decide
For each finding worth acting on:
duplicate_query→ the later turn is redundant. If its result is cached, the future ask is a free hit; if not, it is a prune candidate.fak traj gclists exactly these, each with the earlier turn it duplicates (keep) and the cosine. Hand the operator theprunekeys; do not remove them yourself.cost_outlier→ not cruft, a signal. A 9800-token turn is where the context budget went. Surface it; the fix is usually upstream (compress the tool output, page out the raw evidence) not a prune.high_deny_rate→ a trajectory the kernel kept refusing. Read the trace's queries. A tight cluster of destructive variants ("delete rows" / "drop records" / "truncate") is an agent fighting the policy floor — worth a human look, never an auto-prune.
Know the primitive's ceiling (and when to swap it out)
simhash is a **re
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл trajectory-garden?
One repeatable gardening pass over a trajectory corpus — the JSONL of per-turn Turn rows a fak trajectory.Recorder exports. Uses the `fak traj` toolkit (the data plane + the simhash reference vector-similarity primitive + the pluggable scorer seam) to find the trajectories worth a human's attention — near-duplicate queries the lexical ranker misses, cost outliers, and traces the kernel kept refusing — then PROPOSES prune candidates (it never deletes). The reference application of fak's trajectory observability primitives: proof that a. Use when this named workflow matches the task.
Как установить скилл trajectory-garden?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл trajectory-garden запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…