Skip to content
SlashClone

A session log that parallel agents never conflict on

@slashclone/parallel-session-log

Keep a project log that several Claude Code sessions can write at once without merge conflicts. Each session writes its own dated file, an index is generated instead of hand edited, and a small CI check makes sure every entry carries the line your team requires. Writes the files for you to review; never commits or pushes.

SkillDevOpsv0.1.0 (latest)
Activity
New: be the first to try it
  1. 1#!/usr/bin/env node
  2. 2// Rebuilds the session index in docs/PROGRESS.md from the files in docs/progress/.
  3. 3// Each session writes its own docs/progress/YYYY-MM-DD-slug.md and never edits PROGRESS.md,
  4. 4// so parallel pull requests do not conflict. Run this now and then (an upkeep pull request,
  5. 5// or before a release) to refresh the index: `node .github/scripts/session-log-index.mjs`.
  6. 6// Node standard library only. Edit LOG and DIR if your log lives elsewhere.
  7. 7import { readFileSync, readdirSync, writeFileSync } from "node:fs";
  8. 8
  9. 9const LOG = "docs/PROGRESS.md";
  10. 10const DIR = "docs/progress";
  11. 11const START = "<!-- progress-index:start -->";
  12. 12const END = "<!-- progress-index:end -->";
  13. 13const NAME = /^(\d{4}-\d{2}-\d{2})-[a-z0-9]+(?:-[a-z0-9]+)*\.md$/;
  14. 15const rows = readdirSync(DIR)
  15. 16 .filter((name) => NAME.test(name))
  16. 17 .sort()
  17. 18 .reverse()
  18. 19 .map((name) => {
  19. 20 const text = readFileSync(`${DIR}/${name}`, "utf8");
  20. 21 const heading = text.split("\n").find((line) => line.startsWith("## "));
  21. 22 const title = heading ? heading.slice(3).trim() : name.replace(/\.md$/, "");
  22. 23 return `- [${title}](progress/${name})`;
  23. 24 });
  24. 26const log = readFileSync(LOG, "utf8");
  25. 27const from = log.indexOf(START);
  26. 28const to = log.indexOf(END);
  27. 29if (from < 0 || to < from) {
  28. 30 console.error(`${LOG}: index markers not found (${START} ... ${END}).`);
  29. 31 process.exit(1);
  30. 33const body = rows.length > 0 ? rows.join("\n") : "_No session files yet._";
  31. 34const next = `${log.slice(0, from + START.length)}\n\n${body}\n\n${log.slice(to)}`;
  32. 35if (next === log) console.log(`${LOG}: index already up to date (${rows.length} sessions).`);
  33. 36else {
  34. 37 writeFileSync(LOG, next);
  35. 38 console.log(`${LOG}: index rebuilt (${rows.length} sessions).`);

Cookies that keep you signed in and remember these choices are always on. Everything else is off until you turn it on.