spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

mods/diff: an asked diff rides down to the turn on the prompt's context, not onto the answerBrowse files
poteat authored on Sep 10, 2026 parent 37f19ef · commit d920522c4b90
1 changed file+13 -7compared with 37f19ef
Mmods/diff/hooks/register.ts
@@ -590,17 +590,23 @@
590590 })
591591
592592 on('prompt.submit', async ($, e, next) => {
593- const result = await next(e)
594593 const asked = armed
595594
596- if (!host || !asked || result.drop !== undefined) {
597- return result
595+ if (!host || !asked) {
596+ return next(e)
598597 }
599598
600- disarm(host)
601- redraw(host)
602- Record.recorderOf(host).asked(asked.lines)
599+ const result = await next({
600+ ...e,
601+ context: [...(e.context ?? []), asked.text],
602+ })
603603
604- return { ...result, context: [...(result.context ?? []), asked.text] }
604+ if (result.drop === undefined && armed === asked) {
605+ disarm(host)
606+ redraw(host)
607+ Record.recorderOf(host).asked(asked.lines)
608+ }
609+
610+ return result
605611 })
606612 }