claude-devtools:markdown-search

claude-devtools:markdown-search is a command for Claude Code from matt1398/claude-devtools. It costs 43 tokens per session (1,314 once invoked), scanned A, original, MIT.

A technical guide to searching Markdown text in the current conversation or across saved sessions. Markdown is formatted text that can include headings, links, code, and emphasis.

In plain words
What is it for?
Use it when changing the search bar, search highlighting, in-session search, or cross-session session search.
Why use it?
It clarifies which conversation content is searchable and how individual matches are tracked and highlighted, avoiding incorrect search behavior.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/matt1398/claude-devtools/markdown-search-logic
Clone the repo
git clone --depth 1 https://github.com/matt1398/claude-devtools

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for claude-devtools:markdown-search

README.md
[![agentmods](https://agentmods.dev/badge/commands/matt1398/claude-devtools/markdown-search-logic.svg)](https://agentmods.dev/commands/matt1398/claude-devtools/markdown-search-logic)
Your own site
<a href="https://agentmods.dev/commands/matt1398/claude-devtools/markdown-search-logic"><img src="https://agentmods.dev/badge/commands/matt1398/claude-devtools/markdown-search-logic.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,314 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.01314
Opus 5 $0.00022 $0.00657
Sonnet 5 $0.00009 $0.00263
Haiku 4.5 $0.00004 $0.00131

Measured 4d ago against content hash 303cad546167, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

claude-devtools:markdown-search scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/devtools/markdown-search-logic.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Markdown Search Logic

How in-session and cross-session markdown search works end-to-end.

Scope

Current in-session search intentionally covers:

  • User message markdown text
  • AI lastOutput text markdown

Current in-session search intentionally excludes:

  • System items
  • Tool result text blocks
  • Thinking/subagent/internal display items

Primary source files:

  • src/renderer/components/search/SearchBar.tsx
  • src/renderer/store/slices/conversationSlice.ts
  • src/renderer/components/chat/ChatHistory.tsx
  • src/renderer/components/chat/searchHighlightUtils.ts
  • src/shared/utils/markdownTextSearch.ts
  • src/main/services/discovery/SessionSearcher.ts

Core Data Model

SearchMatch (renderer store) in src/renderer/store/types.ts:

  • itemId: chat group id (user-*, ai-*)
  • itemType: user | ai
  • matchIndexInItem: 0-based index inside one searchable item
  • globalIndex: 0-based index across all matches
  • displayItemId: optional (lastOutput for AI output)

Important distinction:

  • matchIndexInItem is local to one item.
  • currentSearchIndex is global position in the search result list.

Pipeline Overview

1) Query input and initial match generation

SearchBar updates the query with tab-scoped conversation data:

  • setSearchQuery(query, conversation) in src/renderer/components/search/SearchBar.tsx

setSearchQuery in src/renderer/store/slices/conversationSlice.ts:

  • Scans conversation items
  • Uses findMarkdownSearchMatches (shared parser logic) per searchable item
  • Builds initial searchMatches, searchResultCount, currentSearchIndex

2) Rendering highlights

Search highlighting is rendered in markdown component trees through:

  • createSearchContext(...) in src/renderer/components/chat/searchHighlightUtils.ts
  • highlightSearchInChildren(...) in src/renderer/components/chat/searchHighlightUtils.ts

Each rendered highlight mark includes:

  • data-search-item-id
  • data-search-match-index
  • data-search-result (current or match)

Read the full file on GitHub · 180 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 180 lines · 43 tokens per session scan A 303cad546167

Subscribe to this mod's changes

claude-devtools:markdown-search is a command published in the GitHub repository matt1398/claude-devtools (3,892 stars, last pushed 3mo ago), licensed MIT. It adds 43 tokens to every session and 1,314 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.