Skip to content

[Share] askdiff-cc — a Claude Code companion built on top of askdiff #8

@xiaoneng666

Description

@xiaoneng666

Hey @narghev — wanted to share something I built on top of askdiff,
in case it's useful for other heavy Claude Code users.

Repo / branch: https://github.com/xiaoneng666/askdiff/tree/askdiff-cc

It lives as an orphan branch in my fork (not a PR target) — the 2500+
lines are bash / Python stdlib / vanilla JS, intentionally separate
from the TypeScript packages so it doesn't fit upstream. But it
heavily depends on askdiff at runtime: spawns the CLI as a library,
patches the bundled index.html to inject a sidebar, hooks
window.WebSocket to reuse your diff_request flow.

What it adds on top of /askdiff

  • Auto-launch via four Claude Code hooks (PreToolUse,
    PostToolUse, Stop, SessionEnd) — diff opens at the end of every
    CC turn that touched files in scope
  • Per-query archive of changes, labeled with the original user
    query text, using pre-edit snapshots (commit-resilient — survives
    git commit / reset / amend / rebase)
  • Multi-repo parent cwd — walks each touched file to its .git,
    unions per-repo diffs with path-prefix rewriting
  • Per-CC-session isolation — separate askdiff CLI + HTTP sidecar
    per session UUID, history namespaced
  • IDEA-style right-side sidebar — collapsible, drag-resizable,
    search/filter, persistent state via localStorage
  • Double-click variable highlight (CSS Custom Highlight API with
    <mark> fallback), Enter-sends chat with CJK IME safety,
    chat-header archive tags

What it patches in your bundle (idempotent, re-applied on every fire)

  • dist/index.js CSP: adds http://localhost:* http://127.0.0.1:*
    to connect-src so the sidebar's HTTP sidecar is reachable
  • dist/ui/index.html: injects one <script> block at end of
    <body> (before deferred React module) to capture the WS instance

Not asking anything

Just a heads-up + a thank-you. askdiff is the foundation that
everything builds on, and the WebSocket protocol + the --resume
mechanism are exactly the right primitives for this kind of
orchestration. If anything in there inspires upstream changes — or
if you'd rather I not patch your dist bytes — happy to chat.

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions