SLOPSHOPPER

sysinit-diff

State-aware Neovim diff panes

newcommandprocess
A shopper browsing a rack in a slop shop
Source 1 files
hooks/register.ts 20 lines
1import type { Register } from "claude-code";
2
3export const register: Register = (on) => {
4  on("session.start", async ($, e, next) => {
5    const result = await next(e);
6    await $.command.register({
7      name: "diff",
8      description: "Open the worktree diff in a reusable Neovim split",
9      immediate: true,
10    });
11    return result;
12  });
13  on("command.run", { command: "diff" }, async ($) => {
14    const result = await $.process.run(["agent-diff"], { timeoutMs: 16000 });
15    return {
16      text: (result.exitCode === 0 ? result.stdout : result.stderr).trim(),
17    };
18  });
19};
20