Skip to content

trail init: find extension claude, tick learnings - #612

Closed
anirudhkumar-nanonets wants to merge 3 commits into
mainfrom
fix/trail-init-extension-claude
Closed

anirudhkumar-nanonets wants to merge 3 commits into
mainfrom
fix/trail-init-extension-claude

Conversation

@anirudhkumar-nanonets

@anirudhkumar-nanonets anirudhkumar-nanonets commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Moves: learnings_committed, the number of clones whose committed learnings went up in the last 7 days. The PostHog query is in daily/project.md. I didn't check its value today: this session has no Metabase access. The direct signal is cold_start events with outcome = no_claude, which should drop.

What changes

trail init reads the repo's past Claude sessions by running Claude Code headless, and it only looked for claude on PATH. Someone who uses Claude Code only through the VS Code or Cursor extension has no claude on PATH, so init skipped their sessions without a word and saved no learnings. Someone on the PA team hit this on airflow-dags.

claudeBin() in src/notes/cold-start.ts now looks in this order:

  1. claude on PATH
  2. ~/.local/bin/claude, then ~/.claude/local/claude
  3. the newest anthropic.claude-code-*/resources/native-binary/claude under ~/.vscode, ~/.cursor, ~/.vscode-insiders or ~/.windsurf

The read runs whichever it finds. When there's none, init stays quiet as before.

A failed read never marked the repo as read, so anyone who hit this gets their learnings by running trail init again once this ships.

Each learning says how many sessions it came from. From rushabh's 13 Oct suggestion for init's opening ("you've corrected claude 6 times about using pnpm, not npm"):

✓ learned 2 things you told Claude more than once, from your last 12 sessions here
    for your team · told Claude in 6 sessions: Use pnpm, not npm
    just for you  · told Claude in 4 sessions: Say what you understood before building

You tick which learnings to keep. The other half of the same suggestion ("you can tick the ones to keep. claude will follow them from the first prompt"). On a terminal, once the read finishes, init shows what it found, all ticked, in the same picker as the agent choice (↑↓ move, space toggle, a all, enter confirm, esc cancel):

trail init — you told Claude these more than once. Keep the ones it should follow:

› [x] Use pnpm, not npm                 for your team · told Claude in 6 sessions
  [x] Say what you understood first     just for you · told Claude in 4 sessions

Only the ticked ones are saved, and init reports "kept 1 of the 2 things…". Esc saves none and leaves the repo unread, so the next trail init asks again. A run without a terminal, or with --yes, keeps them all as before, so an agent running init isn't blocked. cold_start already had offered_bucket and picked_bucket; picked_bucket now counts what the person kept, and outcome gains cancelled (in TELEMETRY.md).

Tests

  • New claudeBin cases in trail-cold-start: it uses claude on PATH, picks the newest extension copy across VS Code and Cursor (2.1.296 over 2.1.289 over 2.1.99), prefers a standalone install, and skips an extension folder without the binary.
  • trail init end to end: the list shows told Claude in 2 sessions: before each title.
  • Picking: the picker starts all ticked and keeps the ticked ones in order; finishPastRead saves only what was kept and marks the repo read; cancelling saves nothing and leaves it unread.
  • By hand: the VS Code extension's copy on my Mac answers --version (2.1.289).
  • Full suite: 1,407 pass, 0 fail, 1 skipped.

🤖 Generated with Claude Code

@trailhq-graft

trailhq-graft Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

Nothing outside this diff depends on it. 2 areas changed; no indexed dependents at depth 2.
Tests: 2 areas updated their tests.
Tag: @shhdwi — Learning Picker CLI

Who knows this code — 1 person across 2 areas
Area Who knows it
Learning Picker CLI · changed @shhdwi — 25 commits, last yesterday
Cold Start Setup · changed only you — nobody else has touched these files

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 @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

Test signal per changed area — 2 ✓

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.

  • ✓ Learning Picker CLI — 2 of 8 reached · 1 test file changed here: test/cli-picker.test.ts
    • not reached: drivePicker, runPicker, draw, finish, pickLearnings, runInitCommand
  • ✓ Cold Start Setup — 2 of 7 reached · 1 test file changed here: test/trail-cold-start.test.ts
    • not reached: claudeOnPath, extensionVersion, hasClaude, askClaude, findLearnings

⚠️ 1 changed file not in the graph (TELEMETRY.md) — no parser claims the extension, or the index predates the file.

graft blast · origin/main...HEAD · depth 2 · 6 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

github-actions Bot added a commit that referenced this pull request Oct 15, 2026
github-actions Bot added a commit that referenced this pull request Oct 15, 2026
@anirudhkumar-nanonets anirudhkumar-nanonets changed the title Find the extension's claude in trail init trail init: find extension claude, tick learnings Oct 15, 2026
github-actions Bot added a commit that referenced this pull request Oct 15, 2026
@anirudhkumar-nanonets

Copy link
Copy Markdown
Collaborator Author

Folded into #611, so all the trail CLI work for 0.22.1 ships as one PR. Same commits, on top of #611's branch.

github-actions Bot added a commit that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant