fix: remove destructive cache-clear instruction from CLAUDE.md #146
31
CLAUDE.md
31
CLAUDE.md
@@ -31,11 +31,16 @@ This file provides guidance to Claude Code when working with code in this reposi
|
|||||||
- If user asks for output, show the OUTPUT
|
- If user asks for output, show the OUTPUT
|
||||||
- **Don't interpret or summarize unless asked**
|
- **Don't interpret or summarize unless asked**
|
||||||
|
|
||||||
### 5. AFTER PLUGIN UPDATES - ALWAYS CLEAR CACHE
|
### 5. AFTER PLUGIN UPDATES - VERIFY AND RESTART
|
||||||
```bash
|
|
||||||
rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/
|
**⚠️ DO NOT clear cache mid-session** - this breaks MCP tools that are already loaded.
|
||||||
./scripts/verify-hooks.sh
|
|
||||||
```
|
1. Run `./scripts/verify-hooks.sh` to check hook types
|
||||||
|
2. If changes affect MCP servers or hooks, inform the user:
|
||||||
|
> "Plugin changes require a session restart to take effect. Please restart Claude Code."
|
||||||
|
3. Cache clearing is ONLY safe **before** starting a new session (not during)
|
||||||
|
|
||||||
|
See `docs/DEBUGGING-CHECKLIST.md` for details on cache timing.
|
||||||
|
|
||||||
**FAILURE TO FOLLOW THESE RULES = WASTED USER TIME = UNACCEPTABLE**
|
**FAILURE TO FOLLOW THESE RULES = WASTED USER TIME = UNACCEPTABLE**
|
||||||
|
|
||||||
@@ -125,7 +130,9 @@ leo-claude-mktplace/
|
|||||||
│ └── project-hygiene/
|
│ └── project-hygiene/
|
||||||
├── scripts/
|
├── scripts/
|
||||||
│ ├── setup.sh, post-update.sh
|
│ ├── setup.sh, post-update.sh
|
||||||
│ └── validate-marketplace.sh # Marketplace compliance validation
|
│ ├── validate-marketplace.sh # Marketplace compliance validation
|
||||||
|
│ ├── verify-hooks.sh # Verify all hooks are command type
|
||||||
|
│ └── check-venv.sh # Check MCP server venvs exist
|
||||||
└── docs/
|
└── docs/
|
||||||
├── CANONICAL-PATHS.md # Single source of truth for paths
|
├── CANONICAL-PATHS.md # Single source of truth for paths
|
||||||
└── CONFIGURATION.md # Centralized configuration guide
|
└── CONFIGURATION.md # Centralized configuration guide
|
||||||
@@ -172,12 +179,12 @@ leo-claude-mktplace/
|
|||||||
|
|
||||||
| Category | Tools |
|
| Category | Tools |
|
||||||
|----------|-------|
|
|----------|-------|
|
||||||
| Issues | `list_issues`, `get_issue`, `create_issue`, `update_issue`, `add_comment` |
|
| Issues | `list_issues`, `get_issue`, `create_issue`, `update_issue`, `add_comment`, `aggregate_issues` |
|
||||||
| Labels | `get_labels`, `suggest_labels`, `create_label` |
|
| Labels | `get_labels`, `suggest_labels`, `create_label`, `create_label_smart` |
|
||||||
| Milestones | `list_milestones`, `get_milestone`, `create_milestone`, `update_milestone` |
|
| Milestones | `list_milestones`, `get_milestone`, `create_milestone`, `update_milestone`, `delete_milestone` |
|
||||||
| Dependencies | `list_issue_dependencies`, `create_issue_dependency`, `get_execution_order` |
|
| Dependencies | `list_issue_dependencies`, `create_issue_dependency`, `remove_issue_dependency`, `get_execution_order` |
|
||||||
| Wiki | `list_wiki_pages`, `get_wiki_page`, `create_wiki_page`, `create_lesson`, `search_lessons` |
|
| Wiki | `list_wiki_pages`, `get_wiki_page`, `create_wiki_page`, `update_wiki_page`, `create_lesson`, `search_lessons` |
|
||||||
| **Pull Requests** | `list_pull_requests`, `get_pull_request`, `get_pr_diff`, `get_pr_comments`, `create_pr_review`, `add_pr_comment` *(NEW v3.0.0)* |
|
| **Pull Requests** | `list_pull_requests`, `get_pull_request`, `get_pr_diff`, `get_pr_comments`, `create_pr_review`, `add_pr_comment` |
|
||||||
| Validation | `validate_repo_org`, `get_branch_protection` |
|
| Validation | `validate_repo_org`, `get_branch_protection` |
|
||||||
|
|
||||||
### Hybrid Configuration
|
### Hybrid Configuration
|
||||||
|
|||||||
@@ -197,6 +197,51 @@ echo -e "\n=== Config Files ==="
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Cache Clearing: When It's Safe vs Destructive
|
||||||
|
|
||||||
|
**⚠️ CRITICAL: Never clear plugin cache mid-session.**
|
||||||
|
|
||||||
|
### Why Cache Clearing Breaks MCP Tools
|
||||||
|
|
||||||
|
When Claude Code starts a session:
|
||||||
|
1. MCP tools are loaded from the cache directory
|
||||||
|
2. Tool definitions include **absolute paths** to the venv (e.g., `~/.claude/plugins/cache/.../venv/`)
|
||||||
|
3. These paths are cached in the session memory
|
||||||
|
4. Deleting the cache removes the venv, but the session still references the old paths
|
||||||
|
5. Any MCP tool making HTTP requests fails with TLS certificate errors
|
||||||
|
|
||||||
|
### When Cache Clearing is SAFE
|
||||||
|
|
||||||
|
| Scenario | Safe? | Action |
|
||||||
|
|----------|-------|--------|
|
||||||
|
| Before starting Claude Code | ✅ Yes | Clear cache, then start session |
|
||||||
|
| Between sessions | ✅ Yes | Clear cache after `/exit`, before next session |
|
||||||
|
| During a session | ❌ NO | Never - will break MCP tools |
|
||||||
|
| After plugin source edits | ❌ NO | Restart session instead |
|
||||||
|
|
||||||
|
### Recovery: MCP Tools Broken Mid-Session
|
||||||
|
|
||||||
|
If you accidentally cleared cache during a session and MCP tools fail:
|
||||||
|
|
||||||
|
```
|
||||||
|
Error: Could not find a suitable TLS CA certificate bundle, invalid path:
|
||||||
|
/home/.../.claude/plugins/cache/.../certifi/cacert.pem
|
||||||
|
```
|
||||||
|
|
||||||
|
**Fix:**
|
||||||
|
1. Exit the current session (`/exit` or Ctrl+C)
|
||||||
|
2. Start a new Claude Code session
|
||||||
|
3. MCP tools will reload from the reinstalled cache
|
||||||
|
|
||||||
|
### Correct Workflow for Plugin Development
|
||||||
|
|
||||||
|
1. Make changes to plugin source files
|
||||||
|
2. Run `./scripts/verify-hooks.sh` (verifies hook types)
|
||||||
|
3. Tell user: "Please restart Claude Code for changes to take effect"
|
||||||
|
4. **Do NOT clear cache** - session restart handles reloading
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Automated Diagnostics
|
## Automated Diagnostics
|
||||||
|
|
||||||
Use these commands for automated checking:
|
Use these commands for automated checking:
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ for f in $(find ~/.claude -name "hooks.json" 2>/dev/null); do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check cache specifically
|
# Note about cache (informational only - do NOT clear mid-session)
|
||||||
if [ -d ~/.claude/plugins/cache/leo-claude-mktplace ]; then
|
if [ -d ~/.claude/plugins/cache/leo-claude-mktplace ]; then
|
||||||
echo "❌ CACHE EXISTS: ~/.claude/plugins/cache/leo-claude-mktplace"
|
echo "ℹ️ Cache exists: ~/.claude/plugins/cache/leo-claude-mktplace"
|
||||||
echo " Run: rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/"
|
echo " (This is normal - do NOT clear mid-session or MCP tools will break)"
|
||||||
FAILED=1
|
echo " To apply plugin changes: restart Claude Code session"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify installed hooks are command type
|
# Verify installed hooks are command type
|
||||||
|
|||||||
Reference in New Issue
Block a user