{"slug": "code-discovery-how-agents-find-and-understand-dependency-code", "title": "Code discovery: how agents find and understand dependency code", "summary": "GitHits CLI 0.38.1, released November 3, 2026, lets coding agents resolve a package version to an exact source revision and read dependency code, as shown in a walkthrough where an agent looked up httpx 0.28.1 and found that line 246 of httpx/_config.py sets DEFAULT_TIMEOUT_CONFIG to a five-second timeout. The tool's deterministic lookup commands (grep, exact-text match, file listing, file reading) pin results to a commit such as github:encode/httpx@26d48e06, while its research tool runs multi-step investigations and returns an explanation with references. The walkthrough notes that hosted documentation is not pinned to a selected package version, so agents working with older libraries must verify that website guidance still applies.", "body_md": "[Back to blog](https://githits.com/blog/)\n\nNovember 4, 2026 · 5 min read\n\n# Code discovery: how agents find and understand dependency code\n\nFollow an agent checking a Python library's timeout and proxy settings to see how GitHits connects source lookup, research, and coding tools.\n\nA coding agent investigating failed web requests needs to check the library that sends them. In this example, a Python service uses httpx version 0.28.1. The agent needs to find the library’s default timeout and check whether the service can still use an option called `proxies=` to send requests through an intermediary server.\n\nhttpx is a **dependency**: code maintained outside the application that the application uses. Reading the service’s own files tells the agent how it calls httpx. To check what those calls do, the agent also needs httpx’s implementation at version 0.28.1. It can inspect an installed copy or fetch the source. GitHits provides tools to find and read that source through a shared index.\n\nWe use **code discovery** to describe this work: finding the relevant project, locating its implementation, and understanding how it works. Search locates the code. Reading it and checking its version lets the agent decide what to change.\n\n## Find the default timeout in the source\n\nGitHits brings together source code, documentation, and package information from public open-source projects. Its lookup tools let an agent search for relevant material, match exact text, list files, and read sections of a file. A request can name a package version or a repository revision so the agent can inspect the code it intends to use.\n\nDocumentation stored alongside the code in a repository can be read at that same revision. Hosted documentation comes from the latest indexed content of the documentation website. Selecting a package version does not pin those website pages to that release, so an agent using an older library needs to check that the hosted guidance applies to it.\n\nHere the agent already knows the name `DEFAULT_TIMEOUT_CONFIG`. It can look for that text with `grep`:\n\n```\ngithits grep -F \"DEFAULT_TIMEOUT_CONFIG\" pypi:httpx@0.28.1 --corpus source\n```\n\n`pypi:httpx@0.28.1` means version 0.28.1 of httpx from PyPI, the Python package registry. `-F` asks for an exact text match, and `--corpus source` selects source code. In our November 3 lookup using GitHits CLI 0.38.1, the result included:\n\n```\nSources:\n  - github:encode/httpx@26d48e06 (source files)\n\n[3] github:encode/httpx@26d48e06 httpx/_config.py\n246: DEFAULT_TIMEOUT_CONFIG = Timeout(timeout=5.0)\n```\n\nGitHits resolved the package version to commit `26d48e06`, a recorded revision in the httpx repository. Line 246 sets the default timeout configuration to five seconds. The full result also lists 14 matching lines in `_api.py` and `_client.py`, where that setting is imported or used as a default.\n\nThose matches give the agent somewhere to continue reading. The definition tells it the configured value; the code using the value explains when it applies. A reviewer can follow the [source link](https://github.com/encode/httpx/blob/26d48e0634e6ee9cdc0533996db289ce4b430177/httpx/_config.py#L246) to inspect the same revision.\n\nWe call these direct lookup operations **deterministic tools**. The caller specifies what to retrieve. Source lookups can stay tied to a particular commit, while a moving branch, a documentation website, or package metadata can change between requests.\n\n## Ask GitHits to investigate a question\n\nChecking the `proxies=` option requires several lookups. The agent needs to inspect the options accepted by `httpx.Client`, find the replacement, and separately check whether a newer release exists. GitHits’s `research` tool carries out that investigation and returns an explanation with references.\n\n```\ngithits research pypi:httpx \"Our app pins httpx 0.28.1 and still passes proxies= to httpx.Client. Is that argument still accepted in 0.28.1, what should we use instead, and is there a newer release on PyPI we should know about?\"\n```\n\nResearch found that `httpx.Client` accepts `proxy=`, which takes a proxy server’s address, and does not accept `proxies=` in version 0.28.1. It cited the [code that creates the client](https://github.com/encode/httpx/blob/26d48e0634e6ee9cdc0533996db289ce4b430177/httpx/_client.py#L594-L716). The PyPI metadata retrieved for that run listed 0.28.1 as the latest release.\n\nThe client definition belongs to a particular source revision. The latest-release answer describes the package metadata retrieved on November 3. Keeping those references with the answer lets the calling agent distinguish a fact about the installed version from release information it may need to refresh.\n\nThe agent can now update the proxy option, check the application’s proxy configuration, and test its requests.\n\n## Connect the tools to your coding agent\n\nAgents reach GitHits through three interfaces:\n\n| Interface | How an agent uses it | \n|---|---|\n| Command-line interface, or CLI | Runs commands such as the `grep` and`research` examples above in a terminal. | \n| Model Context Protocol, or MCP | Calls GitHits tools through a standard connection supported by its coding application. | \n| REST API | Sends web requests from a custom program or automated development workflow. | \n\nEach provides access to GitHits capabilities. Command names and availability depend on the client and version. For example, [CodeRabbit can connect to GitHits](https://githits.com/blog/connect-githits-to-coderabbit/) to inspect dependency source during code review.\n\nIn the same investigation, requests through the API and MCP returned the timeout definition at line 246 of `httpx/_config.py`, from commit `26d48e06`. The interface changed how the agent requested the code. The source revision it inspected stayed the same.\n\nGitHits works with public open-source projects. The coding agent uses its local tools for the application’s own workspace and private code. Together, those sources let it follow a question from an application call into the dependency that implements it.\n\nTo connect a supported coding tool, run `npx -y githits@latest init` and follow the [setup guide](https://docs.githits.com/installation/automatic-setup). For a custom integration, the [API quickstart](https://docs.githits.com/api/quickstart) shows how to make a request. The REST API is available for evaluation, and its v1 contract is still being finalized.", "url": "https://wpnews.pro/news/code-discovery-how-agents-find-and-understand-dependency-code", "canonical_source": "https://githits.com/blog/code-discovery-not-code-search/", "published_at": "2026-11-04 00:00:00+00:00", "updated_at": "2026-11-06 20:22:12.932458+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-search"], "entities": ["GitHits", "httpx", "PyPI", "GitHub", "encode/httpx", "GitHits CLI 0.38.1"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/code-discovery-how-agents-find-and-understand-dependency-code", "markdown": "https://wpnews.pro/news/code-discovery-how-agents-find-and-understand-dependency-code.md", "text": "https://wpnews.pro/news/code-discovery-how-agents-find-and-understand-dependency-code.txt", "jsonld": "https://wpnews.pro/news/code-discovery-how-agents-find-and-understand-dependency-code.jsonld"}}