II.
Page JSON
Structured · livepage:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-035
GAP-TOOLS-035: Grep Output Modes and Context Params json
Inspect the normalized record payload exactly as the atlas UI reads it.
{
"id": "page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-035",
"_kind": "Page",
"_file": "wiki/docs/harness-features-backlog/gaps/tools-capabilities/gap-tools-035.md",
"_cluster": "wiki",
"attributes": {
"nodeKind": "Page",
"sourcePath": "docs/harness-features-backlog/gaps/tools-capabilities/GAP-TOOLS-035.md",
"sourceKind": "repo-docs",
"title": "GAP-TOOLS-035: Grep Output Modes and Context Params",
"displayName": "GAP-TOOLS-035: Grep Output Modes and Context Params",
"slug": "docs/harness-features-backlog/gaps/tools-capabilities/gap-tools-035",
"articlePath": "wiki/docs/harness-features-backlog/gaps/tools-capabilities/GAP-TOOLS-035.md",
"article": "\n# GAP-TOOLS-035: Grep Output Modes and Context Params\n\n| Field | Value |\n|-------|-------|\n| Category | tools-capabilities |\n| Priority | Medium |\n| Effort | S |\n| Status | Missing |\n\n## Description\nEnhance babysitter's `grep` agentic tool to match CC's GrepTool feature set:\noutput mode selection, separate before/after context lines, and line number toggle.\n\n## Current State\nBabysitter's `grep` tool (in `agenticTools.ts`) wraps ripgrep with these params:\n`pattern`, `path`, `glob`, `type`, `i` (case-insensitive), `context` (lines around\nmatch), `limit`, `offset`, `multiline`.\n\nAlways returns matching lines with line numbers. No way to request file paths only,\nmatch counts, or separate before/after context.\n\n## Target State\nAdd these params to the `grep` agentic tool:\n\n- **`output_mode`**: `'content'` (matching lines, current behavior), `'files_with_matches'`\n (file paths only -- maps to `rg -l`), `'count'` (match counts per file -- maps to\n `rg -c`). Default: `'files_with_matches'` (matches CC).\n- **`before_context`** (or `-B`): Lines to show before each match (maps to `rg -B`).\n- **`after_context`** (or `-A`): Lines to show after each match (maps to `rg -A`).\n- **`line_numbers`** (or `-n`): Boolean toggle for line numbers in output. Default true.\n Maps to `rg -n` / `rg --no-line-number`.\n- **`head_limit`**: Max output lines/entries. Default 250. Distinct from `limit` which\n currently controls post-processing slice.\n\nImplementation: straightforward ripgrep flag mapping. Each param maps directly to an\n`rg` flag. No architectural changes needed.\n\n## Dependencies\n- None.\n\n## Key Files\n| Component | Path |\n|-----------|------|\n| Agentic tools | `packages/sdk/src/harness/agenticTools.ts` |\n| CC GrepTool | `src/tools/GrepTool/GrepTool.ts` |\n\n## Recommendation\nPhase 1. Small effort, high value. The `output_mode` param is especially important --\n`files_with_matches` mode is CC's default and is critical for codebase exploration.\n",
"documents": []
},
"outgoingEdges": [],
"incomingEdges": [
{
"from": "page:docs-harness-features-backlog",
"to": "page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-035",
"kind": "contains_page"
}
]
}