File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
packages/agent/src/adapters/claude/session Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,22 @@ function buildSpawnWrapper(
175175 } ;
176176}
177177
178+ function ensureLocalSettings ( cwd : string ) : void {
179+ const claudeDir = path . join ( cwd , ".claude" ) ;
180+ const localSettingsPath = path . join ( claudeDir , "settings.local.json" ) ;
181+ try {
182+ if ( ! fs . existsSync ( localSettingsPath ) ) {
183+ fs . mkdirSync ( claudeDir , { recursive : true } ) ;
184+ fs . writeFileSync ( localSettingsPath , "{}\n" , { flag : "wx" } ) ;
185+ }
186+ } catch {
187+ // Best-effort — don't fail session creation if we can't write
188+ }
189+ }
190+
178191export function buildSessionOptions ( params : BuildOptionsParams ) : Options {
192+ ensureLocalSettings ( params . cwd ) ;
193+
179194 const options : Options = {
180195 ...params . userProvidedOptions ,
181196 systemPrompt : params . systemPrompt ?? buildSystemPrompt ( ) ,
You can’t perform that action at this time.
0 commit comments