lain
Copilot instructions9 starsChanged 2 months agoMITView on GitHub
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. 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…
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- lain-architectureSkill
- lain-comprehensionSkill
- lain-coordinationSkill
- lain-federationSkill
- lain-verifySkill
The file
We split this copilot-instructions.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 70
Semantic search needs a query model: if get_health reports no embedding model, semantic_search will not work — fall back to explain_symbol …
- Very specific: line 74
Don't use semantic_search with literal symbol names.
- Very specific: line 75
Don't call lain tools against a path outside the workspace.
- Very specific: line 76
Don't repeatedly call get_health.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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?"
get_health— confirm the workspace resolved correctly.find_anchors limit=5— top entry points.explain_symbol <top anchor>— understand it.get_blast_radius <top anchor>— see what depends on it.
"I'm about to refactor X"
get_blast_radius <X>— who will break.get_coupling_radar <X>— what else usually changes with it.find_test_file <X>(orfind_untested_functions) — what's already covered.- Make the change, then re-run
get_blast_radiusto verify no surprises.
"Where do we do X?" (semantic)
semantic_search query="<natural language>" limit=5— get candidates with body excerpts.explain_symbol <top result>— read it in context.
"What calls X?" / "What does X call?"
- Callers (incoming):
get_blast_radius <X> - Callees (outgoing):
trace_dependency <X>
"Read this symbol"
explain_symbol <X>for full context, orget_code_snippet <X>for raw source.
Caveats
- First-call latency: the very first tool call after a fresh server start can take 5–10s (model warmup). Don't panic.
- Workspace scope: bound to the git repository you opened this session in (auto-discovered from the working directory). Lain cannot analyze a different repo.
- Semantic search needs a query model: if
get_healthreports no embedding model,semantic_searchwill not work — fall back toexplain_symbol/find_anchorsand the query language.
Don't
- Don't use
semantic_searchwith literal symbol names; use natural language describing the concept. - Don't call lain tools against a path outside the workspace.
- Don't repeatedly call
get_health; once per session is enough.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

