ai-agents lsp-first.instructions.md

ai-agents lsp-first.instructions.md is an instructions file for GitHub Copilot from rjmurillo/ai-agents. It costs 774 tokens per session, scanned A, original, MIT.

Repository instructions for finding definitions, references, and diagnostics in code by trying a language server before text search.

In plain words
What is it for?
Navigating source code, finding callers and implementations, inspecting file structure, and checking code diagnostics.
Why use it?
They reduce noisy search results and help contributors locate the actual symbol or type in a codebase.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/rjmurillo/ai-agents/lsp-first
Clone the repo
git clone --depth 1 https://github.com/rjmurillo/ai-agents

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-agents lsp-first.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/rjmurillo/ai-agents/lsp-first.svg)](https://agentmods.dev/instructions/rjmurillo/ai-agents/lsp-first)
Your own site
<a href="https://agentmods.dev/instructions/rjmurillo/ai-agents/lsp-first"><img src="https://agentmods.dev/badge/instructions/rjmurillo/ai-agents/lsp-first.svg" alt="Measured on agentmods" height="20"></a>
Per session 774 This file is loaded in full into every session.
When invoked 774 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00774 $0.00774
Opus 5 $0.00387 $0.00387
Sonnet 5 $0.00155 $0.00155
Haiku 4.5 $0.00077 $0.00077

Measured yesterday against content hash 30b9acf25b69, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-agents lsp-first.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/lsp-first.instructions.md · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LSP-First Navigation

For code navigation, prefer a Language Server over text search. A symbol query (where is X defined, who calls X, what type is X) returns one file:line answer; a grep returns noisy matches and several wrong-file reads. The token difference is large on a real codebase.

This is the cross-harness source of truth. It states a preference; no runtime gate blocks a raw search. ADR-062 paired it with PreToolUse guards that blocked Read, Grep, and Glob until an LSP was tried; the 2026-07-17 amendment (issue #3214) retired them and kept the steering.

Scope is code extensions, not **: Claude reads paths, Copilot mirrors read applyTo. Markdown, logs, and plain text go back to grep, so do not widen it.

The three tiers

For any navigation or search of a code file, prefer in this order:

  1. Serena MCP symbolic tools when Serena is active: find_symbol (definition / search), find_referencing_symbols (references), get_symbols_overview (read a file's structure before reading its body), find_implementations, get_diagnostics_for_file.
  2. Native LSP when Serena is not active: the Claude Code built-in LSP tool (goToDefinition, findReferences, workspaceSymbol, hover, diagnostics, goToImplementation) on the Claude harness; Copilot CLI uses its language servers automatically.
  3. grep / glob / sed only when no LSP can navigate the file. This is the last resort, not a per-language exemption: if an LSP exists for the file type, use it.

When it applies

  • A symbol search (a camelCase / PascalCase / dotted / snake_case name) in a programming-language file: use find_symbol / find_referencing_symbols, not Grep or a symbol-shaped Glob.
  • Reading a code file: call get_symbols_overview (or a navigation tool) first, then read the symbol you need, not the whole file. After a couple of navigation calls in a session, read freely.
  • Delegating an implementation agent: subagents cannot reach MCP tools, so pre-resolve the symbols (file:line) into the delegation prompt.

Read the full file on GitHub · 66 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 66 lines · 774 tokens per session scan A 30b9acf25b69

Subscribe to this mod's changes

ai-agents lsp-first.instructions.md is an instructions file published in the GitHub repository rjmurillo/ai-agents (45 stars, last pushed today), licensed MIT. It adds 774 tokens to every session, about $0.0039 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.