grepai enables AI agents to perform semantic search and call graphs locally, benefiting developers and operations teams. It connects to codebases and developer tools, allowing for efficient code search and analysis without relying on external services.
git clone https://github.com/yoanbernabeu/grepai.gitgrepai is an innovative automation skill designed for AI agents, particularly Claude Code, that facilitates semantic search and call graph generation for enhanced code understanding. This skill operates entirely locally, allowing developers to quickly search through large codebases and locate critical components such as authentication logic or error handling patterns using natural language queries. By integrating grepai into your workflow, you can streamline your code navigation and improve overall efficiency. One of the key benefits of grepai is its ability to save time by automating the process of locating dependencies and understanding function calls. For instance, developers can trace function calls to identify dependencies before making changes to critical code, reducing the risk of introducing bugs. Additionally, grepai can automatically keep your code index updated with a file watcher, ensuring that your searches remain accurate and relevant. This capability is particularly useful for teams managing large and complex codebases. This skill is ideal for developers, product managers, and AI practitioners who are looking to enhance their productivity and code comprehension. With a difficulty level classified as beginner, grepai can be implemented in approximately 30 minutes, making it accessible for teams of all skill levels. Its integration with AI agents like Claude Code further enhances its utility, allowing for a more intelligent and responsive development environment. Practical use cases for grepai include quickly locating authentication logic in a large codebase, searching for error handling patterns across projects, and understanding dependencies before making significant changes. By adopting grepai, teams can leverage AI automation to facilitate workflow automation, ultimately leading to improved code quality and faster project delivery. As the demand for efficient coding practices grows, incorporating grepai into your AI-first workflows can provide a competitive edge.
1. **Install grepai**: Run `pip install grepai` or clone from [grepai GitHub repo](https://github.com/grepai/grepai). Ensure your project is a Git repository (grepai uses Git history for filtering). 2. **Run the Initial Analysis**: Execute `grepai analyze --project-path /path/to/project --scope "last 30 days" --exclude "tests/*"` to generate a baseline call graph. Use `--verbose` for detailed logs. 3. **Refine the Search**: Narrow results with semantic queries. For example: - `grepai search "functions that handle payment failures" --impact "high"` - `grepai callgraph --start-module "PaymentProcessor" --depth 3` 4. **Export and Share**: Generate reports in JSON or Markdown with `grepai export --format markdown --output report.md`. Share with your team for collaborative debugging. 5. **Automate in CI/CD**: Integrate grepai into your pipeline by adding a step like: ```yaml - name: Run grepai analysis run: | grepai analyze --project-path . --scope "last commit" --output ci_report.json grepai export --input ci_report.json --format json --output artifacts/callgraph.json ``` **Tips for Better Results:** - Use `--language` to specify the codebase language (e.g., `python`, `javascript`). - Combine with `ripgrep` (`rg`) for faster file filtering: `grepai analyze --project-path . --scope "last week" | rg "error|fail"`. - For large codebases, run grepai on a subset of files first (e.g., `--include "src/payment/*").
Quickly locate authentication logic in a large codebase by searching for 'authentication logic'.
Trace function calls to understand dependencies before making changes to critical code.
Automatically keep your code index updated with a file watcher to ensure search accuracy.
Integrate grepai with AI agents like Claude Code to enhance code understanding and reduce input tokens.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/yoanbernabeu/grepaiCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use grepai to perform a semantic search and call graph analysis on the [PROJECT_NAME] codebase. Find all functions or methods that interact with [SPECIFIC_MODULE_OR_CLASS] and trace their call paths. Focus on files modified in the last [TIME_PERIOD] and exclude test files. Generate a report with the top 5 most critical call chains and their potential impact on [SPECIFIC_FEATURE_OR_COMPONENT].
### Semantic Search & Call Graph Analysis Report for Project: **E-Commerce Platform** **Scope:** Analyzed 12,456 lines of code across 147 files (last modified in the past 30 days). Excluded 32 test files. #### **Critical Call Chains Identified** 1. **`PaymentProcessor` → `OrderService` → `InventoryManager`** - **Impact:** High. This chain handles real-time inventory updates during checkout. A latency issue in `InventoryManager.updateStock()` could block payment processing, leading to abandoned carts. - **Files Involved:** `services/payment.py`, `services/order.py`, `models/inventory.py` - **Modification History:** All 3 files were updated in the last 2 weeks to support a new "reserve inventory" feature. 2. **`UserAuth` → `SessionManager` → `LoggingMiddleware`** - **Impact:** Medium. Authentication failures in `SessionManager` could trigger excessive logging, degrading performance during peak traffic. - **Files Involved:** `auth/user_auth.py`, `utils/session.py`, `middleware/logging.py` - **Modification History:** `SessionManager` was refactored to use Redis instead of in-memory storage. 3. **`DiscountEngine` → `CartCalculator` → `TaxService`** - **Impact:** Low. Discount calculations are computationally expensive but rarely fail. However, a bug in `TaxService` could misapply discounts. - **Files Involved:** `discounts/engine.py`, `cart/calculator.py`, `tax/service.py` - **Modification History:** `TaxService` was updated to comply with new regional tax laws. #### **Recommendations** - **Immediate:** Add unit tests for `InventoryManager.updateStock()` to catch edge cases where stock levels become negative. - **Short-term:** Profile the `PaymentProcessor` → `OrderService` chain for latency bottlenecks. Consider caching frequent inventory checks. - **Long-term:** Audit `SessionManager` for memory leaks post-Redis migration. Monitor logging middleware during high-traffic events. **Next Steps:** 1. Review the call graph visualization (attached) for deeper insights into nested function calls. 2. Run a targeted grepai query to find all error-handling paths in the `PaymentProcessor` chain. 3. Schedule a code review for the `DiscountEngine` to ensure tax law compliance. --- *Analysis completed using grepai v1.2.3. Total execution time: 4.2 seconds.*
Cloud ETL platform for non-technical data integration
IronCalc is a spreadsheet engine and ecosystem
Get more done every day with Microsoft Teams – powered by AI
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan