gitnexus-debugging
abhigyanpatwari/gitnexus
Trace bugs and errors through your codebase using AI-powered code analysis.
What is gitnexus-debugging?
GitNexus Debugging helps you find the root cause of errors, failures, and unexpected behavior by analyzing call chains and execution flows in your code. Use it when debugging a bug, tracing an error origin, or understanding why something fails.
- Query code for error messages and related execution flows
- View incoming and outgoing calls for any function or symbol
- Trace shortest call chains between two symbols to understand data flow
- Analyze processes and their steps to locate where errors occur
- Detect how recent code changes affect other parts of the system
- Find external API calls and async dependencies that may cause intermittent failures
How to install gitnexus-debugging
npx skills add https://github.com/abhigyanpatwari/gitnexus --skill gitnexus-debugging- Node.js installed
- A Git repository indexed by GitNexus (run `node .gitnexus/run.cjs analyze` to create or refresh the index)
- One or more repositories bound via `list_repos {}`
How to use gitnexus-debugging
- 1.Call `list_repos {}` to bind the repository and check index freshness
- 2.Use `query({search_query: "<error or symptom>"})` to find related code and processes
- 3.Call `context({name: "<suspect>"})` to see incoming/outgoing calls and processes
- 4.Read the execution flow via `READ gitnexus://repo/{name}/process/{name}` if applicable
- 5.Use `trace({from: "A", to: "B"})` to find the shortest call chain between two symbols
- 6.Use `cypher({statement: "..."})` for custom call chain traces if needed
- 7.Read source files to confirm the root cause and state the repository and index freshness
Use cases
- Debugging an error message: query the error text, then inspect callers and callees to find the throw site
- Tracing intermittent failures: identify external API calls and async dependencies in the call chain
- Understanding a wrong return value: trace data flow through callees to see where the value gets corrupted
- Investigating performance issues: find symbols with many callers to identify hot paths
- Analyzing recent regressions: use detect_changes to see what your code changes affect
- Backend and full-stack developers debugging production issues
- Engineers investigating performance bottlenecks or intermittent failures
- Teams analyzing the impact of recent code changes
- Developers new to a codebase trying to understand execution flows
gitnexus-debugging FAQ
Run `node .gitnexus/run.cjs analyze` in the terminal to refresh the index. Check the `staleness` field in tool responses—only re-analyze if the status is `behind` or `diverged`; `current` means the index is up-to-date.
Call `list_repos {}` first to see all repositories. Then pass the `repo` parameter explicitly on every tool call. If you cannot determine which repository is meant, stop and ask the user.
Use `query({search_query: "<error message>"})` to find related processes and symbols, then call `context({name: "<suspect>"})` to see which functions throw or handle that error.
Yes, use `trace({from: "functionA", to: "functionB", repo: "my-repo"})` to get the shortest call chain in one call. If no path exists, it reports where the chain breaks (dynamic dispatch, reflection, or external boundary).
Use `context({name: "<suspect>"})` to identify external API calls and async dependencies in the call chain. Intermittent failures often come from timeouts, network issues, or race conditions in those external calls.
Full instructions (SKILL.md)
Source of truth, from abhigyanpatwari/gitnexus.
name: gitnexus-debugging description: "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: "Why is X failing?", "Where does this error come from?", "Trace this bug""
Debugging with GitNexus
When to Use
- "Why is this function failing?"
- "Trace where this error comes from"
- "Who calls this method?"
- "This endpoint returns 500"
- Investigating bugs, errors, or unexpected behavior
Bind the repository first
A root cause traced in the wrong repository is a wrong root cause.
Call list_repos {} before the first tool call. With one indexed repository,
use the examples below as written. With more than one, pass repo on every
call: an omitted repo normally errors, but under an MCP policy with a
configured default it resolves to that default silently. If you cannot tell
which repository is meant, stop and ask. This matters most for cypher, whose
statement carries no in-band hint of which database it ran against.
list_repos is paginated, so page with offset: pagination.nextOffset until
hasMore is false before concluding a repository is absent.
A stale index describes the code from before your bug, so refresh before trusting a trace, and state the repository and index freshness with the diagnosis.
Workflow
0. list_repos {} → Bind repo
1. query({search_query: "<error or symptom>"}) → Find related execution flows
2. context({name: "<suspect>"}) → See callers/callees/processes
3. READ gitnexus://repo/{name}/process/{name} → Trace execution flow
4. cypher({statement: "MATCH path..."}) → Custom traces if needed
If "Index is stale" → run
node .gitnexus/run.cjs analyzein terminal. Hot-toolstalenessnames which index answered (branch/lastCommit) and how fresh it is (status). Re-analyze only forbehindordiverged—currentis identity,unknownis unmeasurable.
Checklist
- [ ] list_repos {} — bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] Understand the symptom (error message, unexpected behavior)
- [ ] query for error text or related code
- [ ] Identify the suspect function from returned processes
- [ ] context to see callers and callees
- [ ] Trace execution flow via process resource if applicable
- [ ] cypher for custom call chain traces if needed
- [ ] Read source files to confirm root cause
- [ ] State the repository and index freshness with the diagnosis
Debugging Patterns
| Symptom | GitNexus Approach |
|---|---|
| Error message | query for error text → context on throw sites |
| Wrong return value | context on the function → trace callees for data flow |
| Intermittent failure | context → look for external calls, async deps |
| Performance issue | context → find symbols with many callers (hot paths) |
| Recent regression | detect_changes to see what your changes affect — pass worktree for a linked worktree |
| "How does A reach B?" | trace between the two symbols — shortest call chain in one call |
Tools
query — find code related to error:
query({search_query: "payment validation error", repo: "my-app"})
→ Processes: CheckoutFlow, ErrorHandling
→ Symbols: validatePayment, handlePaymentError, PaymentException
context — full context for a suspect:
context({name: "validatePayment", repo: "my-app"})
→ Incoming calls: processCheckout, webhookHandler
→ Outgoing calls: verifyCard, fetchRates (external API!)
→ Processes: CheckoutFlow (step 3/7)
cypher — custom call chain traces. Pass repo alongside the statement; the
Cypher text itself names no repository, so the result is unattributable without
it:
MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
RETURN [n IN nodes(path) | n.name] AS chain
trace — shortest call chain between two symbols ("how does A reach B?"), one call instead of chaining context hops:
trace({ from: "processCheckout", to: "fetchRates", repo: "my-app" })
→ status: ok, hopCount: 3
→ hops: processCheckout → validatePayment → verifyCard → fetchRates
→ edges: CALLS (1.0), CALLS (0.95), CALLS (1.0)
When no path exists, trace reports the furthest reachable node — exactly where the chain breaks (dynamic dispatch, reflection, or an external boundary).
Example: "Payment endpoint returns 500 intermittently"
0. list_repos {}
→ total: 2 (my-app, billing-api) — bind my-app explicitly on every call
1. query({search_query: "payment error handling", repo: "my-app"})
→ Processes: CheckoutFlow, ErrorHandling
→ Symbols: validatePayment, handlePaymentError
2. context({name: "validatePayment", repo: "my-app"})
→ Outgoing calls: verifyCard, fetchRates (external API!)
3. READ gitnexus://repo/my-app/process/CheckoutFlow
→ Step 3: validatePayment → calls fetchRates (external)
4. Root cause: fetchRates calls external API without proper timeout
Repository: my-app Index: current
With a single indexed repository, step 0 returns total: 1 and the repo
argument drops out of every call above.
Related skills
More from abhigyanpatwari/gitnexus and the wider catalog.

gitnexus-exploring
Explore codebases by querying execution flows, tracing calls, and understanding architecture.

gitnexus-impact-analysis
Analyze code dependencies and blast radius before making changes.

gitnexus-refactoring
Safely rename, extract, split, and move code across your codebase with automated impact analysis.

fish-audio
Generate AI text-to-speech audio with saved voices or one-shot voice cloning via AceDataCloud API.

monitoring-operations
Set up OCI metrics, alarms, and log collection without common gotchas like namespace confusion and missing data handling.

actionbook
Browser automation engine with up-to-date action manuals for any website—operate multiple tabs concurrently without parsing.