Skip to content

-A, -B, -C with --sem #76

Open
Open

Description

@ervwalter

Are the -A, -B, and -C options supposed to work with semantic searches?

Based on my experiments they don't have an effect on how much is outputted. Having these work in all modes would help ck is called by agents so that the agent gets more context and can avoid having to go manually read the file as a followup task.

Activity

  1. runonthespot commented on May 24, 2026

    @runonthespot
    Contributor

    Acknowledging — this is in our backlog. Today -A/-B/-C apply to lexical/regex modes but not semantic, which is a real ergonomic gap given that semantic results are conceptually "a chunk near a span" and you'd want surrounding context for the same reason.

    Two implementation paths:

    1. Trivial: after we get a result span, read the file and grab N lines before/after — same as we do for regex. Easy.
    2. Semantic-aware: instead of lexical context lines, include the neighboring chunks (the previous/next sidecar chunks). Closer to what "semantic context" actually means.

    We'll likely do (1) first because it matches user expectation of the existing flags, and consider (2) separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions