Answer: Use the grep tool, which searches file contents and returns paths, line numbers, and previews; its pattern uses regular-expression syntax unless literal is true, and you can narrow a search with path, include, caseSensitive, or limit. Status: Overdue (check was due 2026-11-20T13:37:30Z and has not succeeded) Entry: tool/opencode/features/grep-search-contents Revision: 1 Digest: sha256:99ddb4668cdd8f9f (changes whenever the content changes) Timeline: Created: 2026-11-13T03:58:17Z Last changed: 2026-11-13T03:58:17Z Last verified: 2026-11-19T13:37:30Z Next check: 2026-11-20T13:37:30Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of tool function | searches file contents and returns paths, line numbers, and previews | | [1] | 2026-11-19 pattern syntax | regular-expression syntax unless literal is true | | [1] | 2026-11-19 narrowing options | path , include , caseSensitive , or limit | | [1] | 2026-11-19 default limit | 100 matching lines | matching lines | [1] | 2026-11-19 search timeout | 30 seconds | seconds | [1] | 2026-11-19 Sources: [1] opencode. "Tools | OpenCode". https://opencode.ai/docs/tools/ Role: primary. Accessed: 2026-11-19T13:37:30Z Quote: "grep searches file contents and returns paths, line numbers, and previews." (Supports: tool function) Quote: "Its pattern uses regular-expression syntax unless literal is true." (Supports: pattern syntax) Quote: "Narrow a search with path , include , caseSensitive , or limit ." (Supports: narrowing options) Quote: "The default limit is 100 matching lines" (Supports: default limit) Quote: "the search timeout is 30 seconds." (Supports: search timeout) Snapshot SHA-256: 87641bde20c614458e91d184df4584731eb549e55efd40138a7bd7aee834e14f (captured 2026-11-13T03:58:16Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:58:17Z, so the values verified then were kept. Cross-check: not-available at 2026-11-19T13:37:30Z. No independent second source is configured for this entry Last successful check: 2026-11-19T13:37:30Z Last attempt: 2026-11-19T13:37:30Z Notes and limitations: Extracted automatically from a single official source (section "Grep"). Related: https://latestn.com/tool/opencode/features/opencode-interfaces What interfaces does opencode come in (CLI, desktop, web)? https://latestn.com/tool/opencode/features/providers-api-endpoints Which API endpoints does the opencode Console Providers API support? https://latestn.com/tool/opencode/features/read-file-line-range How do I read a specific range of lines from a file with opencode's read tool? https://latestn.com/tool/opencode/features/effect-plugin-hooks What hooks does the opencode Effect plugin API provide for sessions, shell, and tools? https://latestn.com/tool/opencode/features/effect-plugin-lifecycle-scope What is the plugin lifecycle and Scope in opencode's Effect plugin API? https://latestn.com/tool/opencode/features/glob-file-patterns How do I find files by pattern with opencode's glob tool? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:58:17Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/features/grep-search-contents/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/features/grep-search-contents POST: https://latestn.com/dispute/tool/opencode/features/grep-search-contents with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/features/grep-search-contents?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I search file contents with opencode's grep tool? Revision 1, last verified 2026-11-19T13:37:30Z. https://latestn.com/tool/opencode/features/grep-search-contents (accessed 2026-11-21T09:54:12Z). @misc{LatestN_tool_opencode_features_grep_search_contents_r1, title = {How do I search file contents with opencode's grep tool?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/features/grep-search-contents}}, note = {Revision 1; digest sha256:99ddb4668cdd8f9f; last verified 2026-11-19T13:37:30Z; accessed 2026-11-21T09:54:12Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/features/grep-search-contents