agentleFS
jin2004-cmdjin2004-cmd/codex-practical-skills/session-log-archaeology/SKILL.md

session-log-archaeology

Skill1 starsChanged 36 days agoMITView on GitHub

Dig a user's original text out of their own archives when they ask for it — dated memory notes first, then session logs, then repo snapshots, then workspace logs. Includes the JSONL shape traps that produce silent zero hits, the cross-machine gap that makes a session genuinely absent, and the rule that not finding it must be reported rather than filled with a rewrite. Triggers on "翻出我记忆里的", "之前那个稿子找出来", "上次写的 XX 在哪", "去会话记录里挖". Not for writing a checkpoint (session-checkpoint) and not for maintaining the memory base (personal-secretary-memory).

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not filter by message length.

    line 39
  2. Distinctive:

    Before declaring something lost, print the log's hour-by-hour coverage.

    line 49
  3. Distinctive:

    Every recovered artifact ships with file, line number, and timestamp.

    line 71

≈ “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 Log Archaeology

He asks for an artifact he believes exists: a script, a version, a number, a decision. Your job is to find the original, not to produce something equivalent.

Step 1 — Search in this order

  1. Dated memory notes (the vault / memory-area markdown). Fastest, and usually indexed.
  2. Session logs (.jsonl). This is where anything that was never saved to disk still lives.
  3. Repo snapshots / tarballs of the private memory repo — may contain files the local mirror does not, and may be newer than the local mirror.
  4. Workspace daily logs, which often record what was produced even when the artifact itself was not persisted.

Widen the keyword set before concluding anything. Try the thing's own name, then money figures in every notation (五百 / 500 / 两百 / 200), then the actors, then the product. A single keyword returning nothing means nothing.

Step 2 — JSONL shape traps (these cause silent zero hits)

A scan that reads the wrong field returns 0 matches and looks like "not found". Verify the shape before trusting the result:

line = { type: "message", role: "assistant", content: [ { type: "output_text", text: "..." } ], ... }
  • content is a top-level field. Reading obj["message"]["content"] yields nothing forever.
  • Block type is output_text, not text. (User turns use input_text.)
  • role is top-level; some records nest it under providerData, some do not.
  • Tool results are separate records (type: "function_call_result") — grep the raw line when a keyword clearly exists but no message matches.
  • Do not filter by message length. A short "背景对上了" line is often the pointer you need.

Sanity-check by grepping the raw file for an ASCII-only token from your keyword set first. If raw grep hits and your parser does not, the parser is wrong, not the archive.

Step 3 — The cross-machine gap

Session logs live per machine. A conversation that happened on the office machine is simply absent from the home machine, and the local log will show a clean time gap where it should be.

Before declaring something lost, print the log's hour-by-hour coverage. A missing afternoon between two evening blocks is the signature of "it happened on the other machine" — not of "it was never written".

Real case: a script was said to have been delivered at 15:44. The home machine's log covered that date from 20:37 onward with a clean gap before it. The 15:44 session was on the office machine. Reporting "not on this machine, and here is the gap" is the correct answer.

Step 4 — Report, do not substitute

🔴 Never fill the hole with a rewrite. Drafting a fresh version in his voice when he asked for the original is the worst failure in this workflow: he now holds a document he cannot attribute, and the retrieval he asked for has not happened.

Report instead:

  • what was searched (each source, one line)
  • the best evidence that it existed (e.g. a memory note saying "delivered two drafts at 15:44")
  • why it is not retrievable here (never persisted / different machine / session rotated out)
  • the options: paste it in, dictate it, or explicitly authorise a rewrite labelled as such

Step 5 — Cite the source when you do find it

Every recovered artifact ships with file, line number, and timestamp. He will want to check it, and an unsourced quote from a chat log is not verifiable.

Also say which version it is — archives hold several, and "the original" is often the one he revised by hand afterwards.

Self-check

  • □ Searched memory → session logs → repo snapshot → workspace logs, in that order
  • □ Keyword set widened at least twice
  • □ Parser validated against a raw grep hit
  • □ Hour coverage printed before declaring a gap
  • □ Found: source cited with file + line + timestamp
  • □ Not found: reported honestly, no substitute draft shipped

Red lines

  • 🔴 No rewriting to fill a gap. Stated once, it is the whole point of this skill.
  • 🔴 No publishing private chat content. Recovered logs stay local; quote the minimum needed.
  • 🔴 No claiming a clean search when the parser was broken. Validate the tool before the conclusion.

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.