Skip to content

Move learning journal out of .claude/ to a durable, agent-neutral global store #2

Description

@ktaletsk

Problem

The learning journal currently lives at .claude/learning-journal.md inside each project. This has caused real data loss and excludes non-Claude agents:

  • It gets destroyed. .claude/ is commonly untracked or gitignored. A git clean, a session rewind, or a branch switch can wipe the journal with no recovery. This has already happened to at least one user (an opencode session rewind nuked an untracked .claude/ journal).
  • It's Claude-specific. Hardcoding .claude/ quietly excludes the opencode / Cursor / other-agent users that the multi-agent npx skills installer otherwise reaches.
  • It's siloed per-repo. Personal learning progress is scattered across N project directories, with no way to ever see it in aggregate (blocks any future dashboard / cross-repo review queue).

Proposed direction

Move the default journal to a global per-user store, keyed by repo identity, at an XDG path:

~/.local/share/learn-codebase/<repo-key>/journal.md
  • <repo-key> derives from the git remote URL when present (stable across machines/clones), falling back to the repository toplevel path for repos with no remote.
  • Honors $XDG_DATA_HOME when set; falls back to ~/.local/share (and the platform equivalent on macOS/Windows).

This mirrors how spaced-repetition tools (e.g. Anki) store personal learning state — centrally, not scattered per-project.

Why this location

  • Durable — survives git clean, session rewinds, branch switches, and .gitignore. The data loss can't recur.
  • Agent-neutral — drops the .claude/ coupling so opencode/Cursor/etc. users get a real home. Lets us market true multi-agent support.
  • Aggregatable — one store across all repos is the natural substrate for a future status / dashboard command and a cross-repo spaced-review queue (see follow-up issues).

Opt-in: keep it in the repo

For people who want the journal to travel with a fork or be shared, support an --in-repo (or config) mode that writes to a tracked, neutral path in the project. Global store remains the default.

Open questions

  • Repo-key scheme — remote URL vs. toplevel path. Normalization (strip .git, ssh-vs-https, casing)? What about monorepos or multiple worktrees of the same remote?
  • Migration — auto-detect an existing .claude/learning-journal.md on first run and offer to move/copy it to the global store, so current users don't lose history.
  • Discoverability — a global store is "out of sight." Do we print the journal path at session start, and/or provide a command to locate/open it?
  • Cross-machine sync — global store doesn't travel with a clone. Acceptable for personal state (user backs up home dir), or do we document a sync recommendation?
  • Platform paths — confirm XDG fallback behavior on macOS and Windows.
  • Config surface — env var, skill config, or both for choosing global vs. in-repo and overriding the base dir.

Scope of change

  • SKILL.md — the existence-check / creation logic (currently checks and writes .claude/learning-journal.md).
  • README.md — update the journal-location description and the data-durability story.
  • .gitignore — the learning-journal.md ignore entry becomes mostly moot for the default path.

Feedback welcome on the repo-key scheme and migration UX before implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions