Agentic AI Atlasby a5c.ai
OverviewWikiGraphFor AgentsEdgesSearchWorkspace
/
GitHubDocsDiscord
iiRecord
Agentic AI Atlas · GAP-TOOLS-035: Grep Output Modes and Context Params
page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-035a5c.ai
Search record views/
Record · tabs

Available views

II.Record viewspp. 1 - 1
overviewarticlejsongraph
III.Related pagespp. 1 - 1
II.
Page reference

page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-035

Reading · 2 min

GAP-TOOLS-035: Grep Output Modes and Context Params reference

Enhance babysitter's grep agentic tool to match CC's GrepTool feature set:

Pagewiki/docs/harness-features-backlog/gaps/tools-capabilities/GAP-TOOLS-035.mdOutgoing · 0Incoming · 1

GAP-TOOLS-035: Grep Output Modes and Context Params

FieldValue
Categorytools-capabilities
PriorityMedium
EffortS
StatusMissing

Description

Enhance babysitter's grep agentic tool to match CC's GrepTool feature set: output mode selection, separate before/after context lines, and line number toggle.

Current State

Babysitter's grep tool (in agenticTools.ts) wraps ripgrep with these params: pattern, path, glob, type, i (case-insensitive), context (lines around match), limit, offset, multiline.

Always returns matching lines with line numbers. No way to request file paths only, match counts, or separate before/after context.

Target State

Add these params to the grep agentic tool:

(file paths only -- maps to rg -l), 'count' (match counts per file -- maps to rg -c). Default: 'files_with_matches' (matches CC).

Maps to rg -n / rg --no-line-number.

currently controls post-processing slice.

  • **output_mode**: 'content' (matching lines, current behavior), 'files_with_matches'
  • **before_context** (or -B): Lines to show before each match (maps to rg -B).
  • **after_context** (or -A): Lines to show after each match (maps to rg -A).
  • **line_numbers** (or -n): Boolean toggle for line numbers in output. Default true.
  • **head_limit**: Max output lines/entries. Default 250. Distinct from limit which

Implementation: straightforward ripgrep flag mapping. Each param maps directly to an rg flag. No architectural changes needed.

Dependencies

  • None.

Key Files

ComponentPath
Agentic toolspackages/sdk/src/harness/agenticTools.ts
CC GrepToolsrc/tools/GrepTool/GrepTool.ts

Recommendation

Phase 1. Small effort, high value. The output_mode param is especially important -- files_with_matches mode is CC's default and is critical for codebase exploration.

Article source

The article body is owned directly by this record.

Related pages

No related wiki pages for this record.

Shortcuts

Open overview
Open JSON
Open graph