Multi-Language Repo
import { Aside, Tabs, TabItem } from ‘@astrojs/starlight/components’;
Forge indexes all supported languages in a single pass. A repo with TypeScript frontend, Python backend, and Rust services gets one unified index — searches, dependency graphs, and health checks span the whole codebase.
Supported languages
Section titled “Supported languages”| Language | Extensions | Features |
|---|---|---|
| TypeScript | .ts, .tsx | Full — symbols, imports, AST patterns, graph |
| JavaScript | .js, .jsx, .mjs, .cjs | Full — symbols, imports, AST patterns, graph |
| Python | .py | Full — symbols, imports, AST patterns, graph |
| Rust | .rs | Full — symbols, imports (use declarations), AST patterns, graph |
| Go | .go | Full — symbols, imports, AST patterns, graph |
Other file types (YAML, TOML, JSON, Markdown) are indexed for full-text search but not AST-parsed.
Index a mixed-language repo
Section titled “Index a mixed-language repo”No special flags required. Run forge index at the repo root:
forge index /path/to/repo --with-search --with-gitForge detects languages automatically from file extensions. After indexing, verify all languages were picked up:
forge statsExpected output for a TypeScript + Python repo:
forge stats: /home/you/repos/myapp
Files indexed: 3,847 Symbols extracted: 41,203 Languages: TypeScript (2,891), Python (956) Index size: 94 MB Last indexed: 2026-04-16 15:01:44 (just now)If a language you expected is missing, check that files with those extensions exist in non-ignored paths.
Language-scoped search
Section titled “Language-scoped search”Use forge search with --language to limit results to a specific language:
# Find "checkout" in TypeScript files onlyforge search "checkout" --language typescript
# Find "checkout" in Python files onlyforge search "checkout" --language pythonWithout --language, results span all indexed languages.
Via MCP (in Claude Code, Cursor, etc.):
Call forge_search with query="checkout" and language="typescript"Language-specific AST patterns
Section titled “Language-specific AST patterns”forge pattern_search (and forge_pattern_search via MCP) uses ast-grep syntax. Patterns are language-specific — specify which language to match:
Find all async function declarations:
forge pattern "async function $NAME($$$PARAMS) { $$$BODY }" --language typescriptFind all React useEffect calls:
forge pattern "useEffect($$$)" --language typescriptFind all class definitions:
forge pattern "class $NAME: $$$BODY" --language pythonFind all with statements:
forge pattern "with $CTX as $VAR: $$$BODY" --language pythonFind all impl blocks:
forge pattern "impl $TRAIT for $TYPE { $$$BODY }" --language rustFind unwrap() calls (for audit):
forge pattern "$EXPR.unwrap()" --language rustFind all error returns:
forge pattern "return nil, $ERR" --language goFind goroutine spawns:
forge pattern "go $FUNC($$$ARGS)" --language goCross-language dependency tracking
Section titled “Cross-language dependency tracking”Forge tracks dependencies within each language. Cross-language calls (e.g., a TypeScript frontend calling a Python REST API) are not tracked automatically — Forge works at the source level, not the network level. However, you can:
- Use
forge searchto find the API endpoint in both codebases simultaneously. - Use
forge_trace_dependentson the TypeScript API client module to find all callers. - Use
forge_trace_dependentson the Python endpoint to find all its imports and dependencies.
Example: TypeScript frontend + Python backend
Section titled “Example: TypeScript frontend + Python backend”A common structure:
repo/├── frontend/ (TypeScript/React)│ └── src/│ └── api/│ └── client.ts└── backend/ (Python/FastAPI) └── app/ └── routes/ └── payments.pyIndex both:
forge index . --with-search --with-gitSearch across both simultaneously:
forge search "payment"Output:
frontend/src/api/client.ts:14 const paymentResponse = await post('/api/payments', ...)frontend/src/components/Cart.tsx:87 import { createPayment } from '../api/client'backend/app/routes/payments.py:1 from fastapi import APIRouterbackend/app/routes/payments.py:12 @router.post("/payments")backend/app/services/payment.py:3 class PaymentService:One query, both languages.
Health checks in multi-language repos
Section titled “Health checks in multi-language repos”forge health runs checks across all indexed languages. Health check findings are scoped to the language they apply to — broken_import for a TypeScript module won’t appear for Python files.
Custom health check plugins can target specific languages. See Write a Custom Health Check.
Common pitfalls
Section titled “Common pitfalls”Python files indexed but no symbols extracted
This typically means the Python files use syntax from Python 3.10+ (structural pattern matching, union type syntax) that Forge’s parser doesn’t yet support. Check FORGE_LOG=debug forge index . for parse errors.
Go files missing from index
Make sure Go files aren’t inside vendor/ (which is excluded by default). If vendor/ contains first-party code (unusual but it happens), add a specific include_paths override in .forge/config.toml.
Pattern search returns no results across languages
Each forge pattern call targets one language. If you don’t specify --language, it searches all languages — but the pattern syntax must be valid in the target language. A TypeScript-specific pattern run without --language may silently skip Python files where the pattern is syntactically invalid.