Skip to content

Project layers in the rail reflect knobs.cc's launch dir, not the user's claude session #12

Closed

Description

@samkeen

Problem

The project and project_local rows in the precedence rail are scoped to knobs.cc's own current working directory — wherever npm run tauri dev (or the built bundle) was launched from — not to a user-specified Claude Code session.

In practice this means:

  • If a developer launches knobs.cc from ~/Projects/knobs.cc/, the project layers read ~/Projects/knobs.cc/.claude/settings.json and settings.local.json. Those are config for this repo, not for any claude session the user actually cares about inspecting.
  • The current rail copy (the path string) reads as a real, authoritative project entry. A user who clicks a key and sees the project layer marked as winning might trust a value that came from an unrelated repo.
  • The two file-based project layers are the only ones in the precedence model that are inherently relative to where claude is running. managed, env, user, and default are global from any caller's perspective. cli is per-invocation but already greys out (tracked in Read another running claude process's argv + env (the "runtime introspection" layer) #11) precisely because it can't be answered without a process target.

Same axis as #11, applied to "where is claude running?" instead of "what argv/env does claude have?". Both questions need the app to know which claude session it's grounding itself in.

Short-term: grey out the rail rows

For now, treat project and project_local like cli — render them at reduced opacity in PrecedenceRail so users don't trust a project value that came from an unrelated dir.

UI scope (shipping with this issue's opening commit):

  • PrecedenceRail rows for project and project_local get disabled: true (opacity-45).
  • No backend change: read_settings_layers keeps reading the files; SettingsList rows, SourceBadge, presence cells, and KeyDrawer are untouched.

That's a stopgap, not a fix.

Longer-term: ground project visibility in a chosen claude session

A few framings, none committed:

  1. Attach mode (parallel to Read another running claude process's argv + env (the "runtime introspection" layer) #11's Proposal A). Enumerate running claude processes, let the user pick one, use its CWD to resolve project/project_local. Pairs naturally with Read another running claude process's argv + env (the "runtime introspection" layer) #11 — same sysinfo-based discovery layer.
  2. Launch mode (instrumentation harness). knobs.cc spawns claude itself with a chosen directory and CLI args. Because we exec'd the process we know its CWD, argv, and starting env without scraping /proc or sysctl. Doesn't help users with an already-running claude.
  3. Path picker mode (no claude dependency). Drop the "match a running claude" framing entirely and just ask the user "which directory should I treat as your claude project?" — falls back to the current CWD if unset. Cheapest to implement; bypasses the discovery + permissions work in Read another running claude process's argv + env (the "runtime introspection" layer) #11.
  4. Some combination. e.g. ship (3) immediately to unblock the rail, then layer (1) or (2) on top once Read another running claude process's argv + env (the "runtime introspection" layer) #11 lands so the picker auto-fills from a chosen process.

Open design questions

Related

Activity

  1. samkeen commented on May 13, 2026

    @samkeen
    ContributorAuthor

    Resolved by #15.

    The inspector now grounds against a chosen claude session: a topbar SessionPill enumerates same-UID claude / claude-code processes via sysinfo and reads each one's cwd, so the project / project_local rail rows resolve to the attached session's directory rather than knobs.cc's launch dir. When no claude is running, a native folder picker (tauri-plugin-dialog) lets the user point at a project directory directly — that's proposal 3 from the issue body, kept as the fallback rather than dropped.

    UX shape:

    • 0 claudes → pill says "no claude · pick a project ▾", path-picker fallback
    • 1 claude → auto-attach
    • 2+ claudes → manual picker via the pill dropdown
    • Selected pid persists for the app's lifetime (not across restarts — a future v-next decision, see spec/attach-mode.md "Open questions").

    Implementation contract: spec/attach-mode.md.

    Out of scope for v1 (deferred): Windows (sysinfo doesn't expose another process's environ), containerised / sandboxed claude, remote / SSH inspection. All three fail gracefully with honest empty states; tracked in attach-mode.md "Non-goals."

  2. added a commit that references this issue on May 13, 2026
  3. samkeen commented on May 16, 2026

    @samkeen
    ContributorAuthor

    Shipped on feat/attach-mode — see commits f49836c ("Ground inspection in a chosen claude session (#11, #12)") and 0a5ac27 (PR #15 merge). read_settings_layers now accepts attached_pid / project_root_override args; project / project_local rows in the rail are grounded against the chosen session's cwd or the picked project root rather than knobs.cc's own launch dir. Path-picker fallback covers the no-attached-claude case.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions