Skip to content

perf: optimize core search/index functions for Claude workflows#14

Open
DevvGwardo wants to merge 5 commits into
MisterGuy420:mainfrom
DevvGwardo:perf/claude-function-optimizations-20260302-182809
Open

perf: optimize core search/index functions for Claude workflows#14
DevvGwardo wants to merge 5 commits into
MisterGuy420:mainfrom
DevvGwardo:perf/claude-function-optimizations-20260302-182809

Conversation

@DevvGwardo

Copy link
Copy Markdown
Contributor

Summary

This PR applies targeted performance and correctness improvements across the core indexing/search stack used by Claude workflows.

Changes

peppy/searcher.py

  • Added max_results support to search_symbols() with early termination to avoid full index scans.
  • Improved file-pattern matching against relative path, basename, and full path.
  • Fixed get_file_symbols() relative path handling by resolving relative inputs from codebase root.
  • Reduced grep overhead and only builds context payload when requested.

peppy/interface.py

  • find_symbols() now passes limit down to search layer (max_results) so limiting happens during search, not after.
  • Tightened get_overview() entrypoint searches with narrower patterns and smaller per-pattern caps.
  • Reuses precomputed symbol/file-extension stats when available.

peppy/server.py

  • Extended search_symbols MCP schema with max_results.
  • Wired max_results through tool execution into searcher for backend compute control.

peppy/parsers.py

  • Fixed parser traversal context leakage: class context is now scoped per branch so sibling nodes are not misclassified.

peppy/cache.py

  • Upgraded cache key hashing to sha256.
  • Added optional TTL support (ttl_seconds).
  • Added freshness signature validation to avoid stale index reuse when indexed files change.

Why

  • Reduce unnecessary work on large repositories.
  • Improve token/time efficiency for planning and symbol discovery in Claude-assisted workflows.
  • Improve correctness (symbol typing + file lookup + stale cache behavior).

Compatibility

  • Backward compatible API changes (new optional args).
  • Existing workflows continue to work with improved performance/correctness.

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