code-exploration
Cross-Repository Code Exploration via Glean
When users need to understand code across internal repositories—beyond the local codebase—use Glean's code search to explore the entire organization's code.
Tool Naming
See the glean-tools-guide skill for Glean MCP tool naming conventions. Tools follow the pattern mcp__glean_[server-name]__[tool] where the server name is dynamic.
When This Applies
Use Glean code search when users ask about:
- How something is implemented (in other repos)
- Where the code for a system/service lives
- Who has been working on a codebase
- Similar implementations across the org
- Examples of how to use an internal API/library
- Code patterns used by other teams
BE SKEPTICAL
Not every code result is worth presenting.
Quality Test
- Is this good code to reference?
- ✅ GOOD: Clean, tested, actively maintained
- ⚠️ ACCEPTABLE: Works but has caveats
- ❌ POOR: Hacky, deprecated, abandoned
Recency Test
- Is this code maintained?
- ✅ ACTIVE: Commits in past 3 months
- ⚠️ SLOWING: 3-12 months since last commit
- ❌ STALE: 12+ months - likely outdated patterns
Relevance Test
- Does this actually answer the question?
- ✅ RELEVANT: Directly addresses what was asked
- ⚠️ RELATED: Similar but different context
- ❌ TANGENTIAL: Keyword match only
Filter Out:
- Code in
/deprecated/,/old/,/legacy/paths - Abandoned repositories
- Prototype/experimental code
- Code with extensive TODO/FIXME comments
Quality over quantity: 3 good examples beat 10 mediocre ones.
Key Differentiator
Local tools (grep, glob) search only the current repo. Glean searches across ALL repositories in the organization. This is powerful for:
- Finding examples: "How do other teams handle authentication?"
- Understanding systems: "What repos touch the billing service?"
- Finding owners: "Who's been active in the payments codebase?"
Tool Selection
| User Intent | Glean Tool |
|---|---|
| Find code by content, pattern, or file | code_search |
| Find related design docs or specs | search |
| Identify code owners/contributors | code_search + employee_search |
| Read full file content | read_document |
Query Patterns
Glean's code search understands natural language. Use filters for precision:
# Search by content
code_search "authentication middleware"
code_search "rate limiting implementation"
# Search by contributor
code_search "owner:\"John Smith\" billing service"
code_search "from:me updated:past_week"
# Search by time
code_search "after:2024-01-01 payments API"
# Search by file pattern
code_search "*.proto user service"
Workflow: Exploring a System
- Find the code:
code_search "[system name]" - Vet results: Filter for quality and recency
- Find the docs:
search "[system name] design doc OR architecture" - Find the people:
code_search "owner:* [system] updated:past_month" - Read details:
read_documentwith URLs from vetted results
If No Good Code Found
Don't pad with weak results:
No high-quality code examples found for [topic].
**What was searched:**
- [Queries attempted]
**What was filtered:**
- [X] matches - [reasons: outdated/poor quality]
**Suggestions:**
- Check external libraries
- Ask in [relevant channel]
- This may need to be built from scratch
Relationship to Commands
For structured workflows, suggest the relevant slash command:
/glean-code:codebase-context [system]- Get comprehensive context/glean-code:find-examples [API/pattern]- Find usage examples/glean-code:code-owners [component]- Identify maintainers/glean-code:similar-code [pattern]- Find similar implementations
More from gleanwork/claude-plugins
glean-tools-guide
Use when Glean MCP tools are available and you need guidance on which tool to use, how to format queries, or best practices for enterprise search. This skill provides tool selection logic and query optimization for Glean integrations. Auto-triggers when mcp__glean tools are being considered.
14activity-synthesis
Use when the user asks about their recent work, what they've been doing, their contributions, or needs to recall past activity. Triggers on phrases like "what have I been working on", "what did I do last week", "my recent activity", "what have I accomplished", "summarize my work", "what projects am I on", or when the user needs to recall or reflect on their own work.
13project-awareness
Use when the user asks about project status, ownership, or context. Triggers on phrases like "status of X project", "who owns Y", "what's happening with Z", "project update", "where does the project stand", "what's the state of", "who's working on", or when needing quick project context without a full analysis.
13people-lookup
Use when the user asks about people, employees, team members, org structure, or expertise. Triggers on phrases like "who works on", "who is responsible for", "who owns", "find someone who knows", "who should I talk to", "who reports to", "team members", "org chart", or any question starting with "who" about the company.
12enterprise-search
Use when the user asks about company documents, internal wikis, policies, specifications, design docs, RFCs, or enterprise knowledge. Triggers on phrases like "find the doc about", "what's our policy on", "where is the spec for", "company guidelines", "internal documentation", or when searching for information that would be in enterprise systems rather than the local codebase.
12skill-creation-guide
Auto-triggers when users discuss creating skills or ask about SKILL.md format. Triggers on phrases like "create a skill", "write a skill", "make a skill", "new skill", "SKILL.md format", "skill structure", "how do skills work", "skill best practices", or when the user wants to add custom behavior to Claude Code.
11