pupocz/tracy-claude-panel
Composer 安装命令:
composer require pupocz/tracy-claude-panel
包简介
Tracy BlueScreen panel that formats errors for AI-assisted debugging. One-click error export to Claude Code and other AI coding assistants.
README 文档
README
Tracy BlueScreen panel that formats errors for AI-assisted debugging. One-click error export to Claude Code and other AI coding assistants.
What it does
When a PHP error occurs, this panel appears on Tracy's BlueScreen with a "Copy for Claude" button. One click copies a structured error summary to your clipboard, ready to paste into Claude Code or any AI assistant.
Example output:
Error: Warning — Undefined variable $person
URL: GET http://localhost:8080/admin/employee/5
Presenter: User:Admin:EmployeeDetail:default
File: app/Modules/User/Presentation/Admin/EmployeeDetail/default.latte:42
Source:
38: <div class="grid grid-cols-2 gap-4">
39: <div>
40: <dt>Employee ID</dt>
41: <dd>{$employee->getNumber()}</dd>
→ 42: {if $person->getOffice()}
43: <dt>Office</dt>
44: <dd>{$person->getOffice()}</dd>
45: </div>
46: </div>
Stack (app only):
app/Shared/Components/admin-card.latte:50 LatteTemplate::main()
app/Modules/User/Presentation/Admin/EmployeeDetail/default.latte:42 LatteTemplate::renderBlock()
Example with vendor-originated error (e.g. invalid Nette link):
Error: User Warning — Invalid link: Missing parameter $id required by ProfilePresenter::actionDefault()
URL: GET http://localhost:8080/admin/external-lecturers/2/detail
Presenter: User:Admin:ExternalLecturerDetail:default
File: app/Modules/User/Presentation/Admin/ExternalLecturerDetail/ExternalLecturerDetailPresenter.php:63
Source:
59: $this['pageHeader']->setBackLink($this->link('ExternalLecturers:default'));
60:
61: if ($this->getUser()->isAllowed('ExternalLecturers', 'edit')) {
62: if ($person->getSlug()) {
→ 63: $this['pageHeader']->add('Profile', $this->link(':User:Front:Profile:default', ['slug' => $person->getSlug()]))
64: ->setIcon('visibility');
65: }
66: }
67: }
Args: Component::link(':User:Front:Profile:default', ['slug': 'ivan-omavka'])
Stack (app only):
app/Modules/User/Presentation/Admin/ExternalLecturerDetail/ExternalLecturerDetailPresenter.php:63 Component::link()
Features
- Error info — type, message, file, line number
- URL + HTTP method —
GET http://localhost:8080/admin/users - Nette presenter:action —
User:Admin:EmployeeDetail:default(auto-detected via Application event, works with any mapping) - Smart file resolution — when error originates in vendor code (e.g.
trigger_errorinside Nette), resolves to the first app-level frame where the problem actually is - Function arguments — shows the arguments of the call that triggered the error (scalars, short arrays, class names for objects)
- Latte template resolution — maps compiled PHP back to original
.lattefile and line number (supports Latte 2 and 3) - Source code snippet — shows code around the error with
→marker - Doctrine SQL — extracts query + parameters from DBAL exceptions
- Filtered stack trace — only your app files, no vendor noise; Latte frames resolved to
.lattepaths - Chained exceptions — shows the full cause chain with circular reference protection
Installation
composer require --dev pupocz/tracy-claude-panel
Nette Framework
Register the extension in your config (e.g. config/common.neon):
extensions: tracyClaudePanel: PuPoC\TracyClaudePanel\Bridge\Nette\TracyClaudePanelExtension
That's it. The extension registers the panel and hooks into Application::$onRequest for presenter detection. It only activates in debug mode.
Standalone Tracy (without Nette)
Register manually in your bootstrap after enabling Tracy:
use PuPoC\TracyClaudePanel\ClaudeBlueScreenPanel; Tracy\Debugger::enable(); ClaudeBlueScreenPanel::register(__DIR__ . '/app');
The argument is the absolute path to your application source directory. Files outside this directory are filtered from the stack trace.
Optional: Presenter detection for standalone usage
$application->onRequest[] = [ClaudeBlueScreenPanel::class, 'onRequest'];
Requirements
- PHP 8.1+
- Tracy 2.10+
Optional (auto-detected when available)
- nette/application — for presenter:action context
- latte/latte — for template source resolution (Latte 2 and 3)
- doctrine/dbal — for SQL query extraction
How it works
- Registers a panel on Tracy's BlueScreen via
addPanel() - When an error occurs, builds a structured text summary
- If the error originates in vendor code, walks the stack trace to find the first app-level frame
- Resolves compiled Latte templates to original
.lattefiles using source comments and position markers - For Nette apps, uses the
Application::$onRequestevent to capture the current presenter name before the error happens - Renders a "Copy for Claude" button that copies the summary to clipboard
License
MIT
pupocz/tracy-claude-panel 适用场景与选型建议
pupocz/tracy-claude-panel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「debugging」 「error」 「nette」 「panel」 「tracy」 「ai」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pupocz/tracy-claude-panel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pupocz/tracy-claude-panel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pupocz/tracy-claude-panel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP package that takes a snapshot of your application and allows you to retrieve it later to help with debugging.
Laravel Database Query Logger and debug helper.
Nette Framework adapter for I18n package
Build forms from schema
PHP Error Handler module that captures and displays all throwable errors in a given format, making debugging easier and more efficient
Asynchronous MQTT client built on React
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 34
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-23