x-ray

A codebase-exploration workflow that uses meaning-based search and relationship mapping to investigate an existing project. It turns a broad question into focused searches and source inspection.

In plain words
What is it for?
Finding code by concept, tracing how components relate, and inspecting the source needed to answer questions about a repository.
Why use it?
It helps locate the relevant implementation and understand connected code when file names or terminology are unfamiliar.

Skill for Claude CodeCodex

Part of the codanna-toolset plugin — 2 skills shipped together

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 skills/bartolli/codanna/x-ray
Any agent
npx skills add bartolli/codanna --skill x-ray
Clone the repo
git clone --depth 1 https://github.com/bartolli/codanna

Made for: Claude Code, Codex.

Or install codanna-toolset, the plugin that ships this one along with the rest of its 2 skills.

Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,998 The whole file, excluding the scripts and references it only reads on demand.
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.00025 $0.01998
Opus 5 $0.00013 $0.00999
Sonnet 5 $0.00005 $0.00400
Haiku 4.5 $0.00003 $0.00200

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

Security

Grade A, and why

x-ray 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.

The scan reads SKILL.md. This mod also ships 20 executable files (graph/bundle-render.js, graph/collapse-render.js, graph/dag-render.js, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/plugins/claude/codanna-toolset/skills/x-ray/SKILL.md · 172 lines

How it starts

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

Reframe

LITERAL: "$ARGUMENTS"

Definitions

  • LITERAL — what the user typed
  • INTENT — what they mean, given SESSION_CONTEXT
  • SESSION_CONTEXT — recent work; held by you, not by the index
  • BRIDGE — your job: LITERAL + SESSION_CONTEXT → INTENT → query

Rules

  • Search INTENT, not LITERAL.
  • Context disambiguates → NARROW.
  • Context insufficient → BROAD. Vague beats confidently-wrong-narrow.

Transforms (LITERAL → INTENT)

  • VAGUE → specify ("that parsing thing" → "language parser implementation")
  • QUESTION → keywords ("how does parsing work?" → "parsing implementation process")
  • CONVERSATIONAL → technical ("stuff that handles languages" → "language handler processor")
  • BROAD → contextualize ("errors" → "error handling exception management")
  • CONTEXTUAL → reconstruct ("the logging" → "prompt eval logging", when SESSION_CONTEXT = prompt eval work)

OptimizedQuery: {written against INTENT}


Loop

Definitions

  • SEARCH — codanna mcp semantic_search_with_context query:"<q>" limit:5

  • INSPECT — read source at a LOCATION (Read tool or sed -n 'A,Bp' file)

  • TRAVERSE — codanna retrieve describe <name|symbol_id:N> on a RELATIONSHIP

  • REFINE — return to SEARCH with a new OptimizedQuery

  • RESULT — one hit from SEARCH; carries SCORE, signature, doc, LOCATION, RELATIONSHIPS

  • SCORE — relevance ∈ [0,1]; focus on SCORE > 0.6

  • LOCATION — file_path:start_line-end_line

  • RELATIONSHIPS — calls, called_by, implements, defines

Default flow

  1. SEARCH(OptimizedQuery)
  2. For each RESULT with SCORE > 0.6:
    • INSPECT if signature/doc is insufficient
    • TRAVERSE 1–2 RELATIONSHIPS that look load-bearing
  3. Picture incomplete → REFINE with what you learned
  4. INTENT answered → stop

INSPECT mechanics

LOCATION src/io/exit_code.rs:108-120

  • Read tool: file_path=<env.cwd>/src/io/exit_code.rs, offset=108, limit=13
  • limit formula: end_line - start_line + 1
  • sed (Unix only): sed -n '108,120p' src/io/exit_code.rs

Read the full file on GitHub · 172 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 · 172 lines · 25 tokens per session scan A 0100e7b165c2

Subscribe to this mod's changes

x-ray is a skill published in the GitHub repository bartolli/codanna (729 stars, last pushed 4d ago), licensed Apache-2.0. It adds 25 tokens to every session and 1,998 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

use-ivygrep

Gather focused local repository context with ivygrep before implementing, debugging, reviewing, or explaining code. Use for coding tasks involving unfamiliar paths, branch changes, stack traces, architectural relationships, callers, dependents, tests, configuration, or documentation. Prefer one bounded context pack…

bvolpato/ivygrep · 65 tokens

codemeridian-refactor

Plan safer refactors with CodeMeridian by checking graph freshness, exact symbols, impact, tests, duplication, and architecture risk before editing.

Driftya/code-meridian · 34 tokens

codemeridian-test-planning

Plan focused tests with CodeMeridian by finding relevant test shields, coverage gaps, impacted behavior, and the smallest useful test set before implementation.

Driftya/code-meridian · 35 tokens

human-cognitive-seed

Preserve and strengthen the user's independent reasoning during design, strategy, learning, interpretation, hypothesis work, and consequential decisions, and preserve justified durable context with explicit provenance when supported. Use when a task benefits from human-led judgment, model-building, productive…

Driftya/code-meridian · 99 tokens

codemeridian-context

Gather minimal, graph-grounded CodeMeridian context before implementation, refactoring, deletion, debugging, or test planning.

Driftya/code-meridian · 29 tokens

codemeridian-frontend

Route frontend HTML/CSS/SCSS work through CodeMeridian's generic frontend-aware tools first, then use cascade and style-duplicate analysis only when the question is truly frontend-specific.

Driftya/code-meridian · 43 tokens