Galactica maps JS/TS dependencies and guides agents to relevant tests
state: expiredheat: mediumuncertainty: mediumrelevance: mediumcodebase-mapping coding-agents software-testingcognitap
What is this?
Galactica is a MIT-licensed JavaScript and TypeScript dependency-mapping tool by cognitap. Its CLI can show dependency relationships and likely affected tests, while an offline HTML map lets developers explore the same analysis; an installable skill connects it to Codex, Claude Code and Cursor. The GitHub project describes it as available and gives Node.js 24.1.0 as a requirement. Its published benchmark reports better test identification on two Hono/Vite tasks, but the tests were not run and the results came from a small, limited evaluation. A newer GitHub pull-request search result describes further benchmark runs with a revised skill, but the supplied result does not give enough detail to verify the reported gains.
Why it matters
This is a practical tool for giving coding agents a more explicit map of how code and tests relate, potentially helping them choose relevant tests after edits and reducing missed coverage in unfamiliar JavaScript or TypeScript repositories. Its importance is as a modest developer-workflow improvement, not evidence of a general leap in agent capability: the creator’s initial results are task-specific, costs rose, and the evaluation did not execute test suites. A newer search result suggests the creator is iterating on the skill and evaluation, but does not establish how much that changes the findings.
Current assessment
cognitap’s GitHub project says Galactica maps imports in JavaScript and TypeScript repositories into an offline HTML view and CLI queries, and provides an agent skill installed with `init`. The project says the skill uses the same import graph as the map and directs agents to search by feature name for tests loaded at runtime; test reach inferred from imports can miss those runtime-loaded tests. The creator’s published six-task study used Hono, Vite and NestJS with Sonnet and Opus. On two Hono/Vite tasks, the share of required tests named rose from 47% to 78% for Sonnet and 82% to 100% for Opus when instructed to use the skill. All conditions scored 100% on the other four tasks. The study covered 144 runs, but only four per task, model and condition; grading checked edits statically and credited named required tests, extra tests carried no penalty, and target suites were never executed. The creator reports average cost per run increased 7% for Sonnet and 17% for Opus. A Google result for GitHub PR #53 supplies newer, incomplete evidence: it describes a revised skill evaluated on Hono and Vite using the same tasks, grader and per-run budget, with five Sonnet runs and three Opus runs per task and $5.63 total; its snippet says gains in V2 and V3 came from agents following a new step to search for tests after `uses`. The supplied evidence does not show the full PR results or establish whether these gains generalize, so treat them as a follow-up lead, not a confirmed replacement for the published benchmark. Potentially useful where import relationships help agents identify tests, with runtime-loaded tests and real test execution remaining important limitations.
Measured heat
now 0 pts/hpeak 0 pts/hcomments 0/hpeers p12momentum: steady2 platformsage 337h
points/hour across evidence · reading as of 2026-11-21 18:23:15.698340+11:00 · deterministic, not a model opinion
How the heat travelled
Evidence (2) — ⭐ canonical anchor
| source | object | author | score | comments |
| 🟧 hn | Galactica, a TypeScript codebase map for developers and agentsRetrieved article excerptOpen article · Retrieved 2026-11-07T07:21:17.851445+00:00 # Galactica
Galactica maps imports in JavaScript and TypeScript repositories. Browse the dependency graph in an offline HTML file, or use the CLI to find what a change affects and which tests cover it.
[Three layers of Immich’s web app. The selected side-bar area depends on modals, and layouts depends on side-bar.](https://raw.githubusercontent.com/cognitap/galactica/main/docs/images/immich-map.png)
## Quick start
Requires Node.js 24.1.0 or newer. From a project you trust, open a dependency map with one command.
```
npx @cognitap/galactica html --open
```
Galactica writes `galactica.html` in the current directory and opens it in your browser. Select a folder to see its modules, or select a file to trace what it imports and what depends on it. The map is a single HTML file you can share or open offline.
For regular use, install the CLI globally and run the same commands as `galactica`.
```
npm install -g @cognitap/galactica
galactica html --open
```
To inspect an unfamiliar checkout, run Galactica from a trusted directory and pass `--root /path/to/checkout`. [How Galactica reads repositories safely](https://github.com/cognitap/galactica/blob/main/docs/security.md)
## Use it with a coding agent
Run `npx @cognitap/galactica init` in your own repository (or `galactica init` after a global install) to install the skill for Codex, Claude Code and Cursor. Ask your agent which files and tests a change could affect. The skill uses the same import graph as the HTML map and points the agent toward feature-name searches for tests loaded at runtime.
## CLI
| Command | What it shows |
| --- | --- |
| `overview` | Packages, areas and dependency layers |
| `where <name>` | Definitions of a named symbol |
| `outline <file>` | A file’s exports and signatures |
| `uses <file>` | Importers and tests that reach the file |
| `deps <file>` | The file’s dependencies |
| `cycles` | Import cycles and where to break them |
| `health` | Cycles, oversized areas and cross-package private imports |
Add `--json` for structured output. Test reach follows imports, so tests that load code at runtime may need a separate search. [Command reference](https://github.com/cognitap/galactica/blob/main/docs/commands.md) · [Configuration](https://github.com/cognitap/galactica/blob/main/docs/configuration.md)
## Agent benchmark
We ran six tasks on Hono, Vite and NestJS with Sonnet and Opus. The clearest benefit came when agents had to name the tests that exercise an edited file in Hono or Vite.
| Share of required tests named on those two tasks | Without Galactica | Instructed to use the skill |
| --- | --- | --- |
| Sonnet | 47% | 78% |
| Opus | 82% | 100% |
The Hono task shows why following imports matters. Four adapter tests reach the edited function through a package import. Opus missed all four on each baseline run. With the skill instruction, it named all 12 required tests on every run.
All three conditions scored 100% on the other four tasks. Across all six, instructing the models to use Galactica increased average cost per run by 7% for Sonnet and 17% for Opus. The study covered 144 runs, four per task, model and condition. Grading checked edits statically and gave credit for required tests named. Extra tests carried no penalty, and the target test suites were never executed. [Full results, method and limitations](https://github.com/cognitap/galactica/blob/main/docs/benchmark.md)
The map was inspired by [codemap](https://github.com/peterretief/codemap). MIT licensed. | holistio | 2 | 0 |
| 🟧 echo.github ⭐ | The project maps JavaScript and TypeScript imports for offline browsing and CLI queries, and provides a skill for Codex, Claude Code, and Cu | cognitap | — | — |
Interpretation history
2026-11-07T07:21:44Z
audience grounding: medium — This is a practical tool for giving coding agents a more explicit map of how code and tests relate, potentially helping them choose relevant tests after edits and reducing missed coverage in unfamiliar JavaScript or TypeScript repositories. Its importance is as a modest developer-workflow improvement, not evidence of a general leap in agent capability: the creator’s initial results are task-specific, costs rose, and the evaluation did not execute test suites. A newer search result suggests the creator is iterating on the skill and evaluation, but does not establish how much that changes the findings.
Decision trace
- 11-21 19:20expireexpired deterministically: single-evidence seed quiet 14 days (lifecycle)
- 11-07 18:21attention_candidatecreate
- 11-07 18:21groundThis is a practical tool for giving coding agents a more explicit map of how code and tests relate, potentially helping them choose relevant tests after edits and reducing missed coverage in unfamilia
- 11-07 18:21createThe tool is usable now and offers a concrete, creator-reported coding-agent evaluation, but the small study and limited Hacker News engagement do not establish broader impact.