{"id":50668072,"url":"https://github.com/nam-hle/symantic","last_synced_at":"2026-06-08T08:06:23.642Z","repository":{"id":362886223,"uuid":"1261053567","full_name":"nam-hle/symantic","owner":"nam-hle","description":"Semantic symbol intelligence for TypeScript, shaped for AI agents","archived":false,"fork":false,"pushed_at":"2026-06-08T04:56:27.000Z","size":443,"stargazers_count":1,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T06:27:56.960Z","etag":null,"topics":["ai-agents","code-intelligence","developer-tools","mcp","static-analysis","ts-morph","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nam-hle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-06T07:16:01.000Z","updated_at":"2026-06-08T04:55:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nam-hle/symantic","commit_stats":null,"previous_names":["nam-hle/kestrel","nam-hle/symantic"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nam-hle/symantic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nam-hle%2Fsymantic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nam-hle%2Fsymantic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nam-hle%2Fsymantic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nam-hle%2Fsymantic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nam-hle","download_url":"https://codeload.github.com/nam-hle/symantic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nam-hle%2Fsymantic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34053516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","code-intelligence","developer-tools","mcp","static-analysis","ts-morph","typescript"],"created_at":"2026-06-08T08:05:45.834Z","updated_at":"2026-06-08T08:06:23.637Z","avatar_url":"https://github.com/nam-hle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# symantic\n\n\u003e Code navigation for TypeScript whose output is built for an agent's token budget and\n\u003e address model.\n\nAn AI agent has no cursor and a finite context window. symantic answers code-navigation\nquestions (\"where is X used / what implements it / what's the public surface here\") with\nresults that are **name-addressed** (`file.ts:Class::method`, never a byte offset an agent\ncan't compute) and **token-lean** (a compact tree, not a verbose payload). Compiler-accurate\nunderneath (TypeScript via [ts-morph](https://ts-morph.com/)) — but accuracy is table stakes;\nthe **output contract is the point**.\n\n**Status:** early development. Read-only core engine + CLI + MCP server all working.\n\n## Why not just an LSP→MCP bridge?\n\nSeveral tools already bridge a language server to MCP — they give compiler-accurate\nreferences, implementations, even rename. But they pipe **raw LSP** through: byte-offset\npositions (an agent has no cursor to resolve them) and verbose payloads (burning the context\nwindow). They answer the question, then make the agent pay to parse and re-address the answer.\n\nsymantic is the layer those bridges skip:\n\n- **Name-addressing** — every result is a qualified name you feed straight into the next\n  query. No offsets, no position bookkeeping.\n- **Token-lean output** — compact tree outlines; classified, paginated refs; no LSP noise.\n- **Synthesized ops with no LSP equivalent** — `outline_function` (statement skeleton),\n  `public_surface` (transitively expands `export *`), bounded `call_hierarchy`,\n  `usage_report` (dead-code in one call). A bridge wrapping a language server can't produce\n  these by pass-through.\n\nThe engine (ts-morph today, maybe tsgo later) is commoditized. The output contract is the\ndurable part — see the [v1 roadmap epic](https://github.com/nam-hle/symantic/issues/78).\n\n## What it does (v1, read-only)\n\n| Operation             | Description                                                                                          |\n| --------------------- | ---------------------------------------------------------------------------------------------------- |\n| `searchSymbol`        | repo-wide search for a name across all files (exact, or `--contains` substring) → candidates         |\n| `resolveSymbol`       | `relPath:name` (dotted for nested namespaces, `name#index` to pick) → symbol or candidates           |\n| `findDefinition`      | all declaration sites (handles declaration merging)                                                  |\n| `findUsages`          | references classified by kind (import / call / type-ref / read / write), bounded by `limit`/`cursor` |\n| `findImplementations` | classes implementing an interface                                                                    |\n| `callHierarchy`       | callers (incoming) or callees (outgoing) of a symbol, walked to a bounded depth                      |\n| `outlineFile`         | structural \"table of contents\": declarations (incl. nested in namespaces) + re-exports               |\n| `outlineSymbol`       | members of a class / interface / namespace                                                           |\n| `outlineFunction`     | statement-level skeleton of a function body (incl. arrow/function-expression consts)                 |\n| `listImports`         | the import statements of a file (module + named/default/namespace) — module wiring                   |\n| `publicSurface`       | transitive public surface of an entry barrel — expands `export *` to concrete symbols                |\n\nAll operations are **deterministic** AST queries — symantic never runs an LLM. Prose summaries\nare the calling agent's job; symantic hands it exact structure.\n\nModification (rename / move) is deferred. Multi-language is out of scope (TypeScript only).\nSee [docs/VISION.md](docs/VISION.md) for the full scope and [docs/DESIGN.md](docs/DESIGN.md)\nfor architecture.\n\n## Architecture\n\n```\npackages/\n  core/   warm ts-morph Project, symbol resolution, query + outline ops (transport-agnostic)\n  mcp/    MCP server adapter (keeps core warm across tool calls)\n  cli/    CLI adapter\n```\n\nThe analysis engine is swappable behind the core API. The current engine is ts-morph; the\nvision engine is Microsoft's Go-native [`tsgo`](https://github.com/microsoft/typescript-go)\nonce it ships an embeddable find-references API.\n\n## Usage\n\n**CLI** — one-shot semantic queries. Output is **token-lean, address-first text** by default\n(paste a `file:line:col` or `file:Name` straight into the next query); add `--json` for the\nstructured form. Commands group by intent: `view` (read code) and `find` (locate/trace), plus\ntop-level `resolve` / `imports` / `exports` / `usage`:\n\n```bash\n# read code\nnpx @symantic/cli view outline src/foo.ts --tsconfig tsconfig.json\nnpx @symantic/cli view symbol src/foo.ts:Bar --tsconfig tsconfig.json     # exact source\nnpx @symantic/cli view context src/foo.ts:Bar --tsconfig tsconfig.json    # source + callees + types\nnpx @symantic/cli view region src/foo.ts:10-40 --tsconfig tsconfig.json   # line range\n\n# locate / trace\nnpx @symantic/cli find refs src/foo.ts:Bar --tsconfig tsconfig.json --exclude-tests\nnpx @symantic/cli find callers src/foo.ts:Bar --tsconfig tsconfig.json\nnpx @symantic/cli find callees src/foo.ts:Bar --tsconfig tsconfig.json\n```\n\n(After a global install — `npm i -g @symantic/cli` — the binary is just `symantic`.) Add\n`--engine lsp` to any command to use the tsgo-backed engine instead of the ts-morph default,\nand `--json` for structured output.\n\n\u003e **The `lsp` engine is experimental and opt-in.** It needs `@typescript/native-preview`\n\u003e (tsgo), declared as an _optional_ dependency — the default ts-morph engine pulls no native\n\u003e binary. tsgo ships per-platform builds and is currently a preview/dev release; if it's\n\u003e absent or unavailable for your platform (e.g. Alpine/musl), `--engine lsp` errors with an\n\u003e install hint while the default engine keeps working.\n\n**MCP** — the same operations as MCP tools over stdio, holding the project warm across calls\n(no per-call cold start). The server runs via `npx @symantic/mcp`. Host setup:\n\n_Claude Code_ — `.claude/mcp.json` (or via `claude mcp add`):\n\n```json\n{ \"mcpServers\": { \"symantic\": { \"command\": \"npx\", \"args\": [\"-y\", \"@symantic/mcp\"] } } }\n```\n\n_Cursor_ — `~/.cursor/mcp.json` (or `.cursor/mcp.json` in the project):\n\n```json\n{ \"mcpServers\": { \"symantic\": { \"command\": \"npx\", \"args\": [\"-y\", \"@symantic/mcp\"] } } }\n```\n\n_Codex_ — `~/.codex/config.toml`:\n\n```toml\n[mcp_servers.symantic]\ncommand = \"npx\"\nargs = [\"-y\", \"@symantic/mcp\"]\n```\n\nTools: `view_outline`, `view_symbol`, `view_context`, `view_region`, `view_members`,\n`view_body`, `find_symbol`, `find_def`, `find_refs`, `find_impls`, `find_callers`,\n`find_callees`, `resolve`, `imports`, `exports`, `usage_report`. Each takes a `tsConfig`\nargument (engine cached per tsconfig); pass `engine: \"lsp\"` for the tsgo backend, or\n`json: true` for structured output instead of the default token-lean text.\n\n### Token savings (`gain`)\n\nEvery CLI query records an estimated token saving — the size of symantic's structured\noutput vs. the cost of reading the raw files the result referenced — to a local ledger\nat `~/.symantic/gain.jsonl`. `symantic gain` reports the cumulative total:\n\n```bash\nsymantic gain                # summary: queries, symantic vs baseline tokens, % saved, top ops\nsymantic gain --history      # recent queries, one per line\nsymantic gain --by-project   # totals grouped by project directory\nsymantic gain --json         # machine-readable aggregate\n```\n\nAll figures are `~`-prefixed estimates (`ceil(bytes / 4)`, no tokenizer); the baseline\ncounts only the files each result referenced, never the whole project.\n\n**Privacy:** tracking is always on (no opt-out) and writes project paths and op names to\n`~/.symantic/gain.jsonl`. The ledger is local only — nothing is transmitted. Delete it any\ntime; a missing ledger just resets the totals.\n\n## Development\n\nRequires Node.js 24+ and pnpm. The repo uses [nadle](https://nadle.dev) as its task runner.\n\n```bash\npnpm install\npnpm build          # nadle build (tsc project references)\npnpm test           # nadle test (vitest)\npnpm exec nadle check    # eslint + prettier\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnam-hle%2Fsymantic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnam-hle%2Fsymantic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnam-hle%2Fsymantic/lists"}