You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ralph-wiggum): add session isolation for multi-session support
State files now stored with session_id suffix to prevent cross-session
interference when multiple Claude Code sessions run concurrently.
Added:
- session-start-hook.sh: Captures session_id at session start
- lib/utils.sh: Session isolation utilities (get_session_id, get_state_file_path, etc.)
Changed:
- State file location: .claude/ralph-*.local.* → .claude/ralph-session.local/{name}.{session_id}.{ext}
- All lib modules use dynamic path resolution via utils.sh
- Updated docs to reflect new session-based state file naming
- Bump version to 1.1.0
Fixed:
- Cross-session interference: Stop hook now only processes state
belonging to its session, preventing multiple Claude Code sessions
from hijacking each other's loops
Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: ralph-wiggum/.claude-plugin/plugin.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "ralph-wiggum",
3
-
"version": "1.0.1",
4
-
"description": "Self-referential development loop for Claude Code. Run iterative tasks with automatic progress detection and safety controls.",
3
+
"version": "1.1.0",
4
+
"description": "Self-referential development loop for Claude Code with session isolation. Run iterative tasks with automatic progress detection and safety controls.",
State files are stored in `.claude/ralph-*` in your project directory.
159
+
State files are stored in `.claude/ralph-session.local/` with session_id as filename suffix. Each Claude Code session has isolated state. The `.local` suffix ensures gitignore compatibility.
161
160
162
161
## Configuration
163
162
@@ -183,8 +182,10 @@ ralph-wiggum/
183
182
│ └── help.md # Plugin documentation
184
183
├── hooks/
185
184
│ ├── hooks.json # Hook configuration
185
+
│ ├── session-start-hook.sh # Session ID capture
186
186
│ └── stop-hook.sh # Main loop interceptor
187
187
├── lib/
188
+
│ ├── utils.sh # Session isolation utilities
188
189
│ ├── circuit_breaker.sh # Stagnation detection
189
190
│ ├── response_analyzer.sh # Completion analysis
190
191
│ ├── api_limit_handler.sh # Rate limit handling
@@ -193,6 +194,14 @@ ralph-wiggum/
193
194
├── setup-ralph-loop.sh # Loop initialization
194
195
├── status.sh # Status display
195
196
└── cancel-ralph.sh # Cancellation handler
197
+
198
+
Project directory (.claude/):
199
+
├── ralph-session.local/
200
+
│ ├── ralph-loop.{session_id}.local.md
201
+
│ ├── ralph-circuit.{session_id}.json
202
+
│ ├── ralph-analysis.{session_id}.json
203
+
│ ├── ralph-limits.{session_id}.json
204
+
│ └── ralph-tasks.{session_id}.json
196
205
```
197
206
198
207
## When to Use
@@ -220,7 +229,7 @@ ralph-wiggum/
220
229
The smart exit feature may trigger on completion keywords. Options:
221
230
- Use `--no-smart-exit` to disable completion detection
222
231
- Add more specific requirements to your prompt
223
-
- Check `.claude/ralph-analysis.json` to see what triggered the exit
232
+
- Check `.claude/ralph-session.local/ralph-analysis.{session_id}.json` to see what triggered the exit
224
233
225
234
### Loop runs forever
226
235
@@ -233,7 +242,7 @@ Ensure your prompt includes:
233
242
234
243
The circuit breaker stops loops that aren't making progress:
235
244
- Ensure each iteration changes files
236
-
- Check `.claude/ralph-circuit.json` for details
245
+
- Check `.claude/ralph-session.local/ralph-circuit.{session_id}.json` for details
237
246
- Use `--reset-circuit` to reset state if needed
238
247
239
248
### Rate limits
@@ -246,19 +255,41 @@ If you hit Claude's API limits:
246
255
### Debugging
247
256
248
257
```bash
249
-
# Check all state files
250
-
ls -la .claude/ralph-*
258
+
# Check all session state files
259
+
ls -la .claude/ralph-session.local/
251
260
252
-
# View loop configuration
253
-
cat .claude/ralph-loop.local.md
261
+
# View loop configuration (use session_id from /status)
- Session isolation: State files now stored as `.claude/ralph-session.local/{name}.{session_id}.{ext}`
277
+
- SessionStart hook: Captures session_id at session start
278
+
- Session ID display: `/status` shows current session ID
279
+
- lib/utils.sh: New utility module for session isolation
280
+
281
+
**Fixed**
282
+
- Cross-session interference: Stop hook now only processes state belonging to its session, preventing multiple Claude Code sessions from hijacking each other's loops
283
+
284
+
**Changed**
285
+
- State file location moved from `.claude/ralph-*.local.*` to `.claude/ralph-session.local/{name}.{session_id}.{ext}`
286
+
- All library modules use dynamic path resolution
287
+
-`.local` suffix on directory ensures gitignore compatibility
288
+
289
+
### [1.0.1] - Initial Release
290
+
291
+
Self-referential development loop with circuit breaker, smart exit, and API limit handling.
0 commit comments