agentleFS
apacheapache/skywalking-ai-sessionizer/.claude/skills/collect/SKILL.md

collect

Skill7 starsChanged 51 days agoApache-2.0View on GitHub

Collect this machine's local Claude Code conversation data with the asz collector. Resolves the local Claude data directory (honouring CLAUDE_CONFIG_DIR and XDG_CONFIG_HOME), builds the binary, lists what is discoverable, and lands everything into the storage root. Use when asked to collect, backfill, re-collect, or inspect local Claude Code sessions, or to check what the collector can see.

  • Deletes or force-pushes

7 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions7 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 7

    1. Aster110/mycc★ 165same name
    2. qtzx06/yolodex★ 96same name
    3. unclejobs-ai/second-claude-code★ 41same name
    4. zjl4616/feishu-claude-code★ 2same name
    5. kpab/awesome-fun-claude-skills★ 1same name
    6. BlackAngel242/skill-market★ 0same name
    7. mrzli/skills★ 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 repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    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. Very specific:

    Default storage root is ./data, relative to the working directory.

    line 52
  2. Distinctive:

    Do not hand-edit anything under the storage root.

    line 130

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Collect local Claude Code data

Runs the claude-code-local adapter over this machine's own Claude Code files. It reads only what is already on disk — nothing needs to be enabled in Claude Code, and it works on history that predates the collector.

1. Resolve the source directory

The location is not fixed. Resolve in this order and report which one won:

if   [ -n "$CLAUDE_CONFIG_DIR" ];  then SRC="$CLAUDE_CONFIG_DIR/projects"
elif [ -n "$XDG_CONFIG_HOME" ];    then SRC="$XDG_CONFIG_HOME/claude/projects"
else                                    SRC="$HOME/.claude/projects"
fi
ls -d "$SRC" && du -sh "$SRC"

asz performs the same resolution internally, so normally you do not pass source_root at all. Set it only when collecting from a copy or a mounted corpus.

2. Build

make build          # -> ./bin/asz

3. See what is discoverable before collecting

./bin/asz sources

Reports one row per session with its stream, meta, journal and manifest counts, then a footer naming any session whose files span more than one source directory. Read it for two things:

  • filtered: N session(s) excluded by config — the default config excludes /private/tmp/** (Claude Code's own agent scratchpads). If a session you expect is missing, this is why.
  • sessions spanning several directories — normal. A child agent that ran in a different working directory is filed under that directory instead.

4. Collect

Default storage root is ./data, relative to the working directory.

./bin/asz collect -once          # single pass; the backfill path
./bin/asz collect                # watch mode: a pass now, then every 10 minutes

To land somewhere else, write a config and pass it:

# collect.yaml
storage:
  root: /tmp/asz-data
adapters:
  - name: claude-code-local
    enabled: true
    collector:
      mode: once
./bin/asz collect -config collect.yaml

Without -config, a command run from the repository root reads the asz.yaml there. Its values are the built-in defaults: storage root ./data, watch mode, a 10 minute interval. Pass a file like the one above when you want a single backfill pass into another directory.

5. Read the result line

sessions=61 sources=5831 landed=5831 records=364051 bytes=1.0GB
gone=0 conflicts=0 busy=0 pending=0 errors=0 (2m16s)
FieldMeaning
landedsources that produced new data this pass
gonesource deleted since last pass — normal, Claude Code prunes transcripts, and our landed copy outlives them
conflictsa source was rotated, truncated or rewritten behind the cursor; collection stopped for it
busysession skipped because another collector holds its lock
pendinga source still had data when the per-pass drain limit was reached

pending or errors above zero means the pass did not collect everything, and asz collect exits non-zero. A clean pass is pending=0 errors=0.

Re-running is cheap and safe: cursors make a steady-state pass ~1s over several thousand sources, and landing is idempotent by design.

What lands where

<root>/<session-id>/
    session.state                                   next_seq, liveness, last scan
    streams/main/        transcript.cursor · transcript-<ts>-<seq>.sd
    streams/<agent-id>/  transcript.cursor · transcript-… · meta.cursor · meta-…
    runs/<run-id>/       journal.cursor · journal-… · manifest.cursor · manifest-… · script.cursor · script-…
    index/               entries.bin · index.state
<root>/_conversations/<id>/rounds/r000001-<digest>.sf   written by asz parse

Landed files are Session Data (.sd), not copies of the source lines. See docs/en/formats/storage-root.md.

Landed files are write-once and read-only. Each is a header line plus one line per source record, with the source bytes preserved verbatim in payload.

Purging a session is rm -rf <root>/<session-id>/.

If something looks wrong

  • A session is missing — check the filtered line first, then asz sources.
  • conflicts is non-zero — the cursor for that source is now sticky. Inspect state in its cursor file; the source was rotated, truncated, or rewritten behind the position we had already consumed.
  • Nothing is discovered — confirm step 1 resolved to a directory that exists and contains per-project subdirectories.

Do not hand-edit anything under the storage root. Cursors and landed files are consistent only as written.

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.