Skip to content

Stop trail hiding which repo a terminal is in - #749

Merged
shhdwi merged 3 commits into
mainfrom
claude/keep-repo-in-tab-title-53d77c
Nov 7, 2026
Merged

shhdwi merged 3 commits into
mainfrom
claude/keep-repo-in-tab-title-53d77c

Conversation

@anirudhkumar-nanonets

@anirudhkumar-nanonets anirudhkumar-nanonets commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

The issue: After trail init, a person's own Claude Code status line, the one that showed which folder the terminal is in, was replaced by trail's. With several terminal tabs open, they couldn't tell which repo each tab was in.
Why: trail wrote its status line into .claude/settings.local.json, which Claude Code ranks above ~/.claude/settings.json and the repo's .claude/settings.json, so it hid a line set in either. trail's own line didn't name the folder either.
The fix: trail now adds its status line only when neither of those files already has one that isn't trail's, and a re-run (or the rewire after an upgrade) takes back the line an older init wrote. When trail's line is the only one, it starts with the folder name.

Moves: inits that keep the person's own status line, init_completed with the new statusline = 'theirs' (PostHog, Metabase db 11, posthog_event_full_view): none today, because the property is new in this PR. As of 2 Nov 2026, 0 of the 5,826 init_completed events from the last 7 days carry it (1,177 installs).

What changed

  • mergeTrailLocal (src/claude/settings-merge.ts) takes theirs, the other settings Claude Code reads here, and leaves statusLine / subagentStatusLine out of the local file when one of them already sets a line that isn't trail's. It warns the way it already did for a line in the local file, and returns which line shows: trail, theirs or off.
  • runTrailInit passes it ~/.claude/settings.json and the repo's .claude/settings.json.
  • renderStatusline takes the folder (the project dir's basename) and puts it first: ◤ web_app · trail · 5 nodes / 6 edges · ✓ synced.
  • init_completed gets statusline, a closed set (trail/theirs/off), in the contract, TELEMETRY.md and the init call.
  • README: drops the advice to pass --no-statusline to keep a custom line, since it's kept now.

Before and after

Real Claude Code 2.1.312 in a pseudo-terminal, a scratch home, trail built from this branch before and after the change.

A home whose ~/.claude/settings.json has its own status line (folder | model):

before trail       ~/work/api_server | Opus 5.5
after trail init   ◤ trail · 5 nodes / 6 edges · ✓ synced
after this fix     ~/work/api_server | Opus 5.5

trail init now says why: ⚠ Existing statusLine left untouched (a session allows only one). To use Trail, point it at .trail/statusline.cjs.

A home with no status line, two tabs:

before   ◤ trail · 5 nodes / 6 edges · ✓ synced            (both tabs)
after    ◤ web_app · trail · 5 nodes / 6 edges · ✓ synced
         ◤ billing · trail · 5 nodes / 6 edges · ✓ synced

trail check

It reports 4 conflicts, all keyword matches on unrelated learnings: one about the "Trail installed" nudge on npm i -g, and one about hooks standing down in a sandbox that runs Claude with the real HOME. This change reads ~/.claude/settings.json only for its status line, never for hooks. The one edge it leaves: Claude run with --setting-sources project,local while ~/.claude has a status line shows none, because trail steps aside for a line Claude won't load there.

Tests

  • New: the merge keeps a line from ~/.claude or the repo's settings and takes back trail's old one; runInit with a home that has its own line writes none; the folder comes first; init_completed drops a statusline value outside the set.
  • CI test (ubuntu-latest) passes. Locally, npm test with a scratch HOME ran on a machine under heavy load, and its failures (deadline and timing tests, plus graft-to-trail, hosts-trail and upkeep-hooks) failed the same way on unchanged main there.

🤖 Generated with Claude Code

@trailhq-graft

trailhq-graft Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

3 areas changed → 9 areas can be affected. 25 dependent symbols, depth 2.
Tests: no test reaches Command Execution; 1 area updated its tests.
Tag: @shhdwi — 12 of 12 areas · @xiehuanyi — Hook Management

flowchart TB
  A0(("Hook Management<br/>11 symbols"))
  A1(("Initialization Process<br/>3 symbols"))
  A2(("Cloud Notifications<br/>3 symbols"))
  A3(("Note Management<br/>2 symbols"))
  A4(("Telemetry Tracking<br/>2 symbols"))
  AX(("4 smaller areas<br/>4 symbols"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1,A2,A3,A4 reached;
  classDef tail fill:#EEF2F3,stroke:#9AA4A9,stroke-width:1px,color:#3A4247;
  class AX tail;
Loading
Can be affected Symbols Nearest hop Reached from
Hook Management 11 src/claude/hooks.ts:L1-L580 hooks.ts — imports, depth 1 Contract Management
Initialization Process 3 src/init/keep.ts:L1-L387 keep.ts — imports, depth 1 Contract Management
Cloud Notifications 3 src/cloud/nudge.ts:L1-L505 nudge.ts — imports, depth 1 Contract Management
Note Management 2 src/notes/memory-notes.ts:L1-L280 memory-notes.ts — imports, depth 1 Contract Management
Telemetry Tracking 2 src/telemetry/sessions.ts:L1-L113 sessions.ts — imports, depth 1 Contract Management
CLI Skills 1 src/skills/cli-skills.ts:L1-L376 cli-skills.ts — imports, depth 2 Contract Management
3 smaller areas 3 rewriteWiring, Session Management, Tool Integration see below
Who knows this code — 2 people across 12 areas
Area Who knows it
Contract Management · changed @shhdwi — 1 commit, last 11d ago
Configuration Handling · changed @shhdwi — 5 commits, last 7d ago
Command Execution · changed @shhdwi — 22 commits, last 7d ago
Hook Management · affected @shhdwi — 5 commits, last 7d ago · @xiehuanyi — 1 commit, last 12d ago
Initialization Process · affected @shhdwi — 11 commits, last 7d ago
Cloud Notifications · affected @shhdwi — 19 commits, last 7d ago
Note Management · affected @shhdwi — 4 commits, last 7d ago
Telemetry Tracking · affected @shhdwi — 1 commit, last 11d ago
…4 further 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 @ 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.

All 25 dependent symbols, grouped by area

Hook Management — 11 symbols in 11 files

  • src/claude/hooks.ts:L1-L580 — hooks.ts (imports, depth 1)
  • src/claude/session-metrics.ts:L1-L215 — session-metrics.ts (imports, depth 1)
  • src/claude/skills-wiring.ts:L1-L116 — skills-wiring.ts (imports, depth 1)
  • src/claude/state.ts:L1-L165 — state.ts (imports, depth 1)
  • src/claude/hook-io.ts:L1-L140 — hook-io.ts (imports, depth 2)
  • src/claude/prompt-hook.ts:L1-L307 — prompt-hook.ts (imports, depth 2)
  • src/claude/prompt-skills.ts:L1-L327 — prompt-skills.ts (imports, depth 2)
  • src/claude/skill-use.ts:L1-L80 — skill-use.ts (imports, depth 2)
  • src/claude/stats.ts:L1-L27 — stats.ts (imports, depth 2)
  • src/claude/stop.ts:L1-L216 — stop.ts (imports, depth 2)
  • src/claude/sync-run.ts:L1-L57 — sync-run.ts (imports, depth 2)

Initialization Process — 3 symbols in 3 files

  • src/init/keep.ts:L1-L387 — keep.ts (imports, depth 1)
  • src/init/run.ts:L1-L445 — run.ts (imports, depth 1)
  • src/init/review-screen.ts:L1-L316 — review-screen.ts (imports, depth 2)

Cloud Notifications — 3 symbols in 3 files

  • src/cloud/nudge.ts:L1-L505 — nudge.ts (imports, depth 1)
  • src/cloud/lookup-activity.ts:L1-L60 — lookup-activity.ts (imports, depth 2)
  • src/cloud/pair.ts:L1-L368 — pair.ts (imports, depth 2)

Note Management — 2 symbols in 2 files

  • src/notes/memory-notes.ts:L1-L280 — memory-notes.ts (imports, depth 1)
  • src/notes/pr-reviews.ts:L1-L577 — pr-reviews.ts (imports, depth 1)

Telemetry Tracking — 2 symbols in 2 files

  • src/telemetry/sessions.ts:L1-L113 — sessions.ts (imports, depth 1)
  • src/telemetry/track.ts:L1-L162 — track.ts (imports, depth 1)

CLI Skills — 1 symbol in 1 file

  • src/skills/cli-skills.ts:L1-L376 — cli-skills.ts (imports, depth 2)

rewriteWiring — 1 symbol in 1 file

  • src/upkeep-run.ts:L45-L65 — rewriteWiring (calls, depth 2)

Session Management — 1 symbol in 1 file

  • src/learn/sessions.ts:L1-L310 — sessions.ts (imports, depth 1)

Tool Integration — 1 symbol in 1 file

  • src/mcp/tools.ts:L1-L337 — tools.ts (imports, depth 2)
Test signal per changed area — 1 ✓ · 1 ✗ · 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.

  • – Contract Management — 1 test file changed here: test/telemetry-contract.test.ts
  • ✓ Configuration Handling — 2 of 4 reached · 2 test files changed here: test/claude-format.test.ts, test/trail-init-layout.test.ts
    • not reached: runTrailInit, main
  • ✗ Command Execution — 0 of 2 reached · no test file reaches it
    • not reached: runInitCommand, wireTarget
63 test suites also reference this code

63 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.

  • test/claude-copy-dashes.test.ts
  • test/claude-hook-timeouts.test.ts
  • test/claude-hooks-1b.test.ts
  • test/claude-hooks-perf.test.ts
  • test/claude-hooks-skills.test.ts
  • test/claude-hooks.test.ts
  • test/claude-host-standdown.test.ts
  • test/claude-init.test.ts
  • test/claude-post-bash-walls.test.ts
  • test/claude-pre-bash-wiring.test.ts
  • test/claude-prompt-learnings.test.ts
  • test/claude-prompt-private.test.ts
  • test/claude-session-start-learnings.test.ts
  • test/claude-settings-merge.test.ts
  • test/claude-shim-template.test.ts
  • test/claude-skills-journey-fixtures.ts
  • test/claude-start-skills-1b.test.ts
  • test/claude-state.test.ts
  • test/claude-statusline.test.ts
  • test/claude-stop-trace.test.ts
  • …43 more

⚠️ 3 changed files not in the graph (.trail/learnings/2026-11-02-trail-s-status-line-steps-aside-anirudhkumar.md, README.md, TELEMETRY.md) — no parser claims the extension, or the index predates the file.

graft blast · refs/graft/base...HEAD · depth 2 · 12 changed files

Open the interactive graph → — click an area to see the code that changed, and the line that reaches it.

github-actions Bot added a commit that referenced this pull request Nov 2, 2026
github-actions Bot added a commit that referenced this pull request Nov 3, 2026
@shhdwi
shhdwi merged commit e7ee9d2 into main Nov 7, 2026
8 checks passed
github-actions Bot added a commit that referenced this pull request Nov 7, 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.

2 participants