Relay/blog
DocsGet Relay
← All posts
TUTORIAL2026-07-05 · 4 min read

How to give Claude Code a product brain in 5 minutes

Run npx --yes relayai-cli@latest doctor, sign in, enter the exact committed Git root, run init, and require brain status --check to report READY, fresh, and PASS. Then add customer signal and generate PLAN.md. Login installs the Claude skill; init separately writes the repository's managed AGENTS.md section.

By the end of this page, Claude Code will know what your customers asked for, which decisions your team already made, and exactly where the fence around a feature sits. The setup is explicit so the plan can never silently bind to the wrong repository.

Step 1 — Diagnose and sign in

$ npx --yes relayai-cli@latest doctor
✓ Runtime ready
 
$ npx --yes relayai-cli@latest login
 
Opening your browser to sign in…
✓ Signed in
✓ Claude skill installed

The skill lands in ~/.claude/skills/scriptonia/. Login does not bind a repository and does not write AGENTS.md.

Step 2 — Bind and check the exact Git root

$ cd /absolute/path/to/the/committed-git-root
$ git rev-parse --show-toplevel
/absolute/path/to/the/committed-git-root
$ npx --yes relayai-cli@latest init
$ npx --yes relayai-cli@latest brain status --check
 
DEEP BRAIN STATUS · READY · snapshot fresh · coverage PASS

Init writes the repository's managed AGENTS.md section and builds its first local brain. Do not skip this step or run it from a parent, nested child, or sibling root.

Step 3 — Feed it customer signal (free, always)

$ npx --yes relayai-cli@latest add slack-thread.txt call-with-acme.vtt notes.md
$ npx --yes relayai-cli@latest add "Compliance can't use the audit log without per-actor filtering"

Tickets, transcripts, pasted rants. Everything is embedded and kept traceable to its source. Adding signal never costs credits on any plan, because a starving brain helps nobody.

Step 4 — Turn an issue into a plan

$ npx --yes relayai-cli@latest plan "filter the audit log by actor"
 
✓ Plan filter-audit-log-by-actor v1 → PLAN.md
5 cited signal(s), 1 unresolved contradiction(s)

PLAN.md arrives with cited evidence, acceptance criteria, real file paths from a scan of your repo, a Non-goals fence, and, in this example, a ⚠ UNRESOLVED gate because the issue conflicts with a recorded roadmap decision. Claude Code is instructed to stop at that gate until a human clears it.

Step 5 — Let Claude Code ship it

$ scriptonia comment plan/filter-audit-log-by-actor "Approved — override the April call."
$ claude "execute PLAN.md"

The approval flips the gate to RESOLVED, the plan regenerates as v2, and Claude Code builds exactly what the plan says: one filter, not five, with the customer's ticket cited in the PR.

Why this beats pasting context into a prompt

A pasted prompt is one voice, once, and it forgets what you decided last quarter. Agent product memory retrieves across everything you've ever added, checks the decision corpus, and produces the same grounded plan for any agent, every time. The setup you just did is permanent; from now on the loop is just add → plan → build.

Frequently asked questions

Do I need an API key to connect Claude Code to Relay?

No. npx --yes relayai-cli@latest login opens a browser sign-in and stores credentials locally. It installs the Claude Code skill. A separate init at the exact committed Git root writes the managed AGENTS.md section; you never see or paste a key.

Does this work with Codex, Cursor, or OpenClaw too?

Yes. Those agents read the same AGENTS.md contract written by init. MCP-native agents can connect directly with npx --yes relayai-cli@latest mcp. Claude Code additionally gets a dedicated skill.

What changes in how Claude Code behaves?

Before building user-facing changes it runs scriptonia plan, executes the resulting PLAN.md exactly, respects its Non-goals, stops on any UNRESOLVED constraint, and cites signal ids in the PR description.

KEEP READING
CATEGORY
What is agent product memory?
PRACTICE
How to stop your coding agent from over-building
GO DEEPER
Agent integration reference (MCP, AGENTS.md)
Try the loop on your own repo

Start with the local diagnostic, then follow the required repository setup. Issue in, PLAN.md out.

npx --yes relayai-cli@latest doctor