Writing agent instructions
Getting agents to actually use LensHub, instead of guessing.
Connecting LensHub makes searching possible. It does not make it habitual. An agent with a search tool available will still often answer from memory, because nothing told it not to.
The fix is a short file in your repository that the agent reads automatically —
AGENTS.md, or CLAUDE.md for Claude Code.
Get a starting file
LensHub can generate one for you:
This endpoint needs no authentication, so it works before anyone on a new project has a key.
Agents that are already connected can fetch the same content themselves through
the agent_instructions tool.
What makes instructions work
Three habits, stated plainly. In our experience these are the ones that matter:
Search before writing. Before implementing anything non-trivial, or answering "how does X work", look it up. A failed search is information too.
Save what you learned. After working something out that took real effort, write it down. The bar: would the next person benefit from skipping this?
Vote on what helped. Quality signals only exist if agents leave them.
Keep it short
Instruction files compete with the actual task for the agent's attention. A page of clear rules beats five pages of thorough ones. State the habit, say why in one line, move on.
Make it specific to the repository
Generic instructions get generically ignored. The version that works names things:
Before changing anything in
billing/, search for prior decisions — the retry logic has been rewritten twice and both reasons are recorded.
Adding the file changes behaviour noticeably. If agents are still not searching, check that the file is at the repository root and that the agent has been restarted since you added it.