context-finderlisted
Install: claude install-skill adamw7/tools
# Context Finder Skill
Use `code/context` to answer "which classes does this file actually need?" and
"how many tokens will that cost?" — the module behind the `project_tree`,
`find_context`, `estimate_tokens` and `okf_bundle` MCP tools.
## The core contract
```java
public interface Context {
Set<ClassContainer> find(ClassContainer root, int depth);
}
```
A `ClassContainer` is just a `className` (the file name) plus its
`originalCode`. `depth` bounds a breadth-first expansion, so nearest
dependencies come first — which is what makes budgeting meaningful.
Load a project's sources with `new ProjectSources(Language.JAVA).load(root)`,
which returns `Map<Path, ClassContainer>`. Languages: `JAVA` (`.java`),
`KOTLIN` (`.kt`), `SCALA` (`.scala`).
## Pick the right finder
| Finder | Resolves by | Use when |
|---|---|---|
| `Finder` | simple file name, indexed once at construction | one class per simple name; fastest |
| `PackageAwareFinder` | `package` + `import` declarations | two classes share a simple name in different packages |
`PackageAwareFinder` prefers, in order: an explicit import, the referencing
file's own package, a wildcard import, then a sole project-wide candidate — and
leaves a genuinely ambiguous reference **unresolved rather than guessed**. Both
strip comments and string/character literals before matching, so a class name
mentioned in a comment is not reported as a dependency. The
`package`/`import` grammar is shared by all three languages.
## Budgeting
`B