Skip to content

Conversation

wonderwhy-er
Copy link
Owner

Code Search Feature

Overview

This PR adds advanced code search functionality to the Claude Server Commander, allowing Claude to search through code files with precision and contextual awareness using VS Code RipGrep

Features

  • Implementation of a powerful code search tool using ripgrep for high-performance text pattern matching
  • Support for regex pattern searching across file contents
  • Customizable search parameters including:
    • File pattern filtering
    • Case sensitivity controls
    • Result limits
    • Context line display
    • Hidden file inclusion/exclusion
  • Integration with existing server security measures (path validation)

Technical Implementation

  • Added new search.ts module with interfaces and functions for code searching
  • Extended schema definitions with SearchCodeArgsSchema
  • Updated server request handlers to support the new search_code tool
  • Added ripgrep dependency (@vscode/ripgrep) for optimal performance

Benefits

  • Enables Claude to analyze codebases more effectively
  • Helps users find specific patterns or code snippets in their projects
  • Improves developer workflow for code exploration and understanding
  • Provides VS Code-like search functionality through the Claude interface

Testing Notes

The feature includes comprehensive error handling and graceful degradation to ensure reliable performance across different environments.

@wonderwhy-er wonderwhy-er merged commit 04991a0 into main Mar 24, 2025
@serg33v serg33v deleted the CodeTextSearch branch May 29, 2025 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant