fix: load per-group CLAUDE.local.md by adding 'local' to settingSources#2598
Conversation
The agent-runner runs the Agent SDK with settingSources: ['project', 'user'], which omits 'local'. Per the SDK docs the 'local' source is what loads CLAUDE.local.md (the 'project' source loads CLAUDE.md). So every group's CLAUDE.local.md is silently never read, even though container/CLAUDE.md tells each agent to use it as per-group memory. Closes nanocoai#2185. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Empirical confirmation (controlled A/B). I ran the Agent SDK directly ( Note the first reply still references "pineapple test workspace" — that phrase is in This confirms the bug behaviorally: with the current |
… local settingSource - Wire createOchsnerEmailBlockHook into ClaudeProvider PreToolUse (matcher mcp gmail send_email/draft_email) to deny ochsner.org recipients. - Add local to settingSources so per-group CLAUDE.local.md loads (mirrors upstream PR nanocoai#2598); document explicit-import behavior in claude-md-compose.ts. - New file: ochsner-email-block.ts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@jonnychesthair-crypto Thank you for the fix! |
Type of Change
.claude/skills/<name>/, no source changes)Description
What — Add
'local'to the agent-runner's Agent SDKsettingSourcesso each group'sCLAUDE.local.mdis loaded into the agent's context.container/agent-runner/src/providers/claude.tsWhy — Per the Agent SDK docs, the three setting sources load different files:
'project'CLAUDE.md,.claude/rules/*.md, skills, hooks,settings.json'user'CLAUDE.md, user settings'local'CLAUDE.local.md,.claude/settings.local.jsonThe agent-runner passes
settingSources: ['project', 'user'], which omits'local'. BecauseCLAUDE.local.mdis loaded only by the'local'source ('project'loadsCLAUDE.md, notCLAUDE.local.md), every group'sCLAUDE.local.mdis silently never read.This breaks the convention the codebase tells agents to rely on.
container/CLAUDE.mdinstructs every agent: "CLAUDE.local.md in your workspace is your per-group memory. Record things there that you'll want to remember in future sessions." Today those writes never load back, so per-group memory and persona edits are dropped.Reported in #2185. An import-based alternative was explored in #2567; this takes the
settingSourcesroute the docs point to, so no composer/@importchange is needed.How it works — Including
'local'restores the SDK's documented default set (['user', 'project', 'local']) for the one file the agent already writes to. One line, no other changes.How tested — Verified against the SDK docs table above:
'local'is the source that loadsCLAUDE.local.md, and an explicitsettingSourcesarray excludes any source not listed. Reviewer repro (from #2185): addAlways reply with the word PINEAPPLE first.to a group'sCLAUDE.local.md, then message the agent — ignored before this change, obeyed after.Closes #2185.