You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the agent's trace (if available), the gap between what the agent did and what it should have done, and the judge's analysis, write a doc file that captures a GENERAL PATTERN that would help the agent across many similar tasks. Focus on what the agent MISUNDERSTOOD (visible in the trace) rather than just what it got wrong (visible in the diff). If this failure doesn't reveal a generalizable pattern, respond with {"skip": true, "reasoning": "..."}.
149
179
150
180
Respond with ONLY the JSON object.`
@@ -156,9 +186,12 @@ Respond with ONLY the JSON object.`
156
186
157
187
letoutput: string
158
188
try{
189
+
// IMPORTANT: Run in tmpDir to avoid Claude reading the repo's CLAUDE.md/AGENTS.md,
190
+
// which can pollute the doc writer's analysis with unrelated project context.
159
191
output=execSync(
160
192
`claude --dangerously-skip-permissions -p "Read the file ${promptFile} and follow all instructions in it. Respond with ONLY the JSON object as specified."`,
161
193
{
194
+
cwd: tmpDir,
162
195
encoding: 'utf-8',
163
196
timeout: 5*60*1000,
164
197
stdio: ['ignore','pipe','pipe'],
@@ -298,13 +331,18 @@ export function revertDocEdit(
298
331
299
332
/**
300
333
* Compare scores to determine if a doc edit improved things.
334
+
* Requires a minimum improvement of 0.3 points to count as "improved"
335
+
* to avoid accepting docs based on noise (especially with low parallelism).
0 commit comments