chat-session-experimental
Skill1 starsChanged 53 days agoMITView on GitHub
Cross-domain / Research platform observability — Find, view, and archive the Copilot chat sessions that belong to a project. Covers VS Code / Discovery App chat panels and Copilot CLI, SDK, and engine sessions. Renders any session as the single-page "Discovery session" chat viewer (sidebar, Thinking, Tools, and System noise toggles, themes) in the integrated browser. Copies session logs and telemetry into `.discovery/chat-sessions/` so they outlast editor cleanup. WHEN: find a past chat, "I had a chat with you about X, go find it", show or open or replay a chat session, chat transcript viewer, session SPA, archive chat sessions, save chat logs or telemetry to the project, list chat sessions for this project, chat-session-experimental.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- alphafold-structure-provenanceSkill
- biochemical-identifier-crosswalkSkill
- biocyc-network-contextSkill
- brenda-enzyme-dataSkill
- build-research-paperSkill
- discovery-add-agentsSkill
- discovery-clarify-projectSkill
- discovery-dashboardSkill
- discovery-design-tasksSkill
- discovery-project-storySkill
- discovery-token-usageSkill
- engine-chat-experimentalSkill
- osti-literature-searchSkill
- sabio-rk-kineticsSkill
- scientific-database-accessSkill
- scientific-evidence-qcSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Every command prints one JSON object.
- Distinctive: line 51
Read storage layout for where sessions are stored on disk.
- Very specific: line 61
If the user says they chatted with you, add --interactive-only first.
- Very specific: line 67
If keywords miss, run list and judge the sessions by their titles.
- Very specific: line 73
Run render --session <id>.
- Very specific: line 84
Run archive --dry-run and summarize the results: number of sessions, new or updated files, and total bytes.
- Very specific: line 86
If the result includes a warning (git is not-ignored), tell the user that archived transcripts contain full prompts, tool arguments, …
- Very specific: line 91
Run archive and report each session's added, updated, and unchanged counts.
- Very specific: line 108
Don't delete or modify source logs under ~/.copilot or the editor's workspaceStorage.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chat Session Experimental
Tested with Discovery App Preview 0.15.21 on macOS. The script also checks VS Code, VS Code Insiders, and the Linux and Windows config folders, but those have not been tested. Don't claim they work.
Everything except archive and render is read-only. The scripts use only the
Python standard library.
Setup
- Set
SKILL_DIRto the parent folder of thisSKILL.md. Don't assume a checkout location. - Resolve the target project's absolute workspace root (
ROOT). Default to the current workspace folder. - Run
python3 "$SKILL_DIR/scripts/chat_sessions.py" <command> --workspace "$ROOT" [...]. Every command prints one JSON object. Readokbefore doing anything else.
| Command | Purpose |
list | All sessions for the project, newest first |
find --query "<keywords>" [--limit 5] | Sessions ranked by relevance, with snippets |
render --session <id-or-prefix> [--theme discovery|light|dark] [--out PATH] | Write the chat viewer HTML and return url |
archive [--session <id>] [--dry-run] | Copy logs and telemetry into .discovery/chat-sessions/ |
Shared filters: --origin all|vscode-chat|copilot-cli, --interactive-only
(skips automated engine and SDK runs), and --storage-root DIR (extra
workspaceStorage folder, can be repeated). Set COPILOT_HOME to override
~/.copilot.
Read storage layout for where sessions are stored on disk.
Workflows
Find a session ("I had a chat with you about project start-up, find it")
- Turn the request into keywords. Drop filler words such as "chat", "you",
and "find". Example:
--query "project start up". The search also matches joined and hyphenated forms ("startup", "start-up"). - If the user says they chatted with you, add
--interactive-onlyfirst. If that finds nothing, search again without it. - Rank results by
coverage, then byscore. Show the top 1–3 with date (start),title, origin, and one snippet each. If there is one clear winner, offer to open it. If the results are close, use the ask-questions UI and give one option per candidate. - If keywords miss, run
listand judge the sessions by their titles.
Show a session (launch the viewer)
- Resolve the session ID with
findorlist. The current conversation is usually the newestvscode-chatsession. - Run
render --session <id>. By default the HTML goes toROOT/.discovery/chat-sessions/<id>/chat.html. - Open the returned
urlwith the integrated browser tool (load it through tool search if it is deferred). Never open the system browser. The integrated browser only servesfile://pages inside trusted workspace folders, so--outmust stay insideROOT. - The viewer is a static snapshot. To refresh a live session, run
renderagain and reload the page.
Archive all project sessions
- Run
archive --dry-runand summarize the results: number of sessions, new or updated files, and total bytes. - If the result includes a
warning(git isnot-ignored), tell the user that archived transcripts contain full prompts, tool arguments, outputs, and telemetry, and could be committed. Ask whether to add.discovery/chat-sessions/to.gitignore. Don't change.gitignorewithout consent. - Run
archiveand report each session'sadded,updated, andunchangedcounts.
Archive behavior:
- It is incremental and idempotent. Files are copied only when their size or mtime changed.
- It never deletes anything. If the editor purges a session, the archived copy stays.
- It skips symlinks and
*.lockfiles. - It writes
<id>/manifest.jsonand a top-levelindex.json. list,find, andrenderread archived sessions automatically when the original source is gone (live: false, archived: true).
Rules
- Present session content directly. Don't narrate file paths unless the user asks.
- Don't delete or modify source logs under
~/.copilotor the editor'sworkspaceStorage. - Session logs can contain sensitive data. Don't copy them anywhere other than
the project's
.discovery/chat-sessions/unless the user asks.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

