this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix plan-saver routing plans to wrong projects

Remove "Strategy 2" fallback that routed plans to the most recently
active session when no exact slug match was found. This caused plans
from different projects to be incorrectly saved to whichever project
was most recently active.

Now plans are only saved when an exact slug match exists in sessions.json.
Plans without matching sessions remain in ~/.claude/plans/ but aren't
copied to any project directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

alice 4392091e 148a966c

+6 -15
+1 -1
plugins/plan-saver/.claude-plugin/plugin.json
··· 1 1 { 2 2 "name": "plan-saver", 3 - "version": "2.2.1", 3 + "version": "2.2.2", 4 4 "description": "Automatically saves plans from plan mode to your repo's .claude/plans/ directory with numbered filenames", 5 5 "author": { 6 6 "name": "Alice"
+5 -14
plugins/plan-saver/daemon/plan-saver-daemon.sh
··· 118 118 } 119 119 120 120 # Find the target directory for a plan based on its slug 121 + # Only matches if there's an exact slug match - no fallback to avoid routing plans to wrong projects 121 122 find_target_cwd() { 122 123 local SLUG="$1" 123 124 ··· 125 126 return 1 126 127 fi 127 128 128 - # Strategy 1: Exact slug match 129 + # Exact slug match only - no fallback 130 + # The slug is the unique identifier that ties a plan to a specific Claude Code session 129 131 local MATCH 130 132 MATCH=$(jq -r --arg slug "$SLUG" ' 131 133 .sessions | to_entries[] ··· 138 140 return 0 139 141 fi 140 142 141 - # Strategy 2: Most recently active session 142 - MATCH=$(jq -r ' 143 - .sessions | to_entries 144 - | sort_by(.value.last_active) 145 - | reverse 146 - | .[0].value.cwd // empty 147 - ' "$SESSIONS_FILE" 2>/dev/null) 148 - 149 - if [[ -n "$MATCH" ]] && [[ -d "$MATCH" ]]; then 150 - echo "$MATCH" 151 - return 0 152 - fi 153 - 143 + # No match found - don't fall back to "most recently active session" 144 + # as that would route plans to the wrong project 154 145 return 1 155 146 } 156 147