Common issues and their solutions when using Code Analyzer.
- Installation Issues
- Build Errors
- Runtime Issues
- Performance Tuning
- GitHub Integration
- MCP Server Issues
- VS Code Extension Issues
- Database & Storage Issues
Symptom: npm install or pnpm install fails with node-gyp errors related to tree-sitter.
Solution:
- Ensure build essentials are installed:
# Ubuntu/Debian sudo apt-get install build-essential python3 # macOS xcode-select --install
- Ensure Node.js >= 20.0.0:
node --version
- Clear the pnpm store and reinstall:
pnpm store prune rm -rf node_modules pnpm install
Symptom: Native SQLite bindings compilation error.
Solution:
# Install system-level SQLite development headers
sudo apt-get install libsqlite3-dev # Ubuntu/Debian
brew install sqlite # macOSSymptom: pnpm is not recognized after installation.
Solution:
npm install -g pnpm@9
# or via corepack
corepack enable
corepack prepare pnpm@9 --activateSymptom: Build fails with ts(18048), ts(4111), etc.
Solution:
- The project uses TypeScript strict mode with
NodeNextmodule resolution. - Ensure you run the build from the project root:
pnpm build
- If building a single package, ensure its dependencies are already built:
pnpm --filter @code-analyzer/shared build pnpm --filter @code-analyzer/intelligence build
Symptom: Import errors when building downstream packages.
Solution: Build all packages in correct dependency order:
pnpm build # turbo handles topological orderingSymptom: Process crashes with JavaScript heap out of memory when analyzing large repositories.
Solution:
- Increase Node.js heap limit:
NODE_OPTIONS="--max-old-space-size=4096" code-analyzer analyze ./large-repo - Configure file size limits in
.code-analyzer.json:{ "analyzer": { "maxFileSize": 5242880, "maxFiles": 25000 } } - Use the
--excludeflag to skip large generated directories:code-analyzer analyze ./repo --exclude '**/generated/**'
Symptom: Repository analysis takes too long.
Solution:
- Reduce the scope with include/exclude patterns
- Limit languages:
code-analyzer analyze ./repo --languages typescript,javascript
- Increase worker count (auto-detected by default):
{ "analyzer": { "parseWorkers": 8 } } - Enable parse caching for re-analysis speedups
Symptom: Steady memory growth during analysis.
Solution:
- Set
pruner.enabled: truein config to prune unreferenced symbols - Reduce
maxFileSizeto skip very large files - Use SQLite graph store for large graphs instead of in-memory:
{ "storage": { "type": "sqlite", "dbPath": "./code-analyzer.db" } }
| Scenario | Recommended parseWorkers |
|---|---|
| Small repo (< 1000 files) | 2–4 |
| Medium repo (1000–10000 files) | os.cpus().length - 1 (default) |
| Large repo (> 10000 files) | os.cpus().length |
| CI/CD pipeline | os.cpus().length |
Enable parse caching for faster re-analysis:
{
"cache": {
"enabled": true,
"maxSize": 1000,
"ttl": 3600
}
}| Store | Best For | Limitations |
|---|---|---|
| In-Memory | Fast queries, small/medium repos | Memory-bound, ephemeral |
| SQLite | Large repos, persistence | Slightly slower reads |
Symptom: GitHubRateLimitError or 403/429 responses from GitHub API.
Solution:
- Check your current rate limit:
curl -H "Authorization: token YOUR_TOKEN" \ https://api.github.com/rate_limit - Use a GitHub App installation token (higher limits than PAT):
- Personal Access Token: 5000 req/hour
- GitHub App: 5000–15000 req/hour depending on plan
- Enable retry logic with exponential backoff (built into the client)
Symptom: INVALID_SIGNATURE errors when receiving GitHub webhooks.
Solution:
- Verify the webhook secret matches between GitHub and your server config
- Ensure the payload is raw (not parsed) when computing the signature
- Check that
X-Hub-Signature-256uses thesha256=prefix
Symptom: Cross-repo analysis returns empty or partial results.
Solution:
- Ensure all repos in the group are indexed:
code-analyzer cross-repo index --group my-group
- Verify GitHub tokens have read access to all repos
- Check that dependencies are declared in
package.json,requirements.txt, orgo.mod
Symptom: MCP client reports connection failure.
Solution:
- Verify the server is running:
curl http://localhost:3000/health
- Check for port conflicts:
lsof -i :3000
- Review server logs for startup errors
Symptom: Tool calls return error responses.
Solution:
- Check tool arguments match the expected schema:
curl http://localhost:3000/api/v1/tools/list | jq '.tools[] | {name, description}'
- Verify the graph store has been populated (run
analyze_repositoryfirst) - Check that the tool supports the requested operation
Symptom: TLS connection rejected during mTLS authentication.
Solution:
- Verify the client certificate is signed by the configured CA
- Check certificate expiration dates
- If behind a reverse proxy, configure
clientCertHeader:{ "mtls": { "clientCertHeader": "x-forwarded-client-cert" } }
Symptom: The @code-analyzer participant shows no response in Copilot Chat.
Solution:
- Ensure the extension is activated (check Output panel → Code Analyzer)
- Verify an MCP server is running or configured
- Check that the VS Code workspace contains analyzable code
Symptom: VS Code shows stale analysis results.
Solution:
- Run the "Code Analyzer: Refresh Analysis" command
- Check the file watcher is enabled (
watcher.enabled: true) - Manually trigger re-analysis if the watcher missed changes
Symptom: SQLITE_BUSY errors during concurrent operations.
Solution:
- The project uses WAL mode by default — check that it's enabled
- Avoid multiple processes accessing the same database file
- If using in-memory SQLite (
:memory:), switch to file-based for concurrent access
Symptom: Unexpected query results or missing data.
Solution:
- Run validation:
code-analyzer status --validate
- Rebuild the graph from source:
code-analyzer analyze ./repo --force
- Delete and recreate the database:
rm -f ./code-analyzer.db code-analyzer analyze ./repo
If the above solutions don't resolve your issue:
- Run
code-analyzer statusfor a diagnostic overview - Check logs at the configured log directory
- Enable debug logging:
CODE_ANALYZER_LOG_LEVEL=debug - File an issue with the diagnostic output at GitHub Issues