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

Function getCurrentProjectConfig

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

Source from the content-addressed store, hash-verified

1600})
1601
1602export function getCurrentProjectConfig(): ProjectConfig {
1603 if (process.env.NODE_ENV === 'test') {
1604 return TEST_PROJECT_CONFIG_FOR_TESTING
1605 }
1606
1607 const absolutePath = getProjectPathForConfig()
1608 const config = getGlobalConfig()
1609
1610 if (!config.projects) {
1611 return DEFAULT_PROJECT_CONFIG
1612 }
1613
1614 const projectConfig = config.projects[absolutePath] ?? DEFAULT_PROJECT_CONFIG
1615 // Not sure how this became a string
1616 // TODO: Fix upstream
1617 if (typeof projectConfig.allowedTools === 'string') {
1618 projectConfig.allowedTools =
1619 (safeParseJSON(projectConfig.allowedTools) as string[]) ?? []
1620 }
1621
1622 return projectConfig
1623}
1624
1625export function saveCurrentProjectConfig(
1626 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 1

getGlobalConfigFunction · 0.85

Tested by

no test coverage detected