# Write code with Niro

**While code is being written, the coding agent asks the graph instead of searching through files.** One question to the graph can replace many text searches and file reads. For example: "who calls this method, three levels up?"

## Who and how

- **The coding agent** reaches Niro over MCP (the Model Context Protocol, the standard way coding agents use outside tools). Niro sets this up for 14 agents. See [Connect your coding agent to Niro](https://help.niroai.dev/cli/connect-your-ai-assistant/).

- **The developer** asks from the terminal with `niro ask`. Run it with no tool name to list the tools.

## What agents are taught to do

The skill Niro installs tells the agent to do four things:

- **Explore first.** Use `code_grep`, `get_source_code`, `resolve_name`, `list_types`, `get_class_structure`, `find_api_endpoints` and `find_handler` before reading files by hand.

- **Check both directions before changing anything.** Use `get_blast_radius`, `get_reverse_call_chain` and `get_impact_analysis`.

- **Follow flows across services.** Use the HTTP, event and data tools.

- **Say when Niro does not apply.** For example: the folder is not indexed, or the graph is behind the files.

**Claude Code gets more help than the other agents.** Niro adds hooks to Claude Code: small commands that Claude Code runs at fixed moments. One of them shows an "impact check" before Claude Code edits a file. It is advisory only: it shows the information and never blocks the edit. To turn it off, run `touch ~/.niro/impact-gate-off`. The other agents get instruction text instead of hooks.

## When the graph is behind your edits

The graph is rebuilt in the background about 3 seconds after a folder stops changing. If an answer is about a file that changed after the last build, the answer says so, and lists the files to read directly.

## Playbooks for this stage

- [Change code safely](https://help.niroai.dev/cli/playbook-change-safely/): callers before an edit, overloads, static imports, common names grep cannot narrow.

- [Add a feature](https://help.niroai.dev/cli/playbook-add-a-feature/): the interface to implement, its methods, existing implementations to copy.

- [Ask for less](https://help.niroai.dev/cli/answer-shapes/): `answer=count`, `locations`, `names`, `exists` and `match`, so an answer carries only what the next step needs.