Skip to content

[BUG] Local plugin cache not invalidated when source files change #28492

@wkusnierczyk

Description

@wkusnierczyk

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Summary

Claude Code caches local plugin files under ~/.claude/plugins/cache/ keyed by plugin name and version. When developing a local plugin, editing source files (commands, agents, skills) has no effect — the stale cached copy is served until the version in plugin.json is bumped or the cache is manually deleted.

What Should Happen?

Expected behavior

The command should reflect the updated file content ("Hello v2").

Actual behavior

The command still runs the old content ("Hello v1"). The cached copy at ~/.claude/plugins/cache/local-plugins/{name}/0.1.0/commands/my-command.md is served instead of the source file.

Workarounds

  • Bump the version in .claude-plugin/plugin.json after every edit
  • Or delete the cache: rm -rf ~/.claude/plugins/cache/local-plugins/{plugin-name}

Suggested fix

For local plugins (those loaded from ~/.claude/my-plugins/ or similar local paths), invalidate the cache when source file modification timestamps are newer than the cached copies. Version-only caching makes sense for published/marketplace plugins, but local development needs source-change detection.

Error Messages/Logs

Steps to Reproduce

Steps to reproduce

  1. Create a local plugin with a command file, e.g. commands/my-command.md with body "Hello v1"
  2. Set plugin.json version to "0.1.0"
  3. Start a Claude Code session — invoke the command, confirm it works
  4. Edit commands/my-command.md to say "Hello v2"
  5. Restart the Claude Code session
  6. Invoke the command again

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.56 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions