Skip to content

fix: cleanup old suspended claude processes to prevent memory leaks - #815

Closed
Nachx639 wants to merge 1 commit into
openclaw:mainfrom
Nachx639:fix/claude-process-cleanup
Closed

Nachx639 wants to merge 1 commit into
openclaw:mainfrom
Nachx639:fix/claude-process-cleanup

Conversation

@Nachx639

Copy link
Copy Markdown
Contributor

When resuming Claude sessions, old processes with --resume flags were never killed, causing them to accumulate in memory (60+ processes, ~3GB of RAM).

This fix kills old processes with the same sessionId before launching a new one.

Changes

  • Kill old suspended processes when resuming Claude CLI sessions
  • Prevents memory leak from accumulating abandoned processes

Testing

Tested locally with Claude CLI resume sessions.

When resuming Claude sessions, old processes with --resume flags
were never killed, causing them to accumulate in memory (60+ processes,
~3GB of RAM). This fix kills old processes with the same sessionId
before launching a new one.
@steipete

steipete commented Jan 13, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the report + patch. Current main does not use claude --resume anymore: the claude backend runs with --session-id, and only codex uses exec resume. So this fix does not apply as written. Closing for now; we will address resume cleanup separately if it shows up on codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants