tsgo-bridge
tsgo-bridge connects Claude Code and Codex to the TypeScript 7 native language server (tsgo). It works on Windows, macOS, and Linux.
繁體中文說明
What it does
tsgo-bridge gives the agent TypeScript and JavaScript code intelligence from tsgo:
- Type errors after each edit.
- Go to definition.
- Find references.
- Hover information and document symbols.
In Claude Code, the agent gets this information through the LSP plugin. In Codex, the agent gets it through MCP tools (ts_diagnostics, ts_definition, ts_references, ts_hover, ts_symbols).
Benefits
| tsserver 6 (official plugin) | tsgo-bridge |
|---|
| Memory (monorepo, 8 open packages) | approximately 3.9 GB | approximately 1.9 GB |
| Memory after 10 idle minutes | no change | approximately 58 MB (tsgo stops) |
| Time from edit to type errors | 1.5 to 8 seconds | 0.1 to 2.4 seconds |
| Codex | no TypeScript tools | 5 MCP tools and a skill |
- The agent sees its own type errors. After an edit, the agent gets the errors in the next step. It can correct them before it continues.
- The agent finds code by meaning. It can use definitions and references instead of a text search. A text search can find words that have the same name but a different meaning.
- Less memory. tsgo uses approximately half the memory of tsserver. Each session starts its own server, so the saving increases with the number of sessions.
- Idle stop. tsgo-bridge stops tsgo after 10 idle minutes. The next request starts it again in approximately 1 second.
- Idle worktrees are released. Claude Code does not close files. tsgo keeps a project in memory while one of its files is open. Thus tsgo-bridge closes the files of a git repository or worktree that the agent did not edit or query for 10 minutes (the
idle_minutes setting), and tsgo releases that memory. When the agent uses one of those files again, tsgo-bridge opens all of them again, with the latest text. Worktrees that are in use stay loaded: each one can use more than 1 GB for a large app.
- One install for two clients. One
setup command installs the Claude Code plugin and the Codex MCP server. It works on Windows, macOS, and Linux.
- No change to your projects. tsgo-bridge uses a private copy of TypeScript 7 for the agent only. Your project builds continue to use the TypeScript version of the project.
- Reversible.
uninstall removes tsgo-bridge and enables the plugins that setup disabled.
The numbers come from tests on one Windows computer. Your results can be different.
Why this exists
tsgo-bridge is a temporary bridge. It exists because tsgo and the agent clients do not work together directly at this time.
- tsgo does not push diagnostics. The TypeScript 7 language server sends per-file diagnostics only when the client asks for them (pull,
textDocument/diagnostic). It does not send textDocument/publishDiagnostics (push).
- Claude Code accepts only pushed diagnostics. Claude Code does not ask the server for diagnostics. If you connect tsgo directly to Claude Code, Claude Code shows no type errors after an edit.
- Codex has no LSP client. Codex cannot use any language server directly. It can use MCP servers.
These issues track the problem. Status on 2026-11-01:
tsgo-bridge also contains two workarounds for tsgo:
- It does not send a second
initialized notification to tsgo. tsgo stops with an error if it gets two.
- It does not tell tsgo that the client watches files. tsgo then watches the files itself.
When to remove it
You can remove the Claude Code part when one of these conditions is true:
- tsgo sends pushed diagnostics.
- Claude Code asks the server for diagnostics (pull).
Before you remove it, set TSGO_PULL_TO_PUSH=0 and check that Claude Code still shows type errors. tsgo-bridge then only passes messages between Claude Code and tsgo, and stops tsgo when it is idle.
You can remove the Codex part when Codex has an LSP client.
How it works