MCPcopy
hub / github.com/claude-code-best/claude-code / buildDeepLinkBanner

Function buildDeepLinkBanner

src/utils/deepLink/banner.ts:54–75  ·  view source on GitHub ↗
(info: DeepLinkBannerInfo)

Source from the content-addressed store, hash-verified

52 * and whether its CLAUDE.md may be stale relative to upstream.
53 */
54export function buildDeepLinkBanner(info: DeepLinkBannerInfo): string {
55 const lines = [
56 `This session was opened by an external deep link in ${tildify(info.cwd)}`,
57 ]
58 if (info.repo) {
59 const age = info.lastFetch ? formatRelativeTimeAgo(info.lastFetch) : 'never'
60 const stale =
61 !info.lastFetch ||
62 Date.now() - info.lastFetch.getTime() > STALE_FETCH_WARN_MS
63 lines.push(
64 `Resolved ${info.repo} from local clones · last fetched ${age}${stale ? ' — CLAUDE.md may be stale' : ''}`,
65 )
66 }
67 if (info.prefillLength) {
68 lines.push(
69 info.prefillLength > LONG_PREFILL_THRESHOLD
70 ? `The prompt below (${formatNumber(info.prefillLength)} chars) was supplied by the link — scroll to review the entire prompt before pressing Enter.`
71 : 'The prompt below was supplied by the link — review carefully before pressing Enter.',
72 )
73 }
74 return lines.join('\n')
75}
76
77/**
78 * Read the mtime of .git/FETCH_HEAD, which git updates on every fetch or

Callers 1

runFunction · 0.85

Calls 5

tildifyFunction · 0.85
formatRelativeTimeAgoFunction · 0.85
formatNumberFunction · 0.85
nowMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected