You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Note: Also checks other VS Code variants (Insiders, Cursor, VSCodium, Code - Exploration)*
48
+
28
49
## Important Note
29
50
30
-
The cache is stored in VS Code's internal database (`state.vscdb`) and is only directly accessible through the extension's API at runtime. This script generates example data that matches the real cache structure.
51
+
The extension stores its cache in VS Code's internal globalState (SQLite database `state.vscdb`), which is not directly accessible from external scripts. To use this skill with real data:
52
+
53
+
1.**Export from extension**: Add functionality to export cache to disk
54
+
2.**Export from tests**: Test code can write cache data to one of the expected locations
55
+
3.**Manual export**: Extract cache from globalState and save to disk
31
56
32
57
To access real cache data, use the extension's API:
Copy file name to clipboardExpand all lines: .github/skills/load-cache-data/SKILL.md
+43-16Lines changed: 43 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
---
2
2
name: load-cache-data
3
-
description: Load and inspect the last 10 rows from the local session file cache to iterate with real data. Use when you need to understand cached session statistics, debug cache behavior, or work with actual cached data.
3
+
description: Load and display the last 10 cache entries as raw JSON output. DO NOT create extra files or pretty-print the data - output raw JSON only. Use when you need to understand cached session statistics, debug cache behavior, or work with actual cached data.
4
4
---
5
5
6
6
# Load Cache Data Skill
7
7
8
+
**IMPORTANT: Always output raw JSON only. Do not create extra files for displaying data.**
9
+
8
10
This skill helps you access and inspect the GitHub Copilot Token Tracker's local session file cache. The cache stores pre-computed statistics for session files to avoid re-processing unchanged files.
9
11
10
12
## Overview
@@ -25,6 +27,14 @@ Use this skill when you need to:
25
27
- Work with real cached data for testing or development
26
28
- Iterate on features that rely on cached statistics
27
29
30
+
## Output Requirements
31
+
32
+
**CRITICAL**: When using this skill:
33
+
-**ALWAYS** use the `--json` flag to output raw JSON
34
+
-**NEVER** create extra files just for displaying data
35
+
-**DO NOT** pretty-print or format the output in human-readable text
36
+
- Simply run the script with `--json` and display the raw JSON output
37
+
28
38
## Cache Structure
29
39
30
40
The cache is stored in VS Code's global state under the key `'sessionFileCache'`. Each cache entry is keyed by the absolute file path and contains:
@@ -92,35 +102,52 @@ for (const [filePath, cacheEntry] of last10) {
92
102
93
103
### Using the Provided Script
94
104
95
-
This skill includes an executable script that demonstrates the cache structure and provides example data:
105
+
This skill includes an executable script that loads and displays actual cache data from disk:
Since the extension stores cache in VS Code's globalState (internal SQLite database), the cache data must be explicitly exported to one of the above locations for this script to access it. This can be done:
141
+
142
+
1.**Via Extension**: The extension can be enhanced to export cache on demand
143
+
2.**Via Tests**: Test code can write cache data to disk for inspection
144
+
3.**Manually**: Copy cache data from extension's globalState and save to one of the expected locations
145
+
146
+
**Exit Codes:**
147
+
-`0`: Cache file found and displayed successfully
148
+
-`1`: No cache file found
122
149
123
-
**Note**: The script generates example data because VS Code's internal database is only accessible through the extension's API at runtime. Use the extension's API (shown above) to access real cache data.
150
+
**Note**: If no cache file is found, the script will display the searched locations and instructions for exporting cache data.
0 commit comments