Codebase analysis

Understand code structure with the built-in analysis tool — project overviews, file semantics and cross-file symbol tracking for refactoring and debugging.

The built-in analysis tool

ChengYoung ships a code-analysis extension (enabled by default) that gives the agent an analyze tool: understand code structure, track symbol usage and explore cross-file call graphs, across popular programming languages. No parameters to memorize — describe what you need in plain language.

Three analysis modes

Project structure overview

Analyze a directory to understand organization, spot large files and see overall metrics:

  • "Analyze the structure of my src/ directory"
  • "Where is the main entry point of this project?"

File semantics

Inspect a single file's functions, classes and imports:

  • "What functions are in main.py?"
  • "Show me the structure of src/utils.py"

Cross-file symbol tracking

Focus on a function or class to see where it is defined and who calls it — ideal for refactoring and debugging:

  • "Trace the call chain of the authenticate function"
  • "Where is UserClass used?"

Handling large outputs

When results exceed 50,000 characters the tool returns a warning instead. Options:

  • Narrow the scope: analyze a specific subdirectory or file;
  • Reduce depth: limit subdirectory levels for directory analysis;
  • Summarize in stages: analyze, then ask the agent to summarize the key points instead of dumping everything into context.

Practices

  • Start small (specific files or subdirectories) before analyzing whole projects;
  • Use .gitignore to exclude node_modules/, build artifacts and other noise — faster and sharper analysis;
  • Cross-check conclusions against the actual code — the tool reports structural facts; business meaning is yours to judge.

This page is adapted from upstream open-source documentation (Apache-2.0) with modifications; see /legal/provenance for sources and changes.