Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    retrieval harness

    1

    Merge exact search, semantic search, and call-graphs into a token-budgeted context for large-scale code refactoring.

    Free

    Security scanned
    retrieval harness

    retrieval harness

    Example session with this skill installed

    I need to rename the process_transaction function. Find all its callers, the implementation, and any related test files.

    • Read your context and instructions
    • Compiled the retrieval harness

    I have executed the retrieval harness to map the dependencies for process_transaction. The search combined exact string matching, semantic analysis of the transaction logic, and a call-graph traversal to identify where this function is invoked and tested.

    Retrieval Results

    File PathLinesContext TypeRelevance Score
    src/core/gateway.py142-168Implementation1.00
    src/api/endpoints.py45-52Direct Caller0.92
    src/workers/queue_processor.py89-104Direct Caller0.88
    tests/unit/test_gateway.py12-40Related Tests0.85
    src/models/transaction.py10-25Semantic Match0.72

    Context Excerpts

    
    # src/core/gateway.py:142-168
    def process_transaction(self, tx_id: str, amount: Decimal) -> bool:
        """Core logic for validating and committing transactions."""
        # ... logic ...
    
    # src/api/endpoints.py:45-52
    @app.post("/tx")
    def handle_request(data: TxSchema):
        return gateway.process_transaction(data.id, data.amount)
    

    Next steps

    1. Review the trace.html in .rh/trace/latest/ to see if the semantic engine dropped any low-confidence matches.
    2. Run rh doctor to ensure the graph index isn't stale before starting the rename.
    3. Update the function signature in src/core/gateway.py and propagate changes to the identified callers in endpoints.py and queue_processor.py.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Large codebases make it difficult to find where logic actually lives. Relying on simple keyword search often misses semantic matches or fails to capture the necessary call graph context for a safe refactor.

    What it does

    • Multi-engine retrieval combines ripgrep for exact matches with ColGREP for semantic search.
    • Call-graph expansion identifies callers, callees, and related test files for a specific symbol.
    • Token-budgeted output returns relevant excerpts formatted as path:start-end to stay within LLM context limits.
    • Context judging uses a local Ollama model to filter out irrelevant search results before presenting them.
    • Trace reporting generates a local HTML trace showing why specific code blocks were kept or dropped.

    How it works

    1. Initialize the repository by running rh init to build semantic and graph indexes.
    2. Verify tool health and index freshness using the rh doctor command.
    3. Execute the retrieval by providing a natural language task description via rh retrieve --task.
    4. Review the token-budgeted Markdown context or inspect the trace log in .rh/trace/.

    Frameworks & tools

    Requires Python 3.11+, uv, and ripgrep. Uses ColGREP for vector search and codebase-memory-mcp for graph analysis. Optional local filtering requires Ollama.

    Why this beats prompting it yourself

    Manual searching often misses the "hidden" dependencies or non-obvious callers that lead to breaking changes. This skill automates the discovery of the entire execution path, providing a complete map of the code's impact rather than just a list of text matches.

    Use cases

    • Map dependencies and callers before renaming a core library function.
    • Locate the implementation and relevant tests for a specific feature in an unfamiliar repo.
    • Gather context for multi-file architectural changes without blowing the token budget.

    Known limitations

    Requires local installation of Python, uv, ripgrep, and ColGREP. Indexes must be manually updated if they become stale. Local judging requires a running Ollama instance.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Requires Python 3.11+, uv, ripgrep, and ColGREP binary. Indexes must be manually refreshed via rh init when code changes. Local judging requires Ollama.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 5 days ago

    • Free with an Agensi account

    Software
    Python

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Listed5 days ago

    What's inside

    Frequently Asked Questions

    Retrieval Harness combines keyword search, semantic search, and call-graph analysis to find not just where a term appears, but the entire execution path and dependencies affected by a code change.

    You will need Python 3.11+, the uv package manager, and ripgrep; additionally, a local Ollama instance is required if you want to use the automated context-judging feature.

    The tool calculates a 'token budget' for your LLM context and uses a local model to rank and filter results, ensuring only the most relevant code excerpts are included.

    It is designed to work with any AI agent that can execute shell commands, though it is particularly effective for agents used in complex, multi-file refactoring tasks.

    You receive the full Python source code for the harness, instructions for building the semantic and graph indexes, and the HTML trace reporting module.

    While the initial index is built during setup, you should run the 'rh init' command whenever there are significant changes to your codebase to ensure the semantic and graph data stays current.

    New in Agents & Orchestration

    Free