MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / getDefaultEffortForModel

Function getDefaultEffortForModel

src/utils/effort.ts:317–378  ·  view source on GitHub ↗
(
  model: string,
)

Source from the content-addressed store, hash-verified

315
316// @[MODEL LAUNCH]: Update the default effort levels for new models
317export function getDefaultEffortForModel(
318 model: string,
319): EffortValue | undefined {
320 if (process.env.USER_TYPE === 'ant') {
321 const config = getAntModelOverrideConfig()
322 const isDefaultModel =
323 config?.defaultModel !== undefined &&
324 model.toLowerCase() === (config.defaultModel as string).toLowerCase()
325 if (isDefaultModel && config?.defaultModelEffortLevel) {
326 return config.defaultModelEffortLevel as EffortValue
327 }
328 const antModel = resolveAntModel(model)
329 if (antModel) {
330 if (antModel.defaultEffortLevel) {
331 return antModel.defaultEffortLevel
332 }
333 if (antModel.defaultEffortValue !== undefined) {
334 return antModel.defaultEffortValue
335 }
336 }
337 // Always default ants to undefined/high
338 return undefined
339 }
340
341 // IMPORTANT: Do not change the default effort level without notifying
342 // the model launch DRI and research. Default effort is a sensitive setting
343 // that can greatly affect model quality and bashing.
344
345 if (
346 getAPIProvider() === 'openai' &&
347 isChatGPTAuthMode() &&
348 isChatGPTCodexReasoningModel(model)
349 ) {
350 return 'medium'
351 }
352
353 // Default effort on Opus 4.6 to medium for Pro.
354 // Max/Team also get medium when the tengu_grey_step2 config is enabled.
355 if (
356 model.toLowerCase().includes('opus-4-7') ||
357 model.toLowerCase().includes('opus-4-6')
358 ) {
359 if (isProSubscriber()) {
360 return 'high'
361 }
362 if (
363 getOpusDefaultEffortConfig().enabled &&
364 (isMaxSubscriber() || isTeamSubscriber())
365 ) {
366 return 'high'
367 }
368 }
369
370 // When ultrathink feature is on, default effort to medium (ultrathink bumps to high)
371 if (isUltrathinkEnabled() && modelSupportsEffort(model)) {
372 return 'medium'
373 }
374

Callers 3

EffortCalloutFunction · 0.85
resolveAppliedEffortFunction · 0.85

Calls 11

resolveAntModelFunction · 0.85
getAPIProviderFunction · 0.85
isChatGPTAuthModeFunction · 0.85
isProSubscriberFunction · 0.85
isMaxSubscriberFunction · 0.85
isTeamSubscriberFunction · 0.85
isUltrathinkEnabledFunction · 0.85
modelSupportsEffortFunction · 0.85

Tested by

no test coverage detected