code-context-finder
Automatically find relevant context from knowledge graph and code relationships while coding. Detects when context would be helpful (new files, unfamiliar code, architectural decisions) and surfaces related entities, prior decisions, and code dependencies.
Best use case
code-context-finder is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Automatically find relevant context from knowledge graph and code relationships while coding. Detects when context would be helpful (new files, unfamiliar code, architectural decisions) and surfaces related entities, prior decisions, and code dependencies.
Teams using code-context-finder should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/code-context-finder/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How code-context-finder Compares
| Feature / Agent | code-context-finder | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Automatically find relevant context from knowledge graph and code relationships while coding. Detects when context would be helpful (new files, unfamiliar code, architectural decisions) and surfaces related entities, prior decisions, and code dependencies.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Code Context Finder
## Overview
Find and surface relevant context while coding by combining knowledge graph search with code relationship analysis. Uses smart detection to identify when additional context would be helpful, then retrieves:
- **Knowledge graph entities**: Prior decisions, project context, related concepts
- **Code relationships**: Dependencies, imports, function calls, class hierarchies
## When to Use (Smart Detection)
This skill activates automatically when detecting:
| Trigger | What to Search |
|---------|----------------|
| Opening unfamiliar file | Knowledge graph for file/module context, code for imports/dependencies |
| Working on new feature | Prior decisions, related concepts, similar implementations |
| Debugging errors | Related issues, error patterns, affected components |
| Refactoring code | Dependent files, callers/callees, test coverage |
| Making architectural decisions | Past ADRs, related design docs, established patterns |
| Touching config/infra files | Related deployments, environment notes, past issues |
For detection triggers reference, load `references/detection_triggers.md`.
## Core Workflow
### 1. Detect Context Need
Identify triggers that suggest context would help:
```
Signals to watch:
- New/unfamiliar file opened
- Error messages mentioning unknown components
- Questions about "why" or "how" something works
- Changes to shared/core modules
- Architectural or design discussions
```
### 2. Search Knowledge Graph
Use MCP memory tools to find relevant entities:
```
# Search for related context
mcp__memory__search_nodes(query="<topic>")
# Open specific entities if known
mcp__memory__open_nodes(names=["entity1", "entity2"])
# View relationships
mcp__memory__read_graph()
```
**Search strategies:**
- Module/file names → project context
- Error types → past issues, solutions
- Feature names → prior decisions, rationale
- People names → ownership, expertise
### 3. Analyze Code Relationships
Find code-level context:
```python
# Find what imports this module
grep -r "from module import" --include="*.py"
grep -r "import module" --include="*.py"
# Find function callers
grep -r "function_name(" --include="*.py"
# Find class usages
grep -r "ClassName" --include="*.py"
# Find test coverage
find . -name "*test*.py" -exec grep -l "module_name" {} \;
```
For common search patterns, load `references/search_patterns.md`.
### 4. Synthesize Context
Present findings concisely:
```markdown
## Context Found
**Knowledge Graph:**
- [Entity]: Relevant observation
- [Decision]: Prior architectural choice
**Code Relationships:**
- Imported by: file1.py, file2.py
- Depends on: module_a, module_b
- Tests: test_module.py (5 tests)
**Suggested Actions:**
- Review [entity] before modifying
- Consider impact on [dependent files]
```
## Quick Reference
### Knowledge Graph Queries
| Intent | Query Pattern |
|--------|---------------|
| Find project context | `search_nodes("project-name")` |
| Find prior decisions | `search_nodes("decision")` or `search_nodes("<feature>")` |
| Find related concepts | `search_nodes("<concept>")` |
| Find people/owners | `search_nodes("<person-name>")` |
| Browse all | `read_graph()` |
### Code Relationship Queries
| Intent | Command |
|--------|---------|
| Find importers | `grep -r "from X import\|import X"` |
| Find callers | `grep -r "function("` |
| Find implementations | `grep -r "def function\|class Class"` |
| Find tests | `find -name "*test*" -exec grep -l "X"` |
| Find configs | `grep -r "X" *.json *.yaml *.toml` |
## Integration with Coding Workflow
### Before Making Changes
1. Check knowledge graph for context on module/feature
2. Find all files that import/depend on target
3. Locate relevant tests
4. Review prior decisions if architectural
### After Making Changes
1. Update knowledge graph if significant decision made
2. Note new patterns or learnings
3. Add observations to existing entities
### When Debugging
1. Search knowledge graph for similar errors
2. Find all code paths to affected component
3. Check for related issues/decisions
4. Document solution if novel
## Resources
### references/
- `detection_triggers.md` - Detailed trigger patterns for smart detection
- `search_patterns.md` - Common search patterns for code relationships
### scripts/
- `find_code_relationships.py` - Analyze imports, dependencies, and call graphsRelated Skills
react-context-setup
React Context Setup - Auto-activating skill for Frontend Development. Triggers on: react context setup, react context setup Part of the Frontend Development skill category.
path-traversal-finder
Path Traversal Finder - Auto-activating skill for Security Fundamentals. Triggers on: path traversal finder, path traversal finder Part of the Security Fundamentals skill category.
hardcoded-credential-finder
Hardcoded Credential Finder - Auto-activating skill for Security Fundamentals. Triggers on: hardcoded credential finder, hardcoded credential finder Part of the Security Fundamentals skill category.
cursor-context-management
Optimize context window usage in Cursor with @-mentions, context pills, and conversation strategy. Triggers on "cursor context", "context window", "context limit", "cursor memory", "context management", "@-mentions", "context pills".
agent-context-loader
Execute proactive auto-loading: automatically detects and loads agents.md files. Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.
filesystem-context
This skill should be used when the user asks to "offload context to files", "implement dynamic context discovery", "use filesystem for agent memory", "reduce context window bloat", or mentions file-based context management, tool output persistence, agent scratch pads, or just-in-time context loading.
what-context-needed
Ask Copilot what files it needs to see before answering a question
sponsor-finder
Find which of a GitHub repository's dependencies are sponsorable via GitHub Sponsors. Uses deps.dev API for dependency resolution across npm, PyPI, Cargo, Go, RubyGems, Maven, and NuGet. Checks npm funding metadata, FUNDING.yml files, and web search. Verifies every link. Shows direct and transitive dependencies with OSSF Scorecard health data. Invoke with /sponsor followed by a GitHub owner/repo (e.g. "/sponsor expressjs/express").
context-map
Generate a map of all files relevant to a task before making changes
llm-icon-finder
Finding and accessing AI/LLM model brand icons from lobe-icons library. Use when users need icon URLs, want to download brand logos for AI models/providers/applications (Claude, GPT, Gemini, etc.), or request icons in SVG/PNG/WEBP formats.
claude-code-history-files-finder
Finds and recovers content from Claude Code session history files. This skill should be used when searching for deleted files, tracking changes across sessions, analyzing conversation history, or recovering code from previous Claude interactions. Triggers include mentions of "session history", "recover deleted", "find in history", "previous conversation", or ".claude/projects".
go-context
Use when working with context.Context in Go — placement in signatures, propagating cancellation and deadlines, and storing values in context vs parameters. Also use when cancelling long-running operations, setting timeouts, or passing request-scoped data, even if they don't mention context.Context directly. Does not cover goroutine lifecycle or sync primitives (see go-concurrency).