zraly / tracy-ai-debug
Tracy exception logger for AI agents - exports errors to JSON format
v1.1.0
2026-02-09 10:44 UTC
Requires
- php: >=8.1
- nette/di: ^3.0
- nette/schema: ^1.2
- nette/utils: ^4.0
- tracy/tracy: ^2.10
Requires (Dev)
- nette/tester: ^2.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Composer package that logs Tracy exceptions to JSON files for AI agents.
Installation
composer require --dev zraly/tracy-ai-debug
Configuration (development only)
If the package is installed in require-dev, register the extension only in a development config file (for example config/local.neon).
# config/local.neon extensions: aiDebug: Zraly\AiDebug\DI\AiDebugExtension aiDebug: logDir: %appDir%/../log/ai-debug # Default enabled: true # Default snippetLines: 10 # Lines of code context
Usage
Once configured, Tracy errors are exported to JSON files in the configured directory.
AI Agent Workflow
This package keeps AI guidance minimal and tool-agnostic:
/AGENTS.mdis the canonical project instruction file./docs/ai/fix-tracy-error.mdis a short reusable fix flow.
If your AI tool supports project instruction files, point it to AGENTS.md.
If it supports custom commands/skills, map them to docs/ai/fix-tracy-error.md.
Features
- ✅ Exports exceptions to structured JSON
- ✅ Includes code snippets around error
- ✅ Captures full stack trace with arguments
- ✅ Extracts context variables
- ✅ Redacts common secret-like keys in context variables
- ✅ Request information (URI, method, IP)
- ✅ Previous exception chain
- ✅ Keeps
latest.jsonpointer for quick access (symlink with regular-file fallback) - ✅ Preserves original Tracy logging
- ✅ Captures BlueScreen errors in development mode
- ✅ Handles string messages (warnings, notices)
License
MIT