fix: sanitize SessionStart session summaries (#710)

This commit is contained in:
Affaan Mustafa
2026-03-20 05:42:32 -07:00
committed by GitHub
parent 40f18885b1
commit 35071150b7
2 changed files with 32 additions and 3 deletions

View File

@@ -40,11 +40,10 @@ async function main() {
log(`[SessionStart] Latest: ${latest.path}`);
// Read and inject the latest session content into Claude's context
const content = readFile(latest.path);
const content = stripAnsi(readFile(latest.path));
if (content && !content.includes('[Session context goes here]')) {
// Only inject if the session has actual content (not the blank template)
// Strip ANSI escape codes that may have leaked from terminal output (#642)
output(`Previous session summary:\n${stripAnsi(content)}`);
output(`Previous session summary:\n${content}`);
}
}