Skip to content

feat: peek grep mode + get_issues filtering/read-one (ctxpeek 1.0) - #32

Merged
tamimbinhakim merged 1 commit into
mainfrom
feat/peek-grep-issues-v1
Jun 5, 2026
Merged

feat: peek grep mode + get_issues filtering/read-one (ctxpeek 1.0)#32
tamimbinhakim merged 1 commit into
mainfrom
feat/peek-grep-issues-v1

Conversation

@tamimbinhakim

Copy link
Copy Markdown
Collaborator

Cuts ctxpeek 1.0 and lands two feature areas plus stabilization. Tool surface stays at 10 tools.

peek — grep mode + limits + edge cases

  • Grep mode: pass query to find every match inside a named file and get each back with context lines around it. Literal by default; regex: true for patterns; ignore_case (default true). Overlapping windows merge into single chunks. Deterministic, single-file grep — no vectors, so it stays inside the project's stated "no semantic search" philosophy.
  • Limits: max_line_length truncates over-long lines (both modes) so a minified/data line can't blow the context window; max_matches caps grep results with an explicit "+N more" note; n (head mode) is capped.
  • Edge cases: binary files (NUL byte in first 8 KB) and empty files are reported, never dumped; no-match queries return a friendly note (not an error); invalid regex reports the syntax error; ~tokens reflects the returned payload.
  • Logic extracted to pure, unit-tested format/peekText.ts.

get_issues — filtering + read-one

  • Filters: labels, author, assignee, since, sort/order (updated/created/comments) on top of existing state/type. REST + GraphQL now share one query builder (fetch/issueQuery.ts) so filtering behaves identically on both paths.
  • Read one: pass number to fetch a single issue/PR's full body plus its first comments comments, via new GithubRestClient.getIssue / getIssueComments.

Stabilization

  • +31 unit tests (123 total). Build, typecheck, lint (js/py/md), and MCP integration-boot all green.
  • Verified end-to-end against live repos (head/grep/no-match/binary; issue read-one + filtered search).
  • Docs updated: docs/reference/tools.md, README.md, docs/internals/architecture.md.

Release

Changeset bumps ctxpeek 0.1.3 → 1.0.0 (major). On merge, the changesets action opens a "version packages" PR; merging that publishes ctxpeek@1.0.0 to npm via trusted publishing (OIDC provenance).

🤖 Generated with Claude Code

peek:
- grep mode (`query`, literal or `regex`) returns every match in a named
  file with `context` lines around it — deterministic, single-file,
  no vectors
- per-line cap (`max_line_length`) and match cap (`max_matches`)
- binary / empty files reported not dumped; no-match returns a note,
  not an error; `~tokens` reflects the returned payload
- logic extracted to pure, unit-tested format/peekText.ts

get_issues:
- filters: labels, author, assignee, since, sort/order (REST + GraphQL
  share one query builder in fetch/issueQuery.ts)
- read-one mode (`number`) returns full body + top comments via new
  GithubRestClient.getIssue / getIssueComments

Tool surface stays at 10. Adds 31 unit tests; lint/typecheck/build green.
Changeset bumps ctxpeek 0.1.3 -> 1.0.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tamimbinhakim
tamimbinhakim merged commit 625892c into main Jun 5, 2026
17 of 18 checks passed
@tamimbinhakim
tamimbinhakim deleted the feat/peek-grep-issues-v1 branch June 5, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant