360 Secure SkillHub
360 安全技能中心

session-memory-context

围绕 /new 会话重置管理本地记忆文件夹:完整会话记录存入 new-recent/(上限 10 条),旧会话压缩为带日期的简短摘要移入 old-sessions/,用户标记内容移入 permanent/ 或 temporary-priority/,并按指令删除指定条目。

memeyxdr
memeyxdr
热度 20.10
最近更新 2026-04-13 08:46:53
分类:知识依赖:读写文件应用场景:笔记整理 / 摘要总结 / 工作流 / 任务管理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add session-memory-context
Metadata
name
session-memory-context
description
Automatically manages session memory across `/new` resets. Saves full session notes to `new-recent/` (max 10), compresses older ones to `old-sessions/` as short dated summaries, moves user-flagged "remember this" items to `permanent/`, and handles "do you remember this" pins in `temporary-priority/`. Deletes old irrelevant sessions and respects "forget X" commands. Triggered by `/new` resets and any memory management request.

Session Memory Context

Folder Structure

session-memory-context/
├── new-recent/          # Latest 10 sessions, full detail
├── old-sessions/        # Short dated summaries of older sessions
├── permanent/           # User-flagged "remember this" items (no limit)
└── temporary-priority/  # "Do you remember this" pins (no limit, auto-release)

Core Behavior

On /new — Save Current Session

  1. If new-recent/ has ≥10 files, compress the oldest into old-sessions/ as a short dated summary before saving new session.
  2. Save full session notes to new-recent/ with timestamp filename (e.g., 2026-04-12-2000.md).

On "remember this" (or similar)

  1. Move the relevant session file from new-recent/ into permanent/.
  2. Release that slot so the 10-session limit stays at 10 — do not expand to 11.

On "do you remember this" (or similar)

  1. Move the relevant session from new-recent/ or old-sessions/ into temporary-priority/.
  2. Treat as short-term priority, loaded when user asks to remember.

Temporary-Priority Rules

  • Keep items in temporary-priority/ only while user is actively asking about them.
  • If user has NOT asked about that session in the last 10 sessions, move it back to old-sessions/ and stop treating it as priority.

Permanent Memory Rules

  • Sessions in permanent/ are kept forever unless user says "forget X" or "forget this" for that item.
  • On "forget X"/"forget this": immediately delete that specific item from permanent/.
  • Never delete or modify anything outside the skill's own memory folders.
  • If unsure which file to delete, stop and ask for confirmation.

Deletion Rules

  • Only delete from old-sessions/ if: session is very old AND user has never asked to remember it.
  • Never remove newer sessions when compressing or deleting older ones.
  • Respect explicit user commands like "forget this" or "clear old sessions" — delete oldest/least relevant first.

Auto-Context Loading

  • When user asks anything related to a session in permanent/, automatically read relevant permanent files as context.
  • When a message is clearly related to a session in new-recent/, automatically read matching new-recent/ sessions as context.
  • In both cases, keep loaded context short and focused — only the parts directly relevant to current topic.

One-Off Queries

  • Short checks like "what is the system status" or other trivial queries are NOT saved to permanent/ once the 10-session limit is active.
  • Only save memorable/relevant sessions.

Session File Format

Save as .md files. Filename pattern: YYYY-MM-DD-HHmm.md (e.g., 2026-04-12-2000.md).

Session files should contain:

  • Timestamp
  • Brief summary of what happened
  • Key decisions, preferences, or context the user shared
  • Anything worth remembering long-term

Compressing to Old-Sessions

When moving from new-recent/ to old-sessions/, create a very short summary:

YYYY-MM-DD — [1-2 line summary of what happened]

Keep it minimal. These are just enough context to recognize if user asks to remember something later.