# Code Search

> Search ComfyUI codebase and custom nodes using the comfy-codesearch service. Use when the user wants to find code examples, search for specific functions, or explore ComfyUI repositories.

- Skill: `comfy-org/code-search` (Agent Skill)
- Install (CLI): `npx skillmds@latest add comfy-org/code-search`
- Raw SKILL.md: https://api.skillmd.com/api/skills/comfy-org/code-search/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Comfy-Org (https://skillmd.com/u/comfy-org)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/comfy-org/code-search

---


# ComfyUI Code Search

This skill searches through ComfyUI codebase and custom nodes using the comfy-codesearch service.

## Usage

```bash
prbot code search -q "<SEARCH_QUERY>" [--repo <REPO>] [--path <PATH>]
```

## Parameters

- `-q, --query` (required): Search query text
- `--repo` (optional): Filter by repository (e.g. `Comfy-Org/ComfyUI`)
- `--path` (optional): Filter by file path pattern (e.g. `python`)

## Search Syntax

The search query supports special filters:

- `repo:owner/name` - Search within a specific repository
- `path:pattern` - Search within specific file paths

## Examples

```bash
# Search for binarization features
prbot code search -q "binarization"

# Search in specific repository
prbot code search -q "last_node_id" --repo Comfy-Org/ComfyUI

# Search with path filter
prbot code search -q "last_node_id" --repo Comfy-Org/ComfyUI --path python

# Complex search with inline filters
prbot code search -q "repo:Comfy-Org/ComfyUI path:python last_node_id"
```

## Output Format

Returns JSON with search results containing:

- Repository name and URL
- File path and line number
- Code snippet with match context
- GitHub URL to the exact match

## Tips

1. Use quotes around multi-word queries
2. Combine `--repo` and `--path` filters for targeted searches
3. Pipe output to `jq` for JSON parsing: `prbot code search -q "test" | jq .results`
4. Check match URLs to jump directly to code on GitHub

## Notes

- Requires `comfy-codesearch` CLI to be installed
- Requires CS_ORIGIN and CS_TOKEN environment variables
- Searches across ComfyUI core and custom nodes registry

