Repository navigation
Conversation
The Claude Code program listens on a localhost port of its own and runs in the user's project, so it was listed as that project's dev server and included in close --all-projects. Recognise it by its executable path, list it under Apps and refuse to close it while safety protection is on.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude Code's command-line program (native install,
~/.local/share/claude/versions/<version>) listens on a localhost port of its own, and its working directory is the user's project. LeftOpen therefore lists it as that project's dev server, andleftopen close --all-projectsincludes it. Closing it ends the session the user is working in.With main at 633db6b and a Claude Code 2.1.322 session open in a project:
PID 2095 is the session's
claudeprocess; the other three are servers that sessions started.Add
CodingAgent.name(of:)in Core, which recognises the Claude Code program by its executable path. The scanner labels it "Claude Code" as an application, it is listed under Apps, andCloseServicerefuses to close it while safety protection is on: "PID 2095 is a running Claude Code session. Closing it would end that session; exit it from its own terminal instead." With safety protection off it can still be closed, like the other protections. Servers a session starts are separate processes and are unchanged. Only the native installer's path is recognised. Update both READMEs.After the change the batch plan lists the three servers only,
leftopen close 60019 --dry-runis refused with that reason, and an ordinary leftover server is still planned for closing.Validation:
swift testran 87 tests, including the newtestRunningClaudeCodeSessionIsAnAppAndCannotBeClosed. The one failure,testCoreTextFollowsTheSelectedLanguage, fails the same way on unmodified main on this Mac: its system language is Chinese and the test expects English as the starting language. The release script tests, the Homebrew uninstall test and the legacy icon test passed. Checked with the CLI on macOS 26; the menu bar app was not run.