Skip to main content

Work with code

See what a change might affect.

A small change can matter elsewhere in a project. Start with one function and inspect the connections Kin has recorded around it. The result suggests places to check; it does not prove what will break.

How this works in Kin

kin impact walks the recorded graph outward from one entity and reports what it reaches, bounded by a depth you choose. It answers about this repository, and it fails closed on a name it cannot resolve rather than returning an empty set.

Start with a disposable copy of your code. Examples below were checked on a specific build; language and workflow support are limited.

Check the example version and setup

Supported build

Every command below was run on Kin v0.7.6, macOS on Apple silicon, on 2026-09-09, against a four-file JavaScript repository created from scratch. The output shown is what that run printed. Current release: v0.7.19.

Before you start

  • Kin on your PATH, and a repository admitted with kin init.
  • A graph that has finished enriching. kin graph status reports embedding coverage and parse coverage; an answer from a half-built graph is smaller than the truth and looks exactly the same.
  • The entity name, or a search that found it. kin impact takes an entity, and fails closed on a name it cannot resolve rather than guessing.
  • One repository. Impact covers this repository; a dependent in a sibling repository is a kin xref question.

The steps

  1. 01

    Ask what a change would reach

    The default walk is three hops. Rows are grouped by how far they sit from the entity you named.

    kin impact formatAmount
    Compare with the saved example output
    Impact analysis for 'formatAmount' (Function) @ src/money.js:1:
      7 local entities impacted within 3 hops:
      1 hop (direct callers):
        - money (Module) @ src/money.js:1
        - receipt (Module) @ src/receipt.js:1
        - describeLine (Function) @ src/pricing.js:11
        - renderReceipt (Function) @ src/receipt.js:4
        - pricing (Module) @ src/pricing.js:1
      2 hops:
        - cli (Module) @ src/cli.js:1
        - main (Function) @ src/cli.js:3

    Every entity the graph reaches within the depth you asked for, grouped by hop. The first group carries the modules alongside the callers, because a module holds the entities defined in it and that containment is an edge like any other. Read the group as what sits one step away, not as a list of call sites.

  2. 02

    Bound the traversal when the answer is too wide

    Depth is the one knob that changes the size of the answer. Tighten it when you want the blast radius you can review by hand.

    kin impact formatAmount --depth 1
    Compare with the saved example output
    Impact analysis for 'formatAmount' (Function) @ src/money.js:1:
      5 local entities impacted within 1 hop:
      1 hop (direct callers):
        - money (Module) @ src/money.js:1
        - receipt (Module) @ src/receipt.js:1
        - describeLine (Function) @ src/pricing.js:11
        - renderReceipt (Function) @ src/receipt.js:4
        - pricing (Module) @ src/pricing.js:1

    The same first group and nothing beyond it. A smaller depth is a smaller question, not a more accurate one: what drops out is still reachable, just further away.

  3. 03

    Disambiguate when a name is not unique

    Two entities can share a name across files. Qualify the one you mean rather than reading an answer about the other.

    kin impact formatAmount --file src/money.js
    Compare with the saved example output
    Impact analysis for 'formatAmount' (Function) @ src/money.js:1:
      7 local entities impacted within 3 hops:
      1 hop (direct callers):
        - money (Module) @ src/money.js:1
        - receipt (Module) @ src/receipt.js:1

    The same answer, now pinned to one definition. --kind and --signature narrow it further when a file holds several entities with the same name.

  4. 04

    Read the route, not just the set

    A list of reached entities does not say how the change gets there. kin path prints the edges it walked.

    kin path main formatAmount
    Compare with the saved example output
    route 1 of 1 (forward, 2 hops): main -> formatAmount
      main [function] src/cli.js:3
      -Calls@5-> renderReceipt [function] src/receipt.js:4
      -Calls@6-> formatAmount [function] src/money.js:1

    One route, each hop naming the relation kind and the line the call sits on. Below this excerpt the command also reports the walk it did, how it resolved each endpoint, and a verdict line. When several routes exist they are printed in order, and each one is a chain you can open and read.

  5. 05

    Check the reached entities against the source

    An impact answer earns its place in a decision only when you have opened one of the entities it named.

    sed -n '4,8p' src/receipt.js
    Compare with the saved example output
    function renderReceipt(order) {
      const lines = order.items.map(describeLine);
      lines.push(`Total ${formatAmount(orderTotal(order))}`);
      return lines.join('\n');
    }

    renderReceipt reaches formatAmount on line 6, which is the hop kin path printed. If a listed entity does not reference the one you asked about, the graph may be stale, incomplete, or incorrect: check the revision and coverage, and if the mismatch remains after the documented update workflow, report a minimal example.

When the answer looks wrong

An empty or partial answer can reflect coverage, repository state, or an error. Each row below says what the state means and what to do next.

  • Entity 'applyDiscount' not found in this repo's graph.

    The name did not resolve, so nothing was traversed. The command fails closed rather than returning an empty impact set that reads like a safe change.

    Run kin search applyDiscount for the real name, or kin xref applyDiscount when the definition is in a sibling repository.

  • An answer smaller than you expected.

    Either the traversal was bounded by --depth, or the graph has not finished enriching, or the reaching code is in a language with no adapter.

    Raise the depth, run kin graph status to see embedding and parse coverage, and check kin languages for the languages Kin extracts entities from.

  • cross-repo: not_evaluated

    Impact covers this repository. A dependent in another repository is not part of this answer and was not looked for.

    Use kin xref for federated references across repositories.

  • The module the entity lives in appears as a one-hop result.

    Containment is a recorded edge, so the module sits one step from everything defined in it.

    Read the callers in the group and treat the module row as the file the entity lives in rather than a separate consumer.

Next action

Turn the reached set into a review.

Impact tells you what a change touches. The review command turns the same read into a report you can put beside a change, with the signature difference and the consumers named.

Use structural evidence in review