Crinstaniev/dsh-experience-index ↗★ 0
dsh-experience-index
Signpost experience files left by earlier agent sessions, so a new DeepSeek Harness session knows what already exists. 适合希望新会话能自动感知并继承前序会话工作区经验的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Crinstaniev/dsh-experience-index使用
安装:
git clone https://github.com/Crinstaniev/dsh-experience-index.git
cd dsh-experience-index
npm install
npm run build
dsh plugin --profile desktop add link:/absolute/path/to/dsh-experience-index
lib/ 是构建产物,不随仓库提交,所以安装前必须先 build。装好后重启 DSH。
入口
有三个:
- 输入框右侧的指南针按钮 —— 弹出汇总面板:目录数、条目数、过期数、当前目录状态,可一键建立/重建索引。面板按当前会话解析目录,切换对话会跟着切换
- Settings → Experience Index —— 顶层设置页,管理所有 scope
- 聊天里输入
/experience—— 直接为当前目录建立索引;也可以/experience /path/to/dir
/experience 默认作用于会话当前工作目录,返回一行结果:
Indexed /path/to/services/api — 45 files · runbook 2 · log 42.
The next session in this directory receives the signpost.
设置页里可以:
- 当前目录:显示会话所在工作区的索引状态,
建立索引/重建索引 - 为任意目录建立索引:输入绝对路径,可直接索引子项目或非 git 目录
- 已索引目录:条目数、分类分布、索引时间、是否可能过期;可
条目/排除/移除 - 排除后,本机所有会话都不再注入该 scope 的路标;移除只删数据库记录,不动磁盘
嵌套目录可以各自索引,会话里只有最深的那个生效。
配置
在 profile 的 cordis.patch.yml 里覆盖:
- id: dsh-experience-index
name: dsh-experience-index
config:
legacyMaxDepth: 3
smallCategoryLimit: 6
signpostMaxBytes: 2048
| 字段 | 默认值 | 含义 |
|---|---|---|
sources | 见 src/config.ts | {glob, category} allowlist |
countOnlyCategories | ['log','state'] | 只计数、不逐条列出的类别 |
legacyRootNames | ['.codex','.comate','.claude','.agents'] | 视为"游离经验根"的目录名 |
legacyMaxDepth | 3 | 在 scope 之下搜索这些目录的深度 |
maxLegacyRoots | 32 | 单个 scope 最多发现的游离根数量 |
smallCategoryLimit | 6 | 超过则折叠成目录 + 数量 |
maxTitleChars | 96 | 一句话说明的最大长度 |
headBytes | 4096 | 每个文件读取的头部字节数 |
signpostMaxBytes | 2048 | 注入路标的字节预算 |
hintRepeatDays | 7 | 同一目录"未索引"提示的最小间隔 |
repoRootMarkers | ['.git'] | 判定所属仓库与 worktree 的标记 |
忽略规则(落盘)
.dsh/experience-ignore,放在 scope 目录下,随仓库提交,gitignore 子集语义:
.codex/tmux-remote-logs/**
.codex/tmp/**
.codex/analysis/fire_smoke_e31_vs_e30_20260621.md
!keep-me.md
规则文件本身参与过期判定:改了规则 → 索引标记为可能过期。
全局版本为 $DSH_HOME/experience-ignore,项目文件优先级更高。