Skip to content

Upstream v7.18.2 fixes the worktree leak; patches/ccs-sp-file.js has been a no-op since v7.17.0 #1

Closed

Description

@Lexus2016

Hi, upstream here. Thanks for the image. Two of its workarounds pointed at real bugs in Claude Code Studio, and both are now fixed upstream.

1. Orphan worktrees (your prune_orphan_worktrees) are fixed in v7.18.2 (Lexus2016/claude-code-studio#125).
You diagnosed it correctly: SESSION_TTL_DAYS expiry deleted only the DB row. It now goes through the same teardown as the delete button, which removes the worktree, the ccs/session-* branch, the terminal pane and any queued messages. Expiry skips a session that is running, one with an open terminal, and one whose worktree holds uncommitted or unmerged work. CCS also reconciles trees leaked by older versions on every start, using rules close to yours: no sessions/tasks/task_chains row owns the tree, it is older than an hour, it is clean and merged, and it is removed with git worktree remove without --force.

You don't have to change anything. Your entrypoint prune runs before CCS starts and uses the same no---force rule, so the two don't conflict. Once your image tracks v7.18.2+, it is simply redundant. One difference: CCS also counts task_chains.workdir as an owner. A task group owns its tree before any of its tasks carries it, so your sessions/tasks/task_chains query already covers that.

2. patches/ccs-sp-file.js has had nothing to patch since v7.17.0 (#96).
The subscription engine no longer puts the system prompt into the tmux command at all. It writes the whole claude invocation to a script in a per-process 0700 temp directory and hands tmux sh <path>. The innerCmd += ... line your sed looks for no longer exists. Your grep -q guard makes the patch a silent no-op, so nothing breaks, but the patch and its sed can be removed. Also, $(cat ...) inside the tmux command would have been a syntax error for a user whose login shell is csh/tcsh; tmux runs commands through default-shell. That is why upstream went with a script.

The first-run prompt pre-acceptance in your entrypoint (theme, folder trust, bypass disclaimer) is still a real gap upstream. CCS only reports the generic failed to start tmux session there.

Activity

  1. Lexus2016 commented on Oct 3, 2026

    @Lexus2016
    Author

    Follow-up: the last gap I mentioned, the first-run prompts, is fixed in v7.18.3 (Lexus2016/claude-code-studio#126), so configure_claude_onboarding is now optional too.

    What CCS does before it spawns the subscription engine (measured against CLI 2.1.288):

    • Bypass Permissions warning: CCS passes --settings '{"skipDangerousModePermissionPrompt":true}' on the spawn command, so nothing is written to settings.json.
    • Theme picker and folder trust: CCS sets hasCompletedOnboarding, theme and projects[<dir>].hasTrustDialogAccepted in $CLAUDE_CONFIG_DIR/.claude.json or ~/.claude.json, and only when they are missing. <dir> is the realpath of the directory the session actually starts in, written under its raw and NFC keys.

    One finding that matters for your entrypoint: the CLI's trust inheritance from a parent stops at a git root. A trusted /app/workspace does not cover /app/workspace/<project> if that project is its own repository, and every CCS session worktree under /app/data/worktrees/... is one. So seeding WORKDIR/* covers the project roots, but not the worktrees CCS runs sessions in. That gap is closed upstream now, per directory, at spawn time.

    Your single-file bind-mount note was also handled. On EBUSY the seed rewrites the file in place: it takes a backup first, writes every byte, fsyncs, and restores the backup if anything fails. If you keep your seeding, the two don't conflict, since CCS only adds keys that are missing.

  2. malys commented on Oct 4, 2026

    @malys
    Owner

    Thanks! Fixed in db31803: patches/ccs-sp-file.js, its sed in ccs-fetch.sh and the Dockerfile COPY lines are removed (no-op since v7.17.0). README/publish examples moved off v7.16.2. Orphan-worktree prune and onboarding seeding stay in the entrypoint: they don't conflict with v7.18.2+/v7.18.3 and still cover images pinned to an older CCS_REF.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions