Introducing Tracer: An Autonomous Agent for Searching GitHub
Nia’s existing tools require you to index repositories before searching them. That’s great for codebases you return to frequently — but sometimes you need to search code you’ve never seen before.
Today we’re launching Tracer: an autonomous sub-agent built for searching remote codebases on GitHub.
The Problem: Searching Code You Haven’t Indexed
You’re debugging an error from a library you use. The stack trace points to somewhere deep in the source. You want to understand what’s happening, but:
- You haven’t indexed the library’s repo
- Indexing takes time
- You just need a quick answer
Or you’re looking for examples of how other projects implement something — pagination in GraphQL APIs, authentication middleware patterns, how companies structure their monorepos. You don’t know which repos to search. You just want to find relevant code.
Nia’s existing tools are optimized for indexed sources. Tracer is optimized for exploration.
How Tracer Works
Tracer is an autonomous agent powered by Claude Opus 4.6 with 1M context window support. You give it a question and repositories to search, and it handles the rest:
- Explores repository structure to understand the layout
- Searches code using GitHub’s Code Search API
- Reads specific files and line ranges for detailed analysis
- Iterates — search results reveal new paths to explore
- Synthesizes findings into a comprehensive report with citations
The agent runs until it has enough information, then calls finish and generates a final answer.
# Example: Understanding how a library handles errors
nia_tracer(
query="How does the Hono framework handle error middleware?",
repositories=["honojs/hono"]
)
Tracer will explore the repository, find the relevant error handling code, read the implementation, and return a detailed explanation with file paths and line numbers.
Available Tools
Tracer has access to four GitHub tools:
| Tool | Purpose |
|---|---|
github_search | Code search using GitHub’s API (supports qualifiers like language:, path:) |
github_list | Browse file tree structure |
github_read | Read file contents with optional line ranges |
github_glob | Find files matching glob patterns |
The agent decides which tools to use and in what order. It can search across multiple repositories, read dozens of files, and follow code paths across the codebase — all autonomously.
Real Use Cases
Understanding Library Internals
“Explain why we’re getting this error from Zod and show me the validation logic causing it.”
Tracer searches the Zod repo for error messages, finds the validation functions, reads the implementation, and explains exactly what triggers the error.
Finding Implementation Examples
“Find examples of how to implement cursor-based pagination in GraphQL resolvers. Search popular GraphQL server implementations.”
Tracer searches multiple repositories, finds pagination implementations, compares approaches, and synthesizes findings.
Learning Framework Patterns
“How does React’s useEffect cleanup function work? Search the React source.”
Tracer navigates the React codebase, finds the hooks implementation, reads the relevant code, and explains the cleanup mechanism.
API Usage
Create a Tracer Job
curl -X POST https://apigcp.trynia.ai/v2/github/tracer \
-H "Authorization: Bearer $NIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "How does the streaming response work in generateText?",
"repositories": ["vercel/ai"],
"context": "Focus on the core streaming implementation, not the React hooks."
}'
Response:
{
"job_id": "abc123",
"session_id": "def456",
"status": "queued"
}
Stream Results
curl -N https://apigcp.trynia.ai/v2/github/tracer/abc123/stream \
-H "Authorization: Bearer $NIA_API_KEY"
Events stream as the agent works:
data: {"type": "started", "query": "...", "repositories": [...]}
data: {"type": "tool_start", "action": "github_list", "args": {...}}
data: {"type": "tool_complete", "action": "github_list", "success": true}
data: {"type": "tool_start", "action": "github_search", "args": {...}}
...
data: {"type": "complete", "result": {"answer": "...", "iterations": 5}}
MCP Integration
Tracer is available as an MCP tool through the Nia MCP server. Once configured, you can use it in Claude Code, Cursor, or any MCP-compatible agent:
“Use Tracer to search the vercel/ai repository and explain how streaming works.”
Tracer vs Nia’s Index-Based Search
| Aspect | Tracer | Nia Search |
|---|---|---|
| Speed | Slower (live API calls) | Faster (pre-indexed) |
| Setup | None | Requires indexing |
| Coverage | All public GitHub | Only indexed sources |
| Best for | Exploration, one-off queries | Repeated searches, production use |
| Context | Agent-managed | Your control |
Use Tracer when:
- You’re exploring unfamiliar code
- You need to search repos you haven’t indexed
- You want autonomous research across multiple repositories
Use Nia Search when:
- You’re working with familiar codebases
- You need fast, repeated searches
- You want precise control over search scope
Get Started
- Get your API key at trynia.ai
- Install the MCP server or use the API directly
- Start searching
Tracer is live now. Try it with a question about any public repository.
Try Nia at trynia.ai.