Skip to main content
Coding agents are quick to write a new helper and slow to look for the one you already have. Over a few months a codebase ends up with three date formatters, two modal components and a retry wrapper per service. Each copy drifts, and every bug fix has to be made more than once. This recipe makes “look for it first” part of the agent’s routine, using the graph Graphify already has of your repository.
Works with: Graphify (hosted), with Claude Code, Codex, Cursor or any agent connected to the hosted MCP server.

The short version

Already connected? Paste this into your agent: The rest of this page sets it up so it happens every time.

The scenario

A product team builds its web app mostly with coding agents. A designer notices that the app has several slightly different confirmation dialogs. Engineering finds the cause: each agent session wrote its own, because nothing told it a shared one existed. The team wants agents to find and use the existing component, and to say so when they truly need a new one.

What you’ll build

  • An instruction block that tells the agent to search the graph before it writes a new function, class or component.
  • A short check you can run to see whether the agent searched.

Before you start

Setup

1

Add the rule to the agent's instructions

Add this to CLAUDE.md or AGENTS.md and commit it. Replace acme/web-app with the repository’s name in Graphify.
AGENTS.md
2

Try it

In a new agent session, ask for something your codebase already has:
The agent should name the existing dialog it found, or explain why none fit.

How it works

graphify_find matches symbol names, so it’s good when you can guess part of a name. graphify_rank_files ranks files against a plain-language description, so it finds a helper even when it’s named something you wouldn’t guess. graphify_callers shows how widely a candidate is already used, which is a good hint that it’s the shared one. These tools read the graph from the last index of your default branch. Code added on a branch that isn’t merged yet won’t show up.

Verify it worked

Ask the agent at the end of the session which Graphify tools it called and what it found. You can also check the agent’s tool log. A session that wrote a new component without a graphify_find or graphify_rank_files call skipped the rule.

Troubleshooting

  • The agent skips the search. Put the block near the top of the instruction file, and keep it short. Make your coding agent actually use the graph covers this in depth.
  • Search returns nothing useful. Try a shorter name fragment with graphify_find, or describe the behavior instead of the name with graphify_rank_files.
  • The result looks out of date. Check when the repository was last indexed with graph_stats.

Next steps

Try it in Graphify

We build and host the graph for you. The Free plan (up to 3 repositories) needs no card. Pro and Teams start with a 14-day trial, card required.

Make agents use the graph

Get agents to query Graphify before they grep.

Hosted MCP

Every hosted tool and client setup.