Skip to content

Allow opening arbitrary files with Hunk for exploration unrelated to diff viewing #301

@macbem

Description

@macbem

I’d like a way to open arbitrary source files in Hunk, even when they are not part of a diff.

My use case is AI-assisted code learning and walkthroughs. Today, Hunk works well when there is a diff: an agent can navigate changed files, add inline notes, and guide me through important hunks. But sometimes I want the same annotation workflow for existing unchanged files, such as:

  • exploring an unfamiliar subsystem
  • learning how a message bus or SDK integration works
  • having an AI agent add teaching notes to key functions
  • walking through architecture across multiple files that are not currently modified

In these cases the diff itself is not the important artifact. The valuable part is Hunk’s file navigation plus agent annotations. I want to load a set of arbitrary files and let the agent attach notes to lines, even if there are no additions/deletions.

Desired workflow:
hunk files src/foo.ts src/bar.ts or hunk session reload --repo . -- files src/foo.ts src/bar.ts

Then agents could use existing session commands:
hunk session navigate --repo . --file src/foo.ts --new-line 42
hunk session comment add --repo . --file src/foo.ts --new-line 42 --summary "..."

Potential behavior:

  • Show selected files as regular read-only file views.
  • Allow comments/annotations on any line.
  • Preserve existing agent comment navigation.
  • Optionally support ranges or directories.
  • Make it clear this is “file review” or “source walkthrough” mode, not a diff.

This would make Hunk useful beyond code review: it could become a lightweight collaborative code-reading surface for humans and AI agents.

I'm happy to submit a PR for this if it's in line with your vision for the tool. Let me know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions