# 2. Before you push

Source: https://usecns.dev/your-repo-before-push/

[On your repository](https://usecns.dev/your-repo/) · [1. Find](https://usecns.dev/your-repo-find/) → **2. Before you push** → [3. A rule that comes back](https://usecns.dev/your-repo-rules/) → [4. Memory that earns trust](https://usecns.dev/your-repo-memory/) → [5. Two weeks later](https://usecns.dev/your-repo-later/)

**You want to:** know what your branch reached before you open a pull request, and stop paying for a coding agent's repository-wide searches.

**You leave with:** a habit, a bounded impact report for one real change, and a coding agent that refreshes the index after every edit and asks Axon before it searches. Still Axon only.

## Before you start

Continue in the repository from [step 1](https://usecns.dev/your-repo-find/), on a branch with at least one real edit. If the branch is clean, make the change you were going to make anyway. Run the project's own tests as you normally would.

## Ask what the edit reached

```
axon index --json
axon delta --base main --json
```

Use the base your review compares against (`main`, `develop`, a release branch); without `--base`, delta compares with the last indexed commit, which is rarely the review comparison.

Read `changeSet` for what changed, `touched` for the changed symbols, then module impact and downstream entry surfaces. Where Axon does not compute a field it is null, and **null is unknown, not zero**. The [DeltaReportV1 contract](https://usecns.dev/contract-deltareportv1/) describes each field.

**What you should notice:** a reach you did not have in mind when you made the edit, especially an entry surface or module two hops away. If the reach is exactly what you expected, you have a cheap confirmation to attach to your review.

**Does not prove:** safety. The graph is bounded, and a small delta on a stale or partial index is a small *known* delta.

## Pick tests from the report, not from memory

```
axon deps-impact <changed-file-or-module> --json
```

Read `resolved` first; an unresolved module reports why. For a resolved target you get the modules that depend on it, which is the list to choose test suites from. Run those tests yourself.

**What you should notice:** the first time you run a test suite you would not have thought of, because a module you did not associate with your change depends on it.

**Does not prove:** that the listed modules are the only ones affected, or that their tests cover the change. It narrows the choice; it does not make it.

## Let the agent refresh the index and ask Axon first

Two small changes make a shell-capable coding agent use what you have just used.

First, refresh the index after every file edit. For Claude Code, add this to `.claude/settings.json` in the repository, merging it if the file already has hooks:

```
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|MultiEdit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "axon index >/dev/null 2>&1 || true"
          }
        ]
      }
    ]
  }
}
```

It runs `axon index` after each edit and never blocks the agent. Other harnesses are covered on the [Harnesses page](https://usecns.dev/harnesses/).

Second, tell the agent to ask Axon before it searches. Add a short block to the repository instructions your harness reads (`CLAUDE.md`, `AGENTS.md` or its equivalent):

```
This repository has an Axon index at .axon/axon.db.
Before a repository-wide grep or find, ask Axon:
  where is it            axon search <name> --json
  who calls it           axon trace <name> --direction incoming --json
  path from an entry     axon feature-path <route-or-entry>
  what a branch reached  axon delta --base main --json
Open the files Axon names and confirm relationships in source.
Its graph is evidence, not proof.
```

Keep it this short.

## Compare one task, before and after

Pick a task you have already given the agent in this repository: a bug whose fix you know, or a question about where a behaviour lives. Run it once with the hook and instructions in place. Compare the two transcripts for the number of shell and search tool calls and for whether the agent's first move was a repository-wide search or an `axon` query.

**What you should notice:** a shorter transcript, and an agent that opens the files Axon named instead of walking the tree. Keep the pair; it is your own evidence, on your own repository, for whatever you decide next.

**Does not prove:** that every task improves, or any general speed or token figure. One pair is one pair. If you want a number, run several and report the spread.

## What you have

A delta you read before pushing, a test selection drawn from the graph, and an agent that keeps the index warm and asks Axon first. From here the remaining steps add things Axon cannot know: the reasons behind your code.

**Next:** [write down one review comment you keep repeating and watch it come back →](https://usecns.dev/your-repo-rules/)