lain copilot-instructions.md

Instructions for Lain, an MCP server that indexes a codebase and answers structural questions about it. It supports finding important code, searching by meaning, tracing dependencies, and exploring architecture.

In plain words
What is it for?
Use it to locate entry points, callers, related files, tests, unused code, and likely change impact. It is intended for codebase-level questions rather than simple file reads.
Why use it?
It helps an agent understand how a codebase is organized and what may be affected by a change, beyond searching for exact text.

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/spuentesp/lain/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/spuentesp/lain

Made for: GitHub Copilot.

Per session 960 This file is loaded in full into every session.
When invoked 960 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.00960 $0.00960
Opus 5 $0.00480 $0.00480
Sonnet 5 $0.00192 $0.00192
Haiku 4.5 $0.00096 $0.00096

Measured 2d ago against content hash 81466c81c20e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lain copilot-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 2d ago.

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/copilot-instructions.md · 77 lines

How it starts

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

LAIN — Codebase Intelligence

You have access to the Lain MCP server (tool prefix mcp__lain__). Lain indexes the current workspace and exposes tools for structural queries, semantic search, and code navigation.

When to use lain

Reach for lain when the question is about structure, not single lines:

  • "Where should I start reading this codebase?"
  • "What does X depend on?" / "Who calls X?"
  • "If I change X, what else breaks?"
  • "Where do we do X?" (semantic search by meaning)
  • "What is this function/class doing?"
  • "Is there unused code?"
  • "What files change together?"
  • "Which test covers X?" / "What's untested?"

Skip lain for simple file reads, single-line grep, or trivial edits.

The most useful tools

Tool When to use it
get_health First call in any session. Returns the resolved workspace, node counts, and status.
find_anchors "Where should I start reading?" — most-called, most-stable symbols.
list_entry_points Find main()s and entry points.
explore_architecture High-level module/file tree.
get_blast_radius "If I change X, what breaks?" — transitive callers.
trace_dependency "What does X depend on?" — callees + imports.
get_call_chain Specific call path between two symbols.
semantic_search Find code by meaning (e.g. "rate limiting", "retry logic"). Body excerpts included.
explain_symbol "What is this symbol?" — source + callers + callees + anchor.
get_code_snippet Read the exact source of a symbol by id.
find_dead_code Unused definitions (filters false positives).
get_coupling_radar "What files change with X?" (co-change history).
get_cross_runtime_callers Cross-language callers (e.g. Python → Rust FFI).
find_test_file / find_untested_functions / get_coverage_summary Test discovery and coverage.
get_file_diff / get_commit_history Git operations on the workspace.

Workflows

"I'm new here, where do I start?"

  1. get_health — confirm the workspace resolved correctly.
  2. find_anchors limit=5 — top entry points.
  3. explain_symbol <top anchor> — understand it.
  4. get_blast_radius <top anchor> — see what depends on it.

Read the full file on GitHub · 77 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. 2d ago First seen · 77 lines · 960 tokens per session scan A 81466c81c20e

Subscribe to this mod's changes

lain copilot-instructions.md is an instructions file published in the GitHub repository spuentesp/lain (6 stars, last pushed 3d ago), licensed MIT. It adds 960 tokens to every session, about $0.0048 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-08-31.