Get the FREE Ultimate OpenClaw Setup Guide →

morph-search

Scanned
npx machina-cli add skill parcadei/Continuous-Claude-v3/morph-search --openclaw
Files (1)
SKILL.md
1.6 KB

Morph Codebase Search

Fast, AI-powered codebase search using WarpGrep. 20x faster than traditional grep.

When to Use

  • Search codebase for patterns, function names, variables
  • Find code across large codebases quickly
  • Edit files programmatically

Usage

Search for code patterns

uv run python -m runtime.harness scripts/mcp/morph_search.py \
    --search "authentication" --path "."

Search with regex

uv run python -m runtime.harness scripts/mcp/morph_search.py \
    --search "def.*login" --path "./src"

Edit a file

uv run python -m runtime.harness scripts/mcp/morph_search.py \
    --edit "/path/to/file.py" --content "new content"

Parameters

ParameterDescription
--searchSearch query/pattern
--pathDirectory to search (default: .)
--editFile path to edit
--contentNew content for file (use with --edit)

Examples

# Find all async functions
uv run python -m runtime.harness scripts/mcp/morph_search.py \
    --search "async def" --path "./src"

# Search for imports
uv run python -m runtime.harness scripts/mcp/morph_search.py \
    --search "from fastapi import" --path "."

vs ast-grep

ToolBest For
morph/warpgrepFast text/regex search (20x faster)
ast-grepStructural code search (understands syntax)

MCP Server Required

Requires morph server in mcp_config.json with MORPH_API_KEY.

Source

git clone https://github.com/parcadei/Continuous-Claude-v3/blob/main/.claude/skills/morph-search/SKILL.mdView on GitHub

Overview

Morph-search delivers AI-powered, WarpGrep-based codebase search to locate patterns, function names, and variables across large projects. It claims 20x faster performance than grep, helping developers quickly discover code and refactor. It can also edit files programmatically when needed.

How This Skill Works

The tool uses WarpGrep to perform fast text and regex searches across a repository via a Python harness. You invoke morph_search.py with --search (and optional --path) to locate results, or use --edit with --content to modify files. A Morph server is required, configured through MORPH_API_KEY in mcp_config.json for full functionality.

When to Use It

  • Search codebase for patterns, function names, and variables
  • Find code across large codebases quickly
  • Use regex-based searches to capture complex patterns (e.g., def.*login)
  • Edit a file programmatically using --edit and --content
  • Locate imports or specific dependency usage across the project

Quick Start

  1. Step 1: Ensure Morph server is configured with MORPH_API_KEY in mcp_config.json
  2. Step 2: Run a search, e.g., uv run python -m runtime.harness scripts/mcp/morph_search.py --search "pattern" --path "."
  3. Step 3: (Optional) Edit a file by providing --edit and --content to apply changes

Best Practices

  • Use precise search terms and, when needed, regex patterns to narrow results
  • Limit scope with --path to reduce noise and speed up results
  • Validate results before applying edits; back up files when using --edit
  • Test regex queries on a small subset before running across the whole codebase
  • Ensure MORPH_API_KEY is configured in mcp_config.json for MCP-enabled searches

Example Use Cases

  • Find all async functions: uv run python -m runtime.harness scripts/mcp/morph_search.py --search "async def" --path "./src"
  • Search for imports: uv run python -m runtime.harness scripts/mcp/morph_search.py --search "from fastapi import" --path "."
  • Locate authentication-related code: uv run python -m runtime.harness scripts/mcp/morph_search.py --search "authentication" --path "."
  • Regex function pattern: uv run python -m runtime.harness scripts/mcp/morph_search.py --search "def.*login" --path "./src"
  • Edit a file quickly: uv run python -m runtime.harness scripts/mcp/morph_search.py --edit "/path/to/file.py" --content "new content"

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers