agentleFS
thieungthieung/agent-skills/skills/session-sync/SKILL.md

session-sync

Skill4 starsChanged 9 months agoMITView on GitHub

Export Claude Code JSONL sessions to searchable markdown with lifecycle management and optional QMD indexing. Use when users ask to sync, export, browse, resume, search, back up, or annotate Claude Code session history.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. UnicodeDigital/claude-skills★ 1same name
    2. syugoji/agent-skills-pack★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is 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.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not assume the agent's cwd is the skill directory.

    line 16
  2. Very specific:

    Use procedures/setup.md for first-time setup, procedures/setup-hook.md for Stop hook setup, and procedures/install-qmd.md for QMD …

    line 73

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Session Sync

Export Claude Code sessions to project-organized markdown under {target_folder}/Claude-Sessions/{project}/. The script supports full conversation export, QMD keyword/semantic search, lifecycle annotations, resume helpers, skills detection, artifacts, and re-sync preservation.

Script Path

Do not assume the agent's cwd is the skill directory. Resolve the script path from the installed skill location:

SCRIPT="/path/to/session-sync/scripts/session-sync.py"
python3 "$SCRIPT" status

Common installed paths:

  • Global Claude Code skill: ~/.claude/skills/session-sync/scripts/session-sync.py
  • Project skill: .claude/skills/session-sync/scripts/session-sync.py
  • This repository: skills/session-sync/scripts/session-sync.py

Commands

CommandDescription
setupPrint setup steps for the current script path
statusShow target folder, Claude projects dir, QMD status, exports, hook status
syncSync current session from Stop hook stdin or CK_SESSION_ID / CLAUDE_SESSION_ID
exportExport sessions. Filters: --all, --days N, --project NAME, --since YYYY-MM-DD
configSet --target-folder, --claude-home, --projects-dir, --settings-file, --auto-sync, --collection-name
list-projectsList available Claude Code project directories and session counts
listBrowse exported sessions. --active default, --all, --json
resumeResume in Claude Code. Use --pick, --active, --fork, --all, or pass a markdown file path
note TEXTAppend timestamped note to a session. Supports --session-id
close [TEXT]Mark a session done with optional closing note. Supports --session-id
log [TEXT]Update lifecycle fields. Supports --status, --tags, --rating, --session-id
indexRe-index exported sessions in QMD
search QUERYBM25 keyword search via QMD. Use -n for result count
vsearch QUERYSemantic vector search via QMD. Use -n for result count

Generic Configuration

Config lives beside the skill at config.json.

KeyDefaultDescription
target_folder~/Documents when emptyParent folder for Claude-Sessions/
claude_home~/.claude when emptyClaude Code home directory
projects_dir{claude_home}/projects when emptyJSONL transcript directory
settings_file{claude_home}/settings.json when emptySettings file used to detect hook status
qmd_pathqmd when emptyQMD executable name/path
collection_nameclaude-sessionsQMD collection name
auto_syncfalseDeclarative flag updated after hook setup

Examples:

python3 "$SCRIPT" config --target-folder "$HOME/Documents"
python3 "$SCRIPT" config --claude-home "$HOME/.claude"
python3 "$SCRIPT" config --projects-dir "/custom/claude/projects"
python3 "$SCRIPT" config --settings-file "/custom/claude/settings.json"

Core Procedures

Use procedures/setup.md for first-time setup, procedures/setup-hook.md for Stop hook setup, and procedures/install-qmd.md for QMD installation.

Export

python3 "$SCRIPT" export --all
python3 "$SCRIPT" export --days 30
python3 "$SCRIPT" list-projects
python3 "$SCRIPT" export --project my-project
python3 "$SCRIPT" export --since 2026-04-01

Browse, Resume, Annotate

python3 "$SCRIPT" list --active
python3 "$SCRIPT" list --all
python3 "$SCRIPT" resume --pick
python3 "$SCRIPT" resume --active
python3 "$SCRIPT" note "Follow-up context"
python3 "$SCRIPT" log --status blocked --tags "handoff,debugging" "Waiting for access"
python3 "$SCRIPT" close "Done"

Status values: active, done, blocked, handoff.

Search

python3 "$SCRIPT" index
python3 "$SCRIPT" search "authentication" -n 10
python3 "$SCRIPT" vsearch "how did we fix the database issue" -n 5

Output

Markdown files are written to:

{target_folder}/Claude-Sessions/{project-name}/YYYY-MM-DD-HHMM-{session_id_prefix}.md

Re-export preserves title, status, tags, rating, comments, and ## My Notes. Fresh extraction updates messages, timestamps, conversation, summary, skills, and artifacts. Conversation content is not truncated.

References

  • procedures/setup.md - First-time setup
  • procedures/setup-hook.md - Stop hook configuration
  • procedures/install-qmd.md - QMD installation
  • references/schema.md - Exported markdown schema
  • schema/tags.yaml - Suggested lifecycle tags

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.