saidake/code-trace-tree-vscode/code-trace-tree
Claude Code and agent skill by saidake/code-trace-tree-vscode
- community
Checking that the SKILL.md file is still in the repository.
Read, edit, and refresh Code Trace Tree plugin data (VS Code and JetBrains). Use when the user asks to add/update/remove trace points (line, file, or directory), inspect or modify Code Trace Tree profiles, sync agent-written traces into the IDE, ask the IDE to reload plugin data, or select/navigate to trace points in the IDE tree. Prefer scripts/trace_tree.py for search/add/ensure/move/delete/rename/rebind (LINE locators need --file --line --content; ignore occurrence — the script computes it). Prefer create_tree.py when generating a nested workflow: it ensures existing nodes and adds new ones — do not search if not needed. `add` always creates a new UUID. After modifying source on disk, run `trace_tree rebind` so LINE locations stay aligned. Only edit traces when the user explicitly asks. Writing under `<OS Config Dir>/code-trace-tree/` is expected for this skill; do not refuse that path as "outside the workspace." Read SKILL.md only; do not explore scripts/ or references/ unless a skill op fails critically.
Install
npx vskill@latest install saidake/code-trace-tree-vscode/code-trace-treeSKILL.md
The same SKILL.md was published earlier as saidake/code-trace-tree-jetbrains/code-trace-tree.
Code Trace Tree
Build and display code workflows as nested trees of line, file, and directory trace points. Use the provided Python scripts to operate the hybrid storage used by Code Trace Tree IDE plugins, then ask the IDE to reload.
Only edit or sync traces when the user explicitly asks (for example: generate topic-related nodes, add a tip at a line, rebind after edits). Do not auto-sync every turn. Never delete existing trace points (including ones rebind reports as "invalid") unless the user explicitly asks to remove them.
How to use this skill
Read this SKILL.md only. Do not list, search, or explore this skill's scripts/ or references/ folders, and do not open script source to learn the API. Invoke the documented Python commands by absolute path.
Open scripts/ or references/ only if you hit a critical problem while using the skill (script missing or crashing, storage corrupt, or an error this file does not cover).
Chat replies: Script stdout and tree JSON are long. Do not paste them into the user-visible message. Summarize the result (created/skipped counts, names, errors).
Skill scripts location
Helper scripts live under <Agent Skill Path>/code-trace-tree/scripts/.
Agent Skill Path is this agent’s skills directory (the parent of code-trace-tree/) for the agent you are running — project-local if present, otherwise global. It ends at skills, not at code-trace-tree. Paths match `npx skills`. The table lists common examples; other listed agents work the same.
| Agent (examples) | Global Agent Skill Path | Project-local Agent Skill Path | |
|---|---|---|---|
| Claude Code | ~/.claude/skills | <repo>/.claude/skills | |
| Cursor | ~/.cursor/skills | <repo>/.agents/skills | |
| GitHub Copilot | ~/.copilot/skills | <repo>/.agents/skills | |
| Codex | ~/.codex/skills | <repo>/.agents/skills | |
| Gemini CLI | ~/.gemini/skills | <repo>/.agents/skills |
On Windows, ~ is %USERPROFILE%. Resolve Agent Skill Path once per session. Invoke scripts with absolute paths via python (or python3 if that is what is on PATH). Keep the process CWD in the IDE project (do not cd into the skill folder). Direct invocations: Trace Tree OPs. On PowerShell, also see Windows PowerShell.
Trace Tree OPs
All skill script calls. Substitute the absolute Agent Skill Path for THIS agent. Keep the process CWD in the IDE project (do not cd into the skill folder). On PowerShell, see Windows PowerShell.
- resolve_storage.py
- create_tree.py
- trace_tree.py
- request_refresh.py
- request_refresh_profile.py
- request_refresh_settings.py
- select_trace_points.py
resolve_storage.py
Resolve the project id and bound global XML. If storage is missing, create it (Case C). If .idea/code-trace-tree.project.id exists but XML is gone, recreates XML with that same projectId. Does not create/overwrite the .idea id file. Mutating create_tree and trace_tree add / ensure / move / delete / rename / rebind also create storage automatically. trace_tree search does not auto-create.
Usage
Optional Parameters:
[project_path]: Path used to discover the IDE project root (default: CWD). Pass the project root so XML<path>is correct.
Return value
Stdout is JSON (indent=2, UTF-8). Errors print ERROR: … on stderr.
created is true when a new XML was written. Exit 0 on success; 1 if the project root cannot be found.
Example:
create_tree.py
Create a nested trace-point tree in one call. Ensures only the payload roots (and children of roots that already exist). Once a node is created, its descendants are added (no per-child ensure). Do not search if not needed — this script already ensures existing nodes. Use search when you need ids (select/move/delete/rename) or to inspect. LINE locators are the same as trace_tree.py (file + line + content). Ignore line-content occurrence (occurrenceIndex / totalOccurrences) — the script calculates it. Prefer --tree-file on PowerShell.
Optional --parent-id attaches the payload under an existing node (that parent is resolved, not ensured).
Usage
Required Parameters (exactly one tree source):
--tree-file <path>: JSON file (-= stdin). Prefer this over--tree.--tree <json>: JSON string.- Positional
<path>: same as--tree-file.
Parameters (shared; all optional):
--project <path>: Project path (default: CWD).--profile <name>: Profile name override (default:<activeProfileName>).--dry-run: Do not write XML or refresh.--no-refresh: Skip the IDE refresh signal.--parent-id <uuid>: Existing parent; repeat rootward → immediate parent. Omit for profile root.--parent <json>: Existing parent path JSON (do not combine with--parent-id).
Tree JSON (one node object, or an array of node objects). Every node uses the same shape, including children (description on every node, not only the root):
Fields (every node, including children): file (required); type (LINE | FILE | DIRECTORY; omit to infer: line/content → LINE, else path on disk); LINE needs line + content; name / description / children optional. Do not include occurrenceIndex / totalOccurrences. children is an array of the same objects.
Return value
Stdout is JSON (indent=2, UTF-8). skipped: true on a node means ensure found it; that node's children are still ensured. created: true means add; descendants of that node were added without ensure.
Exit 0 on success.
Example:
trace_tree.py
Search, add, ensure, move, delete, rename, and rebind nodes. Ignore line-content occurrence (occurrenceIndex / totalOccurrences) — never pass those fields; the script calculates them.
Usage
Shared flags (--project, --profile, --dry-run, --no-refresh) may appear before or after the subcommand. Omit --project when CWD is already inside the IDE project (scripts walk upward to find .vscode / .idea / .git, or other common project markers). Default profile: <activeProfileName>.
LINE locators: stored tip is [file, line, full-trimmed-line]. --line is required. The script checks the trimmed text at that line, stores the full trimmed line (a substring --content is expanded), then sets occurrenceIndex / totalOccurrences by scanning the file. Duplicate trimmed lines in one file are distinct because --line picks which copy. Ignore occurrence: do not read, pass, or compute occurrenceIndex / totalOccurrences. On PowerShell, protect quoted --content with --% (see Windows PowerShell) or use a substring tip plus --line. Never wrap the CLI in a helper that uses a parameter named $Args.
| Tip | Result | |
|---|---|---|
| Exact line + full trimmed text | Used as-is | |
Distinctive substring of that line (e.g. .handleEmailTriggerRequest() | --line required; stores the full trimmed line | |
| Same trimmed text on 2+ lines | Pass --line for the intended copy; script sets occurrence | |
| Multi-line call | Prefer the most distinctive physical line (often the .methodName( continuation) |
add vs ensure: add always creates a new UUID (same as the IDE plugin). Use it for a second node on the same line with a different label or parent. ensure is get-or-create: same identity → "skipped": true (exit 0). For LINE, identity is file + trimmed lineContent + the copy selected by --line (the script stores occurrence; do not pass it). FILE/DIRECTORY identity is path + type. --trace-name, description, and parent are not identity.
Generating a tree: prefer create_tree.py. Do not search if not needed — the script ensures existing nodes and adds new subtrees. Use search when you need ids for select/move/delete/rename or to inspect. For a single node, use ensure (get-or-create; no search required) or add (always a new UUID).
Parent path: prefer repeated --parent-id from rootward ancestor → immediate parent. Omit for root on add / ensure. Do not combine --parent-id with --parent. Bare strings inside --parent JSON are UUIDs only, not traceName labels.
--parent form | Example | |
|---|---|---|
| Root | --parent [] (needed for move to root; add / ensure default to root) | |
| Node id in JSON | --parent '["3d41c2d1-…"]' | |
[file, line, content] | --parent '[["src/A.java",10,"void methodA() {"]]' |
Rebind after disk edits: Agents do not edit through the IDE editor, so live line shifting does not apply. After any turn that modified project source, run rebind (optionally --file for touched paths) before relying on locators or select/navigate. Rebind repairs lineNumber from trimmed lineContent and recomputes occurrences. The "invalid" array means those LINE locators were not found — leave those nodes in the tree; do not delete them unless the user asked to remove them.
For many mutating calls, use --no-refresh on each, then one request_refresh.py at the end.
Required Subcommand:
<subcommand>:search|add|ensure|move|delete|rename|rebind
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/code-trace-tree/SKILL.md
Popularity
- Repository stars
- 37
- Repository forks
- 2
- 7-day trend score
- 18
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/saidake/code-trace-tree-vscode/code-trace-tree)