Skip to content

Launch each session with its plugin profile #16512

Description

@kyle-sexton

Goal

Sessions that share one folder each get their own plugin profile: every launch site starts the session with its profile through claude --settings <file>. A phase change is a relaunch. The in-session /plugin-profile switch stays for folders with one session.

Refs: #16428, #16433

Owner decisions (2026-11-16, "Go with recommendations.")

  • A phase change is a relaunch. Handoff resume prompts, background-session launch and lane launchers pass the profile.
  • The one-session settings file is one per folder and profile.
  • A launcher passes an explicit profile name that defaults to the launching session's own profile, plus a per-lane setting for lanes.
  • Launchers always pass --settings when there is a profile, and clear the PLUGIN_PROFILES_SESSION marker when there is none.
  • The in-session folder switch warns inside its existing confirmation, naming the other live sessions in the folder. It does not refuse.
  • An unattended launch whose profile needs a missing required tool stops and reports.

Probe results (Claude Code 2.1.325, interactive sessions)

  • A claude --bg started from the Bash tool of a --settings session does not inherit PLUGIN_PROFILES_SESSION: the background supervisor spawns it. A direct child (claude, claude -p) started from that Bash tool does.
  • claude accepts two --settings flags; the last one wins wholly and the earlier file is dropped. A lane's own settings and a profile need one merged file.

Work

  • One command in plugin-profiles that, given a profile and a folder, writes or reuses the session file (one per folder and profile) and prints its path and the launch command. Every launch site calls it. status prints the launch command too.
  • Launch sites: session-flow continue-in-background (--bg carries --settings; --cloud cannot and the report says so), session-flow handoff (the resume line carries --settings; a phase change says exit, relaunch, paste), the lane launcher and restart consumer (a per-lane profile merged with the lane's own settings), work-items work-loop, fleet reach and its relay, machine-health setup. Each falls back to today's behavior when plugin-profiles is not enabled.
  • A lane's own settings merge into the profile through an optional input of the same command, which owns the merged file and its cleanup.
  • Defects: the handoff reference asks for a restore entry status does not print; worktree creation copies .claude/settings.local.json profile entries without the profile record; the marker leak, cleared in the one shared launch path.
  • The folder-switch warning and the unattended stop above.

Acceptance

  • Each launch site starts a session with its profile, or the pull request says why a site is left alone.
  • Tests ship with each change.

Activity

  1. added
    host-run
    on Nov 16, 2026
  2. added
    needs-triage
    on Nov 16, 2026
  3. github-actions commented on Nov 16, 2026

    @github-actions
    Contributor

    Size: Large
    Complexity: Medium
    Uncertainty: Knowable
    Flags: none
    Blocked by: none

    Understood: each session sharing a folder should launch with its own plugin profile through claude --settings <file>. A single plugin-profiles command would write or reuse the per-folder, per-profile session file and print its path and the launch command. Each launch site (session-flow background and handoff, lane launcher and restart consumer, work-items work-loop, fleet reach and relay, machine-health setup) would call it. The issue also lists three defects, the in-session folder-switch warning, and the unattended stop on a missing required tool.

    The outcome and acceptance are specific enough to proceed. The work spans many plugins, so it likely needs splitting into parts. I found no open duplicate. Related open issues are #16428 and #16433, which the issue already references. The owner decisions are quoted in the issue body, not in a recorded decision comment. I treated them as the issue's own spec, not as a settled decision.

    Automated triage. A maintainer reviews it.

  4. removed
    needs-triage
    on Nov 16, 2026
  5. melodic-automation-lanes commented on Nov 16, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited; it carries host-run. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  6. melodic-automation-lanes commented on Nov 16, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Add a launch-command subcommand to plugin-profiles (one session file per folder and profile, optional merged lane settings), then have each launch site call it, fix the three defects, and add the folder-switch warning and unattended stop; most likely delivered as several linked parts.

    Dependencies

    • #​16428: ships the plugin-profiles plugin; launch sites fall back when it is not enabled
    • #​16433: in-session /plugin-profile switch, which the folder-switch warning extends

    Related work

    Open questions

    1. The owner decisions appear only in the issue body, not in a **Decision recorded.** comment. Should an unattended run treat them as settled?
      RECOMMENDED: Yes. Have the owner post them as a Decision recorded comment, or confirm the body is the spec. Basis: judgment
    2. Should this be split into parts, each with its own task list and tests? One run cannot cover a new command, about seven launch sites across several plugins, three defects, the folder-switch warning and the unattended stop.
      RECOMMENDED: Split into: (1) the plugin-profiles launch command with the merged lane-settings input, marker clearing and status printing the launch command; (2) session-flow background and handoff, plus the handoff restore-entry defect; (3) lane launcher and restart consumer; (4) work-items work-loop, fleet reach and relay, and machine-health setup; (5) worktree profile-record defect, folder-switch warning and unattended stop. Basis: judgment
    3. Where do the lane launcher and restart consumer live, and what is the per-lane profile setting called? I found no source for the name in the plugins I searched.
      RECOMMENDED: The owner names the files and the setting key, or part 3 begins by locating them. Basis: judgment
    4. What command name and argument shape should the new plugin-profiles command have? apply &lt;name> --for session already prints a claude --settings line, so the new one could extend it or be separate.
      RECOMMENDED: Add a separate subcommand, for example launch &lt;profile> &lt;folder> \[--merge &lt;file>\]. It reuses the session-file generator in plugins/plugin-profiles/scripts/profiles.mjs. Basis: plugins/plugin-profiles/scripts/profiles.mjs:346
    5. Which per-folder file path and cleanup rule apply to the reused session file and the merged lane file?
      RECOMMENDED: Key the file by a hash of the folder plus the profile name. The command owns the cleanup of the merged file, which is regenerated when the lane settings change. Basis: judgment

    Sources read

    • plugins/plugin-profiles/README.md:59: session target writes a generated file for claude --settings &lt;file> and sets PLUGIN_PROFILES_SESSION; a resumed session needs --settings again.
    • plugins/plugin-profiles/scripts/profiles.mjs:86: defines the SESSION_VAR marker.
    • plugins/plugin-profiles/scripts/profiles.mjs:106: the resumeLine text tells the user to pass --settings again on resume.
    • plugins/plugin-profiles/scripts/profiles.mjs:308: the in-session switch refuses when a one-session settings file is in use.
    • plugins/plugin-profiles/scripts/profiles.mjs:346: apply prints the claude --settings start command.
    • plugins/fleet/evals/reach-named-headless-receiver/samples/stay-up-bg-with-instructions.json: fleet reach builds claude -p --settings with inline JSON and no profile today.
    • refine-data/context.json: no recorded decision comment, no task list, no duplicate or fixed-by candidate.

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  7. removed
    host-run
    on Nov 16, 2026
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

    Fields

    Work status

    needs-owner-decision

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions