Skip to content

comment clear and comment rm cannot remove user c notes — no CLI path to clear all comments #382

@vxio

Description

@vxio

What I'm trying to do

Programmatically clear all inline comments in a live session — agent notes and human c notes — without driving the TUI.

This is the natural "reset to clean slate" gesture for scripted review workflows (agents starting a new pass, batch cleanup after a review round, automation around --watch sessions).

What happens

In Hunk 0.14, the CLI can clear agent/live comments but cannot remove user notes by any documented surface:

# Setup: one user `c` note added in the TUI, sourced "user"
$ hunk session comment list --repo . --type user --json | jq '.comments[0] | {noteId, source}'
{
  "noteId": "user:1780010645241",
  "source": "user"
}

# Bulk clear skips it:
$ hunk session comment clear --repo . --yes
# Note remains.

# Per-id rm rejects it:
$ hunk session comment rm --repo . user:1780010645241
hunk: No live comment matches id user:1780010645241.

So user notes are readable by the CLI (with noteIds in a stable user:<ms> format) but not writeable. The only way to remove them is the TUI itself, or killing the TUI process so they vanish from memory.

Why this matters

Anything that wraps Hunk for agent or script use ends up with two classes of comments and no way to reconcile them programmatically. "Clear all comments" — the most basic management gesture — can't be expressed via the CLI today.

What I'd hope for

My primary ask: a single bulk operation that wipes every comment in the session, regardless of source. Something like hunk session comment clear --include-user --yes (or a more emphatic flag name — --all, --really-all, etc.), so wrappers and agents have one canonical "reset to clean slate" call.

A secondary nice-to-have: comment rm <noteId> accepting user noteIds, so callers that want surgical removal (e.g. address one note and delete it) can do so without the bulk hammer. Useful but not what I'd reach for in the common case.

Ideal end-state

After the bulk clear runs, the live TUI refreshes on its own and shows zero comments — agent and user alike. No manual r-reload, no "still see the note until I scroll", and no need to kill and relaunch hunk diff --watch to drop user notes from memory. The CLI mutation and the TUI's view stay in sync the same way they already do for live/agent clears today.

Environment

  • Hunk 0.14.0 (Homebrew, macOS arm64)
  • Session via hunk diff --watch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions