Repository navigation
Import a Claude memory export in trail init - #732
anirudhkumar-nanonets wants to merge 5 commits into
Conversation
trail check flags src/cli.ts:1675 and :1819 on shared words only: neither line reads PR reviews in the pair child or runs Claude with the real HOME.
🌱 graft blast radius3 areas changed → 1 area can be affected. 3 dependent symbols, depth 2. flowchart TB
A0(("Look Back Discovery<br/>3 symbols"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0 reached;
Who knows this code — 1 person across 4 areas
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no All 3 dependent symbols, grouped by areaLook Back Discovery — 3 symbols in 2 files
Test signal per changed area — 2 ✓ · 1 ✗Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
13 test suites also reference this code17 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
Issue: Claude.ai remembers a lot about how people code, but none of it reaches Claude Code or their team;
trail initonly read Claude Code's own memory notes on the laptop.Why: Claude.ai keeps its memory on claude.ai, with no file on the laptop for init to read; the only way out is asking Claude.ai to write its memories out.
Fix:
trail init --claude-memory <file>(or-for stdin) reads that pasted export with no model, keeps only the facts about code (never personal ones or secrets), and offers them on init's screen, just for you;radds one to the repo.Moves: learnings kept at init (
cold_start, newsource = claude_ai, PostHog Postgres db 11: 0 today, it's new) andlearnings_committed(db 11, the query indaily/project.md): 871 clones / 551 people over the last 7 days, read 2026-10-29.What I chose
trail init --claude-memory claude-memory.txt.[YYYY-MM-DD]date). A fact is offered only if it names a language, tool, repo, test, deploy, PR, file or the like; never under a "Personal" heading or about family, health, money, life dates or holidays. Secrets are scrubbed and a fact that still looks like one is dropped. Facts the repo already says (alreadySaid) and facts offered before (keyed by their words, so a re-export doesn't repeat them) are left out. At most 8, those naming this repo's code first.MemoryCandidates withfrom: "claude.ai"and go throughfinishMemoryRead, like Claude Code's notes. On the screen they're a new row kindclaudeaiunder "From what Claude.ai knows about you", inside Init's always-follow offer says what the rule does #724's "For your Claude only." section, ticked, "(this repo only)" beside each;rmoves one into.trail/learnings("added to this repo: your team gets it once you commit"),wis off for them,sshows the whole fact.Comparison (in the artifact)
Sample: the author's Claude Code memory for this repo (26 notes: 13 project, 8 feedback, 4 reference, 1 user) vs 22 committed learnings plus 2 personal. Both are short and written for Claude. Claude's memory is mostly about the person and the work around the code; trail's is about the code. Init's existing bar takes 5 of the 26 for the team today.
Checks
test/claude-export.test.ts(parsing, the code-only filter, private and secret facts never offered, offered once, kept just for the person with no screen) and two intest/init-run.test.ts(the screen withr, and an agent run).test (ubuntu-latest)first failed on 2 tests of mine intest/skills-words-1b.test.ts: init's copy may not say memory, notes or remember. I missed them locally because my laptop run was under load and I read the failures from a partial log. Fixed in f29ae9a: the screen now says "From what Claude.ai knows about you" and "Claude.ai knows this; Claude Code doesn't.", and the telemetry source no longer spellsmemoryinsrc/init/run.ts. The words, init, memory and contract test files (270 tests) pass locally. Before the fix CI ran 4141 tests: 4130 passed, these 2 failed, 9 were skipped.INIT_COPYandKIND_ORDERinsrc/init/review-screen.ts. The Claude.ai rows now use Init's always-follow offer says what the rule does #724's layout (who gets them said once above the list, where each applies beside its name); the screen test follows it. Init, words, contract and telemetry tests (305) pass locally with a scratch HOME; typecheck is clean.trail checkflagssrc/cli.ts:1675and:1819. Both are shared-word matches only: neither line reads PR reviews in the_trail-pairchild, or runs Claude with the real HOME.Follow-ups (not in this PR)
rcan carry a name if Claude.ai wrote one. Rewording them needs a model or a person-name check.memoryTitlecuts "Go language support (incl." at the abbreviation's full stop (an existing Claude Code note in the sample).pbpaste) so there's no file to save.🤖 Generated with Claude Code