fix: Prevent creation of new CLAUDE.md files if no activity is present. (#809)
This commit is contained in:
@@ -320,6 +320,18 @@ export async function updateFolderClaudeMdFiles(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const formatted = formatTimelineForClaudeMd(result.content[0].text);
|
const formatted = formatTimelineForClaudeMd(result.content[0].text);
|
||||||
|
|
||||||
|
// Fix for #758: Don't create new CLAUDE.md files if there's no activity
|
||||||
|
// But update existing ones to show "No recent activity" if they already exist
|
||||||
|
const claudeMdPath = path.join(folderPath, 'CLAUDE.md');
|
||||||
|
const hasNoActivity = formatted.includes('*No recent activity*');
|
||||||
|
const fileExists = existsSync(claudeMdPath);
|
||||||
|
|
||||||
|
if (hasNoActivity && !fileExists) {
|
||||||
|
logger.debug('FOLDER_INDEX', 'Skipping empty CLAUDE.md creation', { folderPath });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
writeClaudeMdToFolder(folderPath, formatted);
|
writeClaudeMdToFolder(folderPath, formatted);
|
||||||
|
|
||||||
logger.debug('FOLDER_INDEX', 'Updated CLAUDE.md', { folderPath });
|
logger.debug('FOLDER_INDEX', 'Updated CLAUDE.md', { folderPath });
|
||||||
|
|||||||
Reference in New Issue
Block a user