Claude Code 更新插件后 /planning-with-files 报 “template files not found in cache“ 怎么解决?
2026/9/13 2:11:13 网站建设 项目流程

Claude Code 更新插件后 /planning-with-files 报 "template files not found in cache" 怎么解决?

【免费下载链接】planning-with-filesPersistent file-based planning for AI coding agents and long-running tasks. Crash-proof markdown plans, session recovery after /clear and compaction, per-turn re-injection against context rot, deterministic completion gate. Manus-style. Install from npm, the Claude Code plugin marketplace, or npx skills. Codex, Cursor, OpenCode, 60+ agents.项目地址: https://gitcode.com/GitHub_Trending/pl/planning-with-files

在 Claude Code 中以插件方式安装了 planning-with-files,执行/plugin update planning-with-files@planning-with-files升级到新版本后,再调用/planning-with-files时报出template files not found in cache或类似的模板缺失错误。这是 docs/troubleshooting.md 收录的已知问题:Claude Code 会缓存插件文件,更新后缓存可能没有正确刷新,导致插件仍然从旧缓存里找模板。按照下面的步骤做干净重装并重启 Claude Code,即可恢复。

先确认安装状态,别直接改缓存

处理之前,先用 Claude Code 自带的插件命令确认当前装了什么版本、包含哪些组件:

claude plugin list claude plugin details

文档同时指出:Claude Code 把已安装的插件文件放在~/.claude/plugins/cache/目录下统一管理,不要直接编辑缓存中的那份副本(docs/troubleshooting.md)。缓存里内容不对时的正确做法是下面这一步的整体重装,而不是手动往缓存目录里补文件。

干净重装(官方推荐解法)

在 Claude Code 会话中按顺序执行以下三条命令:先卸载、重新添加 marketplace、再安装:

/plugin uninstall planning-with-files@planning-with-files /plugin marketplace add OthmanAdi/planning-with-files /plugin install planning-with-files@planning-with-files

这三条命令与 docs/installation.md 中的标准插件安装流程一致,区别只是前面多了一步卸载,用以确保旧缓存被清掉。

重装完成后必须完全退出并重启 Claude Code,再重新进入会话测试。文档明确写了 "Restart Claude Code completely after reinstalling",只重开会话而不重启客户端,缓存可能仍未刷新。

为什么更新后会出这个问题

CHANGELOG.md 记录了这个问题的来龙去脉,也解释了为什么"更新 + 重装"能治本:

  • v2.1.1 修复了插件市场安装时找不到模板的问题,因为插件缓存期望在仓库根目录有planning-with-files/templates/
  • v2.1.2 进一步修复了根因:${CLAUDE_PLUGIN_ROOT}解析到仓库根目录,但模板当时只放在子目录里。修复方式是同时在仓库根层级添加templates/scripts/目录,使模板无论CLAUDE_PLUGIN_ROOT如何解析都能被找到。

修复后模板存在于三处位置:

位置服务对象
templates/(仓库根)${CLAUDE_PLUGIN_ROOT}/templates/的直接引用
planning-with-files/templates/插件市场安装
skills/planning-with-files/templates/旧的~/.claude/skills/手动安装

也就是说,只要重装拉到的版本包含根级templates/(v2.1.2 及以后),缓存重建后路径就能对上。这也是文档建议"干净重装"而不是其他操作的原因。

重装后如何验证

按 docs/installation.md 的验证流程确认插件恢复正常:

  1. 运行claude plugin list,在/plugin/hooks中检查该插件,确认安装状态正常;
  2. 在一个有活跃 plan 的项目里启动新会话,确认 planning 上下文能被恢复;
  3. 在没有活跃 plan 的项目里,启动时预期没有提示消息(这是设计行为,不代表异常);
  4. 再次执行/planning-with-files,确认不再出现template files not found in cache错误。

如果之前是通过npx skills add或手动拷贝到~/.claude/skills/安装的独立 skill 而非插件,/plugin系列命令不适用,这条错误本身也是插件缓存路径特有的问题——这类安装请参考 docs/installation.md 中对应路线的更新方式(进入~/.claude/skills/planning-with-files目录执行git pull origin master)。

仍然报错时

如果干净重装并完全重启后依旧报错,docs/troubleshooting.md 给出的兜底路径是提交 issue,并附带:

  • Claude Code 版本(claude --version输出);
  • 操作系统;
  • 执行的命令;
  • 实际现象与预期结果的差异;
  • 完整的报错信息。

这样维护者能基于版本和安装路线定位是缓存刷新问题还是新版本本身的回归。

【免费下载链接】planning-with-filesPersistent file-based planning for AI coding agents and long-running tasks. Crash-proof markdown plans, session recovery after /clear and compaction, per-turn re-injection against context rot, deterministic completion gate. Manus-style. Install from npm, the Claude Code plugin marketplace, or npx skills. Codex, Cursor, OpenCode, 60+ agents.项目地址: https://gitcode.com/GitHub_Trending/pl/planning-with-files

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询