Skip to content

Narrow claude-team find_subagent_jsonl scan to team session dir#121

Merged
clkao merged 5 commits into
mainfrom
spacedock-ensign/cherry-pick-claude-team-narrowing
Apr 18, 2026
Merged

Narrow claude-team find_subagent_jsonl scan to team session dir#121
clkao merged 5 commits into
mainfrom
spacedock-ensign/cherry-pick-claude-team-narrowing

Conversation

@clkao

@clkao clkao commented Apr 18, 2026

Copy link
Copy Markdown
Collaborator

Narrow claude-team's subagent JSONL scan from a global ~/.claude/projects glob to the team's own session directory, collapsing ~4800-file lookups to ~10-20.

What changed

Evidence

  • Static suite: 426 passed, 22 deselected
  • Empirical narrowing on a populated machine: 4863 meta files → 9-16 per team (~300-500× reduction), matches the commit's 4816→9 claim
  • SyntaxWarning absent on worktree binary, present on main binary — fix scoped correctly

#184

clkao and others added 5 commits April 17, 2026 17:39
Look up the team config containing the named member, read its
leadSessionId, and glob only ~/.claude/projects/*/{leadSessionId}/subagents/
instead of every project's subagents directory. Empirically narrows the
haystack from 4816 files to 9 on this machine (~535x reduction).

Falls back to the original broad scan when no team config is found, no
leadSessionId is set, or the narrowed scan returns nothing — defensive
against unexpected layouts. A stderr warning fires in the fallback case so
the slowdown is observable.
Mark the docstring as a raw string (r"""...""") so the literal
backslash-backtick in the example heading no longer triggers:

    SyntaxWarning: "\`" is an invalid escape sequence.

No behavior change.
…mpirical narrowing 4863→9-16 files, SyntaxWarning fix scoped correctly

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
clkao added a commit that referenced this pull request Apr 18, 2026
@clkao clkao merged commit 25d2f9d into main Apr 18, 2026
4 of 5 checks passed
clkao added a commit that referenced this pull request Apr 18, 2026
…ntity remained at validation; idle-hook catch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant