MCPcopy
hub / github.com/claude-code-best/claude-code / getCurrentProjectConfig

Function getCurrentProjectConfig

src/utils/config.ts:1610–1631  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1608})
1609
1610export function getCurrentProjectConfig(): ProjectConfig {
1611 if (process.env.NODE_ENV === 'test') {
1612 return TEST_PROJECT_CONFIG_FOR_TESTING
1613 }
1614
1615 const absolutePath = getProjectPathForConfig()
1616 const config = getGlobalConfig()
1617
1618 if (!config.projects) {
1619 return DEFAULT_PROJECT_CONFIG
1620 }
1621
1622 const projectConfig = config.projects[absolutePath] ?? DEFAULT_PROJECT_CONFIG
1623 // Not sure how this became a string
1624 // TODO: Fix upstream
1625 if (typeof projectConfig.allowedTools === 'string') {
1626 projectConfig.allowedTools =
1627 (safeParseJSON(projectConfig.allowedTools) as string[]) ?? []
1628 }
1629
1630 return projectConfig
1631}
1632
1633export function saveCurrentProjectConfig(
1634 updater: (currentConfig: ProjectConfig) => ProjectConfig,

Callers 15

getStoredSessionCostsFunction · 0.85
setupFunction · 0.85
ConfigFunction · 0.85
claudemd.tsFile · 0.85
exampleCommands.tsFile · 0.85
getReadOnlyToolNamesFunction · 0.85
bridgeMainFunction · 0.85
mcpRemoveHandlerFunction · 0.85
addMcpConfigFunction · 0.85

Calls 2

getGlobalConfigFunction · 0.85
safeParseJSONFunction · 0.85

Tested by

no test coverage detected