All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- DebugServer supports concurrent sessions: falls back to an OS-assigned ephemeral port when the configured port (9004) is already in use, and cleanup now only targets its own child process instead of every session sharing a session key (#89).
- xstep JSON output includes
debug_port(always) andrequested_port(only when a fallback occurred), so JSON-only callers can detect a port fallback (#90).
- Cachegrind profile parsing now streams the file in a single pass instead of loading it whole, reducing memory use on large profiles (#89).
- DebugServer no longer silently discards session failures (listener-bind, connection, spawn errors); they now propagate with a non-zero exit and a stderr message (#89).
- Conditional breakpoints are sent DBGp-encoded instead of as unescaped source on the command line, fixing a silent parse error for conditions containing spaces (#89).
- A read failure mid-DBGp-frame no longer desyncs subsequent reads (#89).
setBreakpoint()throwsBreakpointExceptionon an empty response instead of recording a breakpoint that was never actually set (#89).- The MCP stdin loop no longer wedges on a single malformed line; each line is now parsed independently (#89).
- Non-UTF-8 bytes in tool output no longer break MCP response encoding (#89).
- CompareRunner removes its temporary git worktree on a fatal error, not only on normal return or a thrown exception (#89).
- xstep step-recording JSON is slimmed (~30% smaller, no information loss): per-step
location/functionare dropped (read them fromstack[0]), the sharedbreakpointis emitted once at the top level instead of on every step, andvariablesis omitted on diff frames (recoverable fromdiff) (#86). - xprofile
time_ms/memory_mbare now real measurements parsed from the cachegrindsummary:line (via theevents:header) instead of heuristic estimates (#87). - xprofile
bottlenecksis now a structured array[{function, percentage, time_ms}]instead of preformatted strings, so it can be filtered/sorted programmatically (#87). - Output format details now live in the JSON schemas; the xdebug skill and MCP tool descriptions defer to them instead of restating the shape (#86, #87).
- xprofile per-function cost summed the line number instead of the Time column, making bottleneck percentages meaningless; costs are now time-based and the bottleneck
time_msvalues sum to the reported total (#87).
- Dead
XdebugProfilerclass and unusedProfileStatistics/ProfileAnalysisDTOs — never instantiated; both the CLI and MCP paths go throughbin/xprofile(#88).
- xcoverage raw mode now supports collecting coverage for inline PHP passed via
-r/--run(#83). - xprofile JSON mode supports profiling inline PHP via
-r/--run(#83).
- Inline code handling preserves
__LINE__and leadingdeclare(strict_types=1)(#83). --branch-coverageis rejected for PHP inline code with a clear error message (#83).- Safer git worktree creation and cleanup in xcompare with improved failure recovery (#84).
- xcompare diff output is now deterministic with consistent ordering (#84).
- CLI error messages on runtime failures are now concise without stack traces (#84).
- Add
AGENTS.mdcontributor guidance, including public output hygiene for PRs, issues, release notes, docs, and examples (#82).
- Align CLI help, bin documentation, troubleshooting examples, and the internal
JSON regression script with the current
x*command set (#82). - Stop publishing
bin/test-jsonas a Composer bin command; it remains an internal regression script (#82).
- Apply shared vendor filtering across trace, step, profile analysis, and raw
coverage paths so
--include-vendorbehavior matches the CLI help (#82). - Update profile schema validation references to the current
xprofile.jsonschema (#82).
- xcoverage / xback:
--cwd,--phpto support running against external projects without changing directory (#80). - xcoverage:
--source=PATH[,...]to restrict raw-mode coverage; mutually exclusive with--include-vendor(#80).
- DBGp XML sanitization: strip invalid numeric character references
(
�,�, surrogates, beyondU+10FFFF) (#81). - xback:
--phpoverride now reachesDebugServer(#80).
- xstep JSON ergonomics (#74):
--prettyfor indented JSON output--max-value-bytes=Nto truncate long string values (UTF-8 safe viamb_strcut)--max-depth=Nto cap nested array/object renderingfunctionandstackcontext attached to each break- Scalar before/after
diffand shallow key diffs between consecutive snapshots breakpoint.id/breakpoint.labelattached to each breakrecording_typefield (full|diff) documented indocs/schemas/xstep.json
- xcompare: Compare variable states at breakpoint across two different executions
- Runs xstep twice with different commands/inputs
- Computes diff: changed, unchanged, only_in_a, only_in_b
- Provides analysis_hints for AI-readable summary
- JSON schema:
docs/schemas/xcompare.json - Use case: Debug edge cases by comparing normal vs problematic inputs
--compare-with=REFmode to compare current code vs another git branch/commitxcompare --break=file.php:25 --run="php test.php" --compare-with=main- Automatically creates temporary worktree, runs comparison, cleans up
composer demo(#76): runs every CLI tool documented in the README against the bundleddemo/scripts and reports PASS/FAIL. Smoke test for users and CI.bin/xreplandbin/xcompareexposed viacomposer global require(#76): both shipped inbin/but were missing fromcomposer.json'sbinarray.
- BREAKING — Drop PHP 8.1 support (#75): minimum PHP version is now
^8.2.- Upgrade to PHPUnit 11 (
^11.0), migrate test attributes (#[DataProvider]static providers, removedexpectDeprecation*,assertObjectHasAttribute). - Remove
composer audit ignoreentries no longer needed under 8.2+. - CI matrix runs on PHP 8.2 / 8.3 / 8.4 / 8.5.
- Upgrade to PHPUnit 11 (
- README CLI examples (#76):
- Drop the broken
--exit-on-breakflag fromxstepexamples (the parser silently dropped it; default JSON mode already exits after recording). - Interactive REPL section now invokes
xrepl(notxstep). xcoverage --rawis required for plain PHP scripts; the previous example failed with "Class coverage cannot be found" because the default PHPUnit mode interpreted the script path as a test class.- Replace hard-coded
~/.composer/vendor/bin/check-envpath withcomposer global config bin-dir-based lookup so it works under XDG.
- Drop the broken
- Document
--pretty/--max-value-bytes/--max-depthin README CLI Usage. - Stale
php8.1references inprofiler/examples/basic-usage.mdandsrc/McpServer.phpexample messages updated tophp8.2.
0.8.0 - 2026-01-30
- xstep --watch: Expression-based step filtering for efficient loop debugging
--watch=EXPRevaluates PHP expressions at each step, records only when value changes- Multiple watches supported:
--watch="$i" --watch="count($items)" - Detects array/object internal mutations via content hashing
- Handles scope transitions (
initial,changed,out_of_scope) - JSON schema updated (
docs/schemas/xstep.json) withwatchesfield
- Coding Standards: Enforce Doctrine Coding Standard 13 strict rules
- Enable
EarlyExitrule: allelseblocks converted to early return pattern - Enable
PropertyTypeHint.MissingNativeTypeHint - Enable
ReturnTypeHint.MissingNativeTypeHint - Enable
PropertyTypeHint.MissingAnyTypeHint
- Enable
- Prevent duplicate JSON output in step recording
0.7.1 - 2026-01-16
- MCP Tool Search Optimization: Add server-level
instructionsfield to initialize response- Helps Claude Code's Tool Search feature find Xdebug tools when dynamically loading
- Keywords: PHP debugging, profiling, coverage, tracing
- Documentation: Add "Skills vs MCP Tools: Dual Interface Design" section to CLAUDE.md
- Explains difference between user-initiated Skills (
/xtrace) and AI-initiated MCP Tools - Documents Tool Search optimization behavior
- Explains difference between user-initiated Skills (
0.7.0 - 2026-01-11
- xcoverage: PHPUnit mode is now the default
- Uses
--coverage-cloverfor stable PHPUnit version compatibility - Respects
@codeCoverageIgnoreannotations andphpunit.xmlsettings - No php-code-coverage dependency (parses clover XML directly)
- Uses
- xcoverage:
--rawoption for original Xdebug direct coverage behavior- Use for non-PHPUnit projects or when annotation support is not needed
--branch-coverageand--include-vendorwork in raw mode only
0.6.1 - 2026-01-11
- Plugin Marketplace: Full plugin marketplace support with
marketplace.json- Install via:
/plugin marketplace add koriym/xdebug-mcpthen/plugin install xdebug@xdebug-mcp
- Install via:
- Plugin Discovery: Add
skillsfield toplugin.jsonfor skill registration - README: Add complete installation and usage instructions
0.6.0 - 2026-01-11
- Claude Code Plugin: Plugin marketplace support (
.claude-plugin/plugin.json)- Install via:
/plugin marketplace add koriym/xdebug-mcp
- Install via:
- Token Optimization: Reduce xcoverage output by 89% using range notation
- Key Naming: Improve readability (
user_functions,db_queries) - README: Update for plugin-first approach, add "Why xdebug-mcp?" section
- Schema: Support cross-platform path regex (Windows/Unix)
0.3.2 - 2025-11-03
- Standalone Execution Support: Fixed MCP server to work when invoked from any working directory (#27)
- Replaced relative paths (
./bin/*) with absolute paths usingdirname(__DIR__) - Enables Claude Code to invoke xdebug-mcp tools regardless of current working directory
- All MCP tools (x-trace, x-debug, x-profile, x-coverage) now work standalone
- Replaced relative paths (
- Profiler Filename Placeholder: Fixed cachegrind output filename to display actual process ID (#28)
- Changed placeholder from
%s(script name) to%p(process ID) in profiler_output_name - Output now shows
/tmp/cachegrind.out.12345instead of/tmp/cachegrind.out.%s - Makes profile files easy to identify and use with analysis tools
- Changed placeholder from
- JSON Output Parsing: Fixed
xdebug-profile --jsonto suppress script output for clean JSON (#28)- Script stdout/stderr now automatically suppressed in JSON mode
- Enables clean piping to jq:
... | jq '.["🎯 bottleneck_functions"]' - Human-readable mode unchanged (still shows script output)
- Windows Compatibility: Cross-platform output suppression in JSON mode
- Detect platform using
PHP_OS_FAMILY - Use 'NUL' on Windows, '/dev/null' on Unix for output redirection
- Fixes
xdebug-profile --jsonto work on Windows systems
- Detect platform using
0.3.1 - 2025-09-24
- Escape special glob characters in trace_output_name pattern
- Improve error messages for trace file detection
- Remove obsolete skipped tests
- Clean up test suite
0.3.0 - 2025-01-02
- AI-Optimized Help Documentation: Comprehensive
--helpoutput for all xdebug tools with AI-first design philosophy
- MCP Tool Security: Added proper shell escaping with
escapeshellarg()to prevent command injection - Claude Code Compatibility: Fixed x-coverage MCP tool not responding in interface
- Argument Parsing: Improved handling of quotes and spaces in MCP tool arguments
- Default Behavior: x-coverage now defaults to
php vendor/bin/phpunit --no-coveragewhen no arguments provided
- xdebug-coverage: AI-optimized JSON output with PHPUnit integration and automatic
--no-coverageflag - xdebug-debug: Non-invasive debugging with JSON output for AI consumption
- xdebug-trace: Runtime execution analysis as alternative to static code analysis
- xdebug-profile: Precision performance metrics with microsecond timing
- MCP Tools: All 4 slash commands (x-trace, x-debug, x-profile, x-coverage) now work reliably in Claude Code
- Fixed shell injection vulnerability in x-coverage tool
- Added comprehensive argument validation across all MCP tools
- Updated README.md with AI-first design philosophy
- Enhanced PACKAGE_USAGE.md with tool usage guidance
0.2.1 - 2025-08-31
- Unified Trace Analysis System: New comprehensive trace analysis infrastructure
- Added
xdebug-analyzeunified CLI tool for all trace analysis needs - Support for multiple analysis modes: summary, comparison, bottlenecks extraction, function search
- Emoji-prefixed JSON output for enhanced AI readability and navigation
- Context-aware analysis with
--contextoption for self-explanatory debugging data
- Added
- Advanced Profiler Integration: Complete profiler directory structure
TraceAnalyzer.phpandTraceUtils.phpfor large file processing (>10MB)- Comprehensive bin tools:
trace-analyze,trace-bottlenecks,trace-compare,trace-summary - AI integration strategy and architecture documentation
- JSON schema for trace analysis standardization
- AI-Optimized Debugging Workflow: Strategic integration planning
INTEGRATION_PLAN.mdwith phased implementation roadmap- Navigation tools for large trace file analysis
- AI-driven performance bottleneck identification
- Self-contained analysis data with contextual metadata
- Trace Analysis Capabilities: Multi-mode analysis support
- Executive summary generation for quick insights
- Performance comparison between trace files
- Targeted bottleneck extraction with configurable limits
- Function search and call pattern analysis
- Documentation: Complete profiler architecture documentation
- AI integration strategy and technical implementation details
- Usage examples and workflow guidelines
- Schema validation and output standardization
0.2.0 - 2025-08-30
- Dynamic Vendor Filtering System: Intelligent vendor package inclusion/exclusion
- CLI
--include-vendoroption with pattern matching support usingfnmatch() - Support for specific packages (
bear/resource,ray/di), wildcards (bear/*), and full inclusion (*/*) - Integration with MCP tools via
include_vendorparameter for AI-driven filtering - Robust CLI argument parsing using
getopt()instead of manual parsing - Backward compatibility with default vendor exclusion behavior
- CLI
- Ultra-Simple Coverage Tool: New 25-line
xdebug-coverageimplementation- Native Xdebug format output with JSON schema validation
- Automatic vendor/ and tests/ directory filtering using
xdebug_set_filter() - Works with any PHP script, not just PHPUnit
- Clean JSON output with comprehensive schema documentation
- Enhanced Vendor Filtering: Replaced environment variable-based filtering with advanced CLI argument system
- CLI Tool Consistency: Standardized argument handling across all tools with
--separator support - Slide Presentation Completion: Finalized "Forward Trace Revolution" presentation
- Removed framework-specific examples (Laravel/Pest) for universal focus
- Enhanced AI Code Quality messaging beyond "Tests Pass"
- Streamlined coverage tool advantages to core value propositions
- Documentation Improvements: Fixed broken links and updated tool references
- Fixed
docs/index.htmlbroken links pointing to non-existent directories - Updated all
test-coveragereferences toxdebug-coveragein CLAUDE.md - Enhanced JSON schema documentation with xdebug.org links
- Fixed
- Environment variable-based vendor filtering (
XDEBUG_MCP_DISABLE_VENDOR_FILTER) - Redundant test methods for simplified tools
- "Test framework independent" obvious advantage from coverage tool messaging
- Command injection vulnerabilities through proper argument escaping
- Tool reliability issues by using PHP_BINARY instead of shell execution
- Test suite alignment with simplified tool implementations
0.1.0 - 2025-08-26
-
JSON Schema Support for AI-Optimized Debugging
- Added
--jsonflag toxdebug-debugCLI for structured output - Implemented JSON output with trace metadata:
trace_file,lines,size,command - Created comprehensive JSON Schema (draft-07) with AI guidance links
- Added GitHub Pages publication for documentation
- Added
-
AI Debugging Integration
- Published AI debugging principles to
docs/ai-debugging-with-debugger.md - Created practical AI analysis guidelines in
docs/debug_guideline_for_ai.md - Integrated file size-based AI reading strategies (small/medium/large files)
- Added Xdebug trace format documentation for AI systems
- Published AI debugging principles to
-
Documentation Enhancements
- Added "From Guesswork to Evidence" narrative with Var_Dump Age vs AI-Native Age comparison
- Enhanced README with debugging evolution examples
- Created comprehensive debugging workflow documentation
- Added JSON debugging integration guidelines
-
Quality Improvements
- Implemented command argument escaping with
escapeshellarg()for security - Added URL validation GitHub Actions workflow
- Created versioned JSON schema with proper validation
- Enhanced error handling and input validation
- Implemented command argument escaping with
- Command arguments are now properly escaped to prevent shell injection
- JSON output uses secure string handling
- Added GitHub Actions workflow for documentation URL validation
- Enhanced CI pipeline with link checking capabilities
- Improved schema validation and documentation integrity
This initial release introduces revolutionary AI-powered PHP debugging capabilities that eliminate the need for traditional var_dump() debugging. The JSON Schema support enables AI assistants to perform evidence-based debugging analysis using actual runtime data from Xdebug traces.
- Evidence-Based Debugging: Move from guesswork-driven to technology-driven debugging
- AI Integration: Native support for AI analysis of execution traces
- Non-Invasive: Zero source code modification required
- Comprehensive: Full execution visibility with conditional breakpoints
- Gather user feedback on AI debugging workflows
- Expand JSON support to additional Xdebug tools
- Enhance AI analysis capabilities based on real-world usage
- Build community around modern PHP debugging practices