MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getManagedAndUserConditionalRules

Function getManagedAndUserConditionalRules

src/utils/claudemd.ts:1205–1238  ·  view source on GitHub ↗
(
  targetPath: string,
  processedPaths: Set<string>,
)

Source from the content-addressed store, hash-verified

1203 * @returns Array of MemoryFileInfo objects for matching conditional rules
1204 */
1205export async function getManagedAndUserConditionalRules(
1206 targetPath: string,
1207 processedPaths: Set<string>,
1208): Promise<MemoryFileInfo[]> {
1209 const result: MemoryFileInfo[] = []
1210
1211 // Process Managed conditional .claude/rules/*.md files
1212 const managedClaudeRulesDir = getManagedClaudeRulesDir()
1213 result.push(
1214 ...(await processConditionedMdRules(
1215 targetPath,
1216 managedClaudeRulesDir,
1217 'Managed',
1218 processedPaths,
1219 false,
1220 )),
1221 )
1222
1223 if (isSettingSourceEnabled('userSettings')) {
1224 // Process User conditional .claude/rules/*.md files
1225 const userClaudeRulesDir = getUserClaudeRulesDir()
1226 result.push(
1227 ...(await processConditionedMdRules(
1228 targetPath,
1229 userClaudeRulesDir,
1230 'User',
1231 processedPaths,
1232 true,
1233 )),
1234 )
1235 }
1236
1237 return result
1238}
1239
1240/**
1241 * Gets memory files for a single nested directory (between CWD and target).

Callers 1

Calls 5

getManagedClaudeRulesDirFunction · 0.85
isSettingSourceEnabledFunction · 0.85
getUserClaudeRulesDirFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected