Trajectory Memory
БесплатноЗапускает вложенные скриптыНе проверенUse when any research pipeline skill needs project-local JSONL ReAct trajectory memory, reusable prior context from similar projects, or durable…
от yihanghu200467 установок в других каталогахОб этом скилле
Skill: trajectory-memory
This is a cross-cutting companion skill for the research pipeline. It does not replace evidence management. It tells the agent how to use project-local trajectory memory as workflow memory.
Scope
Use this skill whenever a project-stage skill starts, resumes, or finishes a meaningful tool/action step.
The project-local memory files are:
state/projects/<slug>/trajectory_context.md
state/projects/<slug>/trajectory_memory.jsonl
state/projects/<slug>/trajectory_summary.md
trajectory_context.md contains reusable workflow priors retrieved from similar
old projects when the project was initialized.
trajectory_memory.jsonl contains this project's own append-only ReAct trace.
trajectory_summary.md contains compressed project-local workflow memory. It is
generated from trajectory_memory.jsonl and should be read before the raw recent
tail when the JSONL trace grows long.
Hard Rules
- Treat trajectory memory as workflow prior only.
- Never treat trajectory memory as literature evidence.
- Any paper claim, metric, dataset fact, limitation, or citation still requires
an EV record in
evidence.json. - Do not copy old-project conclusions into the new project without current evidence.
- Do not use root-level/global
trajectory_memory.jsonl; memory is project-local. - Do not bulk-load huge JSONL logs. Use
get_recent_context()or stream recent records only. - Treat
trajectory_summary.mdas compressed workflow memory only. It is never a replacement forevidence.json.
Start-Of-Skill Protocol
Before executing a research-stage skill:
- Identify the active
<slug>. - Read
state/projects/<slug>/trajectory_context.mdif it exists. - Read
state/projects/<slug>/trajectory_summary.mdif it exists. - Read the current project's recent trajectory context and log that read as a visible memory step:
python scripts/trajectory_logger.py state/projects/<slug> retrieve \
--requester-phase "<phase>" \
--source trajectory_context.md \
--source trajectory_summary.md \
--source trajectory_memory.jsonl \
--n 5 \
--output both
- Use the retrieved context to avoid repeated failed searches, reuse useful workflow patterns, and preserve known project-specific constraints.
- If the context conflicts with
evidence.json,project.md, or the user's latest instruction, prefer the current project files and user instruction.
The command output contains a MEMORY CHECK CARD. Surface that card in the
interactive reply before running the stage action.
Logging Protocol
After each meaningful action, append one ReAct step:
python scripts/trajectory_logger.py state/projects/<slug> log \
--phase "<phase>" \
--thought "<why this action is needed before execution>" \
--action-name "<tool_or_script_name>" \
--action-param key=value \
--observation "<objective result after execution>" \
--reflection "<optional lesson, retry reason, or next constraint>" \
--output both
The log command also appends a Memory_Store bookkeeping step by default, so
the workspace timeline shows what project memory was stored. Use
--no-store-event only for maintenance scripts that must avoid bookkeeping
noise.
The command output contains a TRAJECTORY ACTION CARD and a MEMORY STORE CARD. Surface both cards in the interactive reply after completing the stage
action.
Use stable phase names such as:
Memory_Retrieve
Memory_Store
S1_ArxivSearch
S2_SemanticScholar
S3_PaperReader
S4_LitReview
S5_ResearchPlanner
S6_ReportWriting
S7_ClaimAudit
S8_PaperReview
S9_ScienceSlides
Project_Init
Session_Restore
For a human-facing view of both research actions and memory IO, run:
python scripts/trajectory_logger.py state/projects/<slug> timeline --n 20
Context Compaction Protocol
When the trajectory JSONL becomes too long for prompt injection, compress old steps into a bounded summary and keep a recent raw tail. This follows the same principle as coding-agent context compaction: durable summary first, recent verbatim context second, raw log preserved for audit.
Run compaction after a long stage, before session handoff, or before using a project as reusable memory for future projects:
python scripts/trajectory_logger.py state/projects/<slug> compact \
--keep-recent 8 \
--max-chars 9000 \
--output both
This writes:
state/projects/<slug>/trajectory_summary.md
and appends a visible Memory_Compact step to trajectory_memory.jsonl.
The command output contains a CONTEXT COMPRESSION CARD. Surface that card in
the interactive reply when compaction is part of the workflow.
For prompt injection after compaction, use:
python scripts/trajectory_logger.py state/projects/<slug> compressed \
--recent-n 5 \
--summary-chars 6000
The compressed context must preserve:
last known state
phase-aware progress
durable decisions
reusable workflow lesso
Установить Trajectory Memory в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Trajectory Memory?
Use when any research pipeline skill needs project-local JSONL ReAct trajectory memory, reusable prior context from similar projects, or durable thought/action/observation/reflection logging. Applies before and after arxiv-search, semantic-scholar, paper-reader, literature-synthesis, research-planner, report-writer, claim-auditor, paper-reviewer, and science-slides.
Как установить скилл Trajectory Memory?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Trajectory Memory запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic