-
Notifications
You must be signed in to change notification settings - Fork 808
Open
Description
I'm using agent-browser with Claude Code and it works great but sometimes I kill the session without realizing that the agent didn't have a chance to close it via agent-browser close (or the agent can make a mistake by not calling this command).
When this happens, chrome-headless-shell processes remain running indefinitely and sometimes consume a lot of CPU / battery without me realizing it.
For example:
$ ps aux | grep chrome-headless
USER PID %CPU %MEM ELAPSED COMMAND
borekb 44028 0.0 0.2 19:54:59 chrome-headless-shell (main)
borekb 44054 0.0 0.1 19:54:59 chrome-headless-shell (network)
borekb 44055 6.8 0.5 19:54:59 chrome-headless-shell (renderer)
borekb 92158 519.2 0.8 01:43:06 chrome-headless-shell (gpu-process)
Is there a way to deal with this, like a global timeout for new sessions that are left hanging? Claude Code suggested I add a SessionEnd hook but I wanted to ask wheter there's a better way to handle this.
Thanks for an awesome tool BTW!
UPDATE: This is the SessionEnd hook that Claude suggested:
.claude/settings.json:
{
"hooks": {
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "agent-browser close 2>/dev/null || true"
}
]
}
]
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels