swananan/ghostscope/ghostscope-runtime-analysis
Claude Code and agent skill by swananan/ghostscope
- community
Checking that the SKILL.md file is still in the repository.
Explain GhostScope and turn the project docs into concrete tracing commands, trace scripts, privilege setup, and issue-report workflows for source-aware runtime analysis. Use when the user asks how to install GhostScope, provide source tree and DWARF inputs, handle eBPF privileges, attach to a PID or binary, choose between `-p` and `-t`, inspect variables or source-aware call stacks, explain value-display diagnostics, write GhostScope trace scripts, use Input Mode commands, work through container or PID-namespace CLI scenarios, or triage GhostScope failures, crashes, and GitHub issue reports.
Install
npx vskill@latest install swananan/ghostscope/ghostscope-runtime-analysisSKILL.md
GhostScope Runtime Analysis
Overview
Translate GhostScope documentation into runnable commands and minimal trace scripts. Prefer live GhostScope output and repository docs as the source of truth. Treat this skill and its references as routing and workflow guidance, not as a frozen copy of GhostScope behavior. When the user is writing in Chinese, prefer the docs/zh/ counterparts first.
Workflow
- Classify the request before answering.
- For any answer involving CLI flags, debug-info loading, logging behavior,
startup reports, or script syntax, derive the current behavior dynamically: run ghostscope --help or the relevant subcommand help for flags, run ghostscope --script-help for DSL syntax, and read the current docs under docs/ or docs/zh/ for configuration semantics. Use references/cli-cookbook.md only as a command-template fallback.
- If live CLI output, docs, and source comments disagree, do not silently choose
one. Say what disagrees, inspect the implementation when available, and base the answer on the implementation plus current docs.
- Capabilities, positioning, tool comparisons, or "should I use GhostScope here?": read
references/doc-map.md, then useREADME.md,docs/comparison.md, anddocs/faq.mdorREADME-zh.md,docs/zh/comparison.md, anddocs/zh/faq.md. - Installation, permissions, or debug symbols: read
references/cli-cookbook.md, thendocs/install.mdordocs/zh/install.md. - Exact CLI flags or launch syntax: run
ghostscope --helpfirst, and use subcommand help such asghostscope bpffs prune --helpwhen relevant. Ifghostscopeis unavailable but the shared workspace is the GhostScope repo, fall back toreferences/cli-cookbook.md, thendocs/configuration.mdordocs/zh/configuration.md. - TUI commands such as
trace,info,source,save traces, orsrcpath: readreferences/cli-cookbook.md, thendocs/input-commands.mdordocs/zh/input-commands.md. - Trace script authoring: run
ghostscope --script-helpfirst and treat its output as the source of truth for the current installed DSL. Ifghostscopeis unavailable but the shared workspace is the GhostScope repo, fall back todocs/scripting.mdordocs/zh/scripting.md. - Value unavailable, unreadable memory, internal fields, or partial capture:
check ghostscope --help, then read ghostscope --value-diagnostics-help when supported. This is the installed binary's offline diagnostic reference and needs no target or eBPF privileges. If the binary is unavailable or too old to expose the flag, use docs/value-diagnostics.md or docs/zh/value-diagnostics.md when available, noting any version difference. Do not maintain a separate catalog of diagnostic reasons in the skill.
- Container or PID confusion: read
docs/container.mdordocs/zh/container.md. - Limits or caveats: read
docs/limitations.mdordocs/zh/limitations.md. - Crash, cannot-capture, or bug-report preparation: read
references/issue-reporting.md, thendocs/install.md,docs/container.md, anddocs/limitations.mdor theirdocs/zh/counterparts.
- Check prerequisites before giving commands.
- If
ghostscopeis not installed or not found, recommend installing it first withcurl -fsSL https://raw.githubusercontent.com/swananan/ghostscope/main/scripts/install.sh | bash. - GhostScope currently targets Linux on x86_64.
- eBPF tracing usually needs
sudoor equivalent capabilities. - If the current privilege model is unclear, tell the user explicitly. Recommend either granting GhostScope eBPF-related capabilities with
setcapor running a prepared wrapper script withsudo. - If the source tree location is not already known, first try to discover it from the shared workspace, local filesystem, build paths, or command context before asking the user. GhostScope is most effective when it can be used together with the relevant source tree.
- DWARF debug information is required in the target binary or a separate debug file.
- When separate debug information is involved, check the current install and
configuration docs before naming supported sources, validation rules, or search paths.
- If the relevant module's DWARF debug info or debug-file status is unknown, first inspect the target locally when possible. If it is still missing or unclear, tell the user and ask them to provide it. At minimum, the modules they care about must have debug info.
- For
ghostscope -p <PID>, use the PID visible in the same environment where GhostScope runs. - Do not suggest running GhostScope and GDB against the same target at the same time.
- Choose the operating mode that matches the task.
- Use
-p <PID>for one already-running process. - Use
-t <PATH>when the user wants startup coverage, wants to trace all processes using a binary or library, or is targeting a shared library explicitly. - Use
--script-filefor repeatable command-line workflows. - Use TUI
traceandinfocommands for interactive exploration.
- Answer with executable guidance.
- Start with a short capability or constraint summary only when it affects the recommendation.
- If prerequisites are missing, say exactly what is missing first: installation, source path, debug info, or privileges.
- Then give exact shell commands.
- If the user needs TUI interaction, include the minimum command-panel sequence.
- If the user needs a reusable trace file, emit a valid
trace <pattern> { ... }block. - If the user needs an inline script body after
trace <target>, emit only the statements inside the block, not another top-leveltrace. - When the user asks how execution reached a point, or asks for call context,
include bt full; in the trace block. Pair it with a print line when a request, ID, argument, or state value helps identify the event. Add --backtrace-depth <N> only when the user asks to bound stack depth or a compact demo output is explicitly needed.
- When generating a GhostScope trace script and the relevant source path is known, also include the source-backed rationale:
- quote or summarize the specific function signature, source lines, struct fields, branches, or variables the script depends on
- explain why each probe target, printed variable, condition, or field access matches that source context
- make it easy for the user to verify the script against their code instead of only pasting DSL
- If the source path is unknown or the relevant source cannot be inspected after local discovery attempts, say that explicitly before giving the script and ask the user for the checkout path.
- If DWARF or debug info is missing, say that source-backed variable tracing and explanation will be partial or unreliable.
- If the command needs privileges and the user is likely to rerun it, prefer offering either a
setcapcommand or a ready-to-runsudowrapper script. - When asking the user for logs, check the current logging docs/help first and
include the flags or config required to actually enable log output.
- For value diagnostics, preserve the exact marker, affected expression/path,
and static display note from CLI output or info trace <id>. Explain the matching reason and next step from the value guide before asking for logs. Distinguish unavailable locations, failed reads, unsupported display layouts, and partial captures. A note about a possible enum branch is not evidence that the branch was active or that its memory read failed. Suggest sleepable uprobes only under the guide's conditions, including the latency tradeoff.
- Avoid common mistakes.
- Do not invent GhostScope DSL syntax. Validate it against
ghostscope --script-help, or fall back todocs/scripting.mdordocs/zh/scripting.mdonly when GhostScope is unavailable. - Do not guess PID conversions across containers. Follow the current-namespace PID rule from
docs/container.md. - Do not overpromise unsupported behavior. Check
docs/limitations.mdfor caveats first. - Do not pretend source-line workflows are fully ready when the source tree path cannot be discovered. Ask the user for the source checkout path instead.
- Do not pretend DWARF-backed variable tracing is ready when the relevant module lacks debug info. Ask the user for the debug-enabled binary or debug file instead.
- Do not suggest
--debug-file, debug search paths, debuginfod, or logging
flags from memory. Re-check current CLI help and docs, then explain the target binding and enabled output path in the command you provide.
- For
-tshared-library targets where new processes must expose globals, mention--enable-sysmon-shared-lib. - When source paths do not resolve, prefer
srcpath mapover telling the user to move files manually. - When docs and generated examples seem inconsistent, prefer the installed CLI help output from
ghostscope --helpand relevant subcommand help.
- Prepare issue reports when the problem still looks like a GhostScope bug.
- First rule out missing privileges, missing debug symbols, wrong
-pPID semantics, and known-tshared-library caveats. - If the user still has an unexplained failure, crash, or incorrect capture result, gather the exact command, trace script, config, source-tree path, debug-file path or debug-symbol status, logs, expected behavior, actual behavior, and environment notes.
- Write the issue draft to
/tmp/ghostscope-issue-*.mdwithscripts/prepare_issue_report.py. - Recommend filing it at
https://github.com/swananan/ghostscope/issues. - Prefer preparing as much of the issue as possible for the user instead of only telling them to "open an issue".
References
- Use doc-map.md to choose the right docs quickly.
- Use cli-cookbook.md for concrete command patterns and common workflows.
- Use issue-reporting.md for escalation and GitHub issue preparation.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ghostscope-runtime-analysis/SKILL.md
Popularity
- Repository stars
- 182
- Repository forks
- 14
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/swananan/ghostscope/ghostscope-runtime-analysis)