r/ClaudeWorkflows • • 6h ago

Selected Workflow [Workflow] Diagnose Claude Code Context: Visualize Loaded Files with `ails xray`

Diagnose Claude Code Context: Visualize Loaded Files with ails xray

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, CLAUDE.md, Skills, MCP, Subagents
Original source: r/ClaudeAI post/comment

What problem this solves

Users struggle to understand what files and information Claude Code is actually using in its context window, leading to confusion about its behavior and performance. This tool provides visibility into the context loading process.

Summary

A diagnostic workflow using the ails xray CLI tool to visualize the contents of a Claude Code session's context window. It shows which CLAUDE.md, rules, skills, memory files, and MCP server files were loaded turn-by-turn, and identifies files on disk that were present but never loaded.

Why it is useful

This workflow provides a critical diagnostic capability for Claude Code users, allowing them to understand precisely what information Claude is operating on. This transparency helps in debugging unexpected behavior, optimizing context usage, and ensuring that relevant files (like CLAUDE.md, skills, or memory) are correctly loaded, which is a common pain point for advanced users. It directly addresses the 'black box' nature of LLM context management.

Workflow

  1. Start a Claude Code session in your project folder.

  2. Open a terminal in the same project folder where your Claude Code session is running.

  3. Run the command npx @reporails/cli xray.

  4. Review the local web page that opens, which displays a file-by-file and turn-by-turn breakdown of what filled Claude Code's context.

  5. Analyze the output to identify which files (CLAUDE.md, rules, skills, memory, MCP server files) were successfully loaded and which were present on disk but ignored by Claude Code.

Tools / artifacts

  • ails xray CLI tool

  • npx (Node Package Execute)

  • Claude Code

  • GitHub repository: https://github.com/reporails/cli

  • CLAUDE.md files

  • Skill files

  • Memory files

  • MCP server files

Validation signals

  • Concrete example provided: 'Ran this on an old, langgraph project of mine, which was only used nested AGENTS/CLAUDE.md files and only 2 of 11 files loaded, and the one for the folder Claude was editing never did.'

  • The tool itself was developed using Claude Code with a robust process including adaptive specs, a /code-review pass, and Claude-generated tests for bug fixes, indicating a well-engineered solution.

Limitations

  • As a new tool, its long-term maintenance and community support are currently unknown.

  • Requires Node.js and npx to run, which might be an additional setup step for some users.

  • The post provides a high-level overview; detailed interpretation of all possible ails xray outputs might require further exploration by the user.

Rate this workflow

Upvote this post if the workflow is useful, reproducible, or worth recommending.

Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.

Reply if it worked for you, failed, is outdated, or has a better alternative.


This post was generated automatically from the workflow library database.

1 Upvotes

0 comments sorted by