scalex AGENTS.md

scalex AGENTS.md is an instructions file for Codex, OpenCode from nguyenyou/scalex. It costs 2,767 tokens per session, scanned A, original, MIT.

A repository guide for Scalex, a Scala command-line tool that finds symbols, definitions, and references in source code without an IDE, build server, or compilation. It also defines where to search and how to record planned work.

In plain words
What is it for?
Use it when planning features, searching Scala source code, finding definitions or references, or following the project’s development workflow.
Why use it?
It prevents searches from being overwhelmed by unrelated files and keeps implementation work aligned with the project roadmap.

Instructions file for CodexOpenCode

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/nguyenyou/scalex/agents-md
Clone the repo
git clone --depth 1 https://github.com/nguyenyou/scalex

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for scalex AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nguyenyou/scalex/agents-md.svg)](https://agentmods.dev/instructions/nguyenyou/scalex/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/nguyenyou/scalex/agents-md"><img src="https://agentmods.dev/badge/instructions/nguyenyou/scalex/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,767 This file is loaded in full into every session.
When invoked 2,767 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.02767 $0.02767
Opus 5 $0.01384 $0.01384
Sonnet 5 $0.00553 $0.00553
Haiku 4.5 $0.00277 $0.00277

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

Security

Grade A, and why

scalex AGENTS.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 3d 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.

AGENTS.md · 169 lines

How it starts

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

AGENTS.md

This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.

What is Scalex

Scalex is a Scala code intelligence CLI for coding agents. It provides fast symbol search, find definitions, and find references — without requiring an IDE, build server, or compilation. Designed as a Codex plugin.

IMPORTANT: No company references

NEVER mention any company names, internal project names, proprietary codebases, or organization-specific details in any output — including commit messages, PR descriptions, changelogs, roadmaps, documentation, code comments, or conversations. Always use generic examples (e.g. HttpMessageService, UserServiceLive) instead.

Search scope

Source code lives in src/ (production) and tests/ (test suite). When searching for Scala code, scope searches to these directories. Avoid searching repo-wide — benchmark/ contains ~17.7k Scala files from the scala3 compiler clone that will pollute results.

Workflow

  • Before planning or implementing any feature, first add it to docs/ROADMAP.md under the appropriate section
  • The roadmap is the source of truth for what's planned and what's done
  • Bug fix workflow: When receiving a bug report, always write a failing test that reproduces the bug before writing the fix. This validates the bug is real and ensures the fix is verifiable. Only then apply the code fix and confirm the test passes.

Build & Run

# Run via scala-cli (development)
scala-cli run src/ -- <command> [args...]

# Run tests
scala-cli test src/ tests/

# Build GraalVM native image (requires GraalVM + scala-cli)
./build-native.sh
# Output: ./scalex (26MB standalone binary)

# Validate Codex plugin structure
Codex plugin validate plugins/scalex/

Architecture

Source code is in src/, tests in tests/ (Scala 3.8.2, JDK 21+). When searching the codebase, scope to these directories to avoid hitting benchmark data or build artifacts.

src/                           # Production source code
├── project.scala              # scala-cli directives only
├── model.scala                # Data types, enums, version constant
├── extraction.scala           # AST parsing & single-file extraction functions
├── index.scala                # Git integration, persistence, WorkspaceIndex, filtering
├── analysis.scala             # Cross-index analysis (hierarchy, overrides, deps, diff, ast-pattern)
├── format.scala               # Text formatters for symbols and references
├── cli.scala                  # Arg parsing, workspace resolution, @main entry point
├── command-helpers.scala      # Shared filters: filterSymbols, filterRefs, mkNotFoundWithSuggestions
├── dispatch.scala             # Command map + runCommand
└── commands/                  # One file per command (ls to discover all 25 commands)
    ├── definition.scala       # cmdDef
    ├── search.scala           # cmdSearch
    ├── refs.scala             # cmdRefs
    ├── hierarchy.scala        # cmdHierarchy
    ├── overview.scala         # cmdOverview
    └── ...                    # 25 commands total

tests/                         # Test suite
├── test-base.test.scala       # Shared test fixture (workspace setup)
├── extraction.test.scala      # Extraction tests
├── index.test.scala           # Index/search/persistence tests
├── analysis.test.scala        # Analysis tests (hierarchy, overrides, deps, etc.)
└── cli.test.scala             # CLI/formatting/command output tests

benchmark/                     # Benchmark data (gitignored)
├── scala3/                    # Shallow clone of scala/scala3 for benchmarks
└── results/                   # Hyperfine JSON exports

Read the full file on GitHub · 169 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. 3d ago First seen · 169 lines · 2,767 tokens per session scan A 96b5a7d45d03

Subscribe to this mod's changes

scalex AGENTS.md is an instructions file published in the GitHub repository nguyenyou/scalex (94 stars, last pushed 2mo ago), licensed MIT. It adds 2,767 tokens to every session, about $0.0138 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-30.