Skip to content

cleaner v1.1.4 Release (targeting LLM)

Latest

Choose a tag to compare

@perghosh perghosh released this 22 Nov 03:28
· 13 commits to main since this release

πŸ” Cleaner – Powerful Code Search, now built for LLM agents

Cleaner is a fast, lightweight code search tool that helps you find exactly what you're looking for in your codebase – without the noise or slowdown.

πŸ€– New: LLM mode (-llm)

Cleaner can now adapt both its output and its help for LLM agents (Copilot, Claude, etc.). Pinpointing the exact lines or blocks needed, and harvesting surrounding context, gives a model far less noise than reading whole files, and in practice better generated code.

  • -llm flag on list, find, count and dir
    • list / find: output as path:line - [text]; with --context, match lines are marked with >
    • dir: compact output, a Current Directory: line followed by relative paths
    • count: per-file match counts for scoping
  • LLM help: cleaner help <list|find|count|dir> -llm prints a compact help written for agents – only the options an agent needs, the exact output format, and examples
  • Flexible context: --context N or --context S,N (offset, including negative, e.g. --context -2,5)
  • Agent-friendly workflow: dir β†’ count β†’ list/find β†’ edit, with bounded output (--max, --page-size)
  • Ready-to-use instructions: sample instruction text for your agent instruction file (e.g. copilot-instructions.md) is in the documentation

Advanced Search Capabilities:

  • Two search modes: Line-based (list) for quick pattern matching, or multi-line (find) for complex logic searches across your entire codebase
  • Smart filtering: Search only within code, comments, or strings – ignore what you don't need
  • Pattern matching: Support for wildcards, regex patterns, and multiple simultaneous search terms
  • Key-value extraction: Find and extract structured data like TODO descriptions, Doxygen tags, or configuration values
  • Context-aware: See surrounding lines, search between markers (e.g., @code...@endcode), or filter results with scripting expressions
  • IDE integration: Visual Studio and VS Code compatible with clickable file paths in output
  • Recursive searching: Deep scan folders up to 16 levels deep
  • Scriptable filtering: Use built-in math, logic, and string functions to filter exactly what you need

Whether you're hunting down technical debt, extracting documentation, or analyzing code patterns, Cleaner helps you search smarter, so you can clean better.

Documentation Β· LLM section

More gifs: #4

Sample use

Adding instructions to copilot

## Searching the code with cleaner

Use `C:\Tools\cleaner.exe` for ALL code searching and file listing, instead of reading whole files,
guessing, or using PowerShell `dir` / `Get-ChildItem`.
Call it from PowerShell by full path: `& 'C:\Tools\cleaner.exe' <command> ...`

### Commands
- `list`: single-line matches (names, calls, declarations). `find` takes the same options but matches across lines
- `count`: matches per file. Use for scoping only, then use `list` or `find` for exact lines before editing
- `dir`: list files (not folders). With `--pattern` only files containing the text

### Get the options before the first use
Before using a command for the first time in a chat, run
`& 'C:\Tools\cleaner.exe' help <list|count|dir> -llm` (`list` also covers `find`) and follow its output.
Do not guess option names: unknown options print help and `ERROR: Unknown option`.

### Always
- Filter is the first positional argument, e.g. `"*.h;*.cpp"`. Use `--filter` if it is not first.
- Set `--current-directory "<folder>"`. Add `-R` to include subfolders.
- Bound output: `--max N` for `list`, `find` and `dir`; `--page-size N` for `count`.
- Use `-llm` (single dash) on every command. With `list` and `find`, also use `--context N` to read surrounding code.
- Separate several literal patterns with `;`. Repeat `--rpattern` for several regex expressions.

### Output
`list` and `find`: lines look like `path:line - [text]`. `dir`: a `Current Directory:` line, then paths relative to it.
Ignore progress lines ("Find in files: ..."). The exit code is often -1 even when the output is correct, so judge success from the output.