john-walks-slow/dsh-clear-mind ↗★ 0

dsh-clear-mind

自主上下文压缩与检查点替换工具 适合需要自动清理冗余上下文、防止超出模型窗口限制的长对话任务。

套件
dsh-clear-mind
相容性
待驗證
版本
0.1.0
授權
MIT
最近更新
2026年9月17日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:john-walks-slow/dsh-clear-mind

配置(可选)

- id: clear-mind
  name: dsh-clear-mind
  config:
    minClearTokens: 1000        # 最小可清理量(启发式 tokens),防琐碎清理
    minNotesChars: 200          # 检查点 notes 最短长度
    maxNotesChars: 16000        # 检查点 notes 最长长度
    selfCollapse: true          # 自动折叠 clear_mind / mind_map 调用对
    reminderEnabled: true       # 主动提醒开关
    reminderThresholdRatio: 0.70   # 上下文占模型窗口比例阈值(0.01~1)
    reminderThresholdTokens: 0     # 绝对 token 阈值(0 = 仅按比例)
    reminderThresholdSteps: 100    # 单轮步数阈值
    reminderStepInterval: 25       # 同一轮两次提醒的最小步数间隔

Web 前端可在设置页直接编辑以上全部参数(命名空间 clear-mind),保存即热生效,无需重启;headless profile 无设置服务时自动降级为仅配置文件生效。提醒触发还要求 token 数较上次提醒有增长——静止的会话不会重复打扰。