Skip to content

feat(deep-links): make PostHog Code a Linear custom coding tool target#3577

Open
mateobelanger wants to merge 2 commits into
PostHog:mainfrom
mateobelanger:feat/linear-open-in-deep-link
Open

feat(deep-links): make PostHog Code a Linear custom coding tool target#3577
mateobelanger wants to merge 2 commits into
PostHog:mainfrom
mateobelanger:feat/linear-open-in-deep-link

Conversation

@mateobelanger

Copy link
Copy Markdown

Problem

Closes #3576

Linear can open an issue directly in a coding tool (Settings → Code & reviews), and supports arbitrary tools launched from a URL template with {{issue.identifier}} / {{context}} variables. PostHog Code wasn't set up as one of those tools, so there was no one-click path from a Linear issue into a prefilled task.

Changes

Extends the existing posthog-code://new deep link so Linear can use it as a custom coding tool. Users paste this template into Linear (replacing OWNER/REPO):

posthog-code://new?repo=OWNER/REPO&source=linear&issue={{issue.identifier}}&prompt={{context}}

  • Added optional source (attribution, shared across new/plan/issue routes) and issue (external identifier, e.g. ENG-123) params, plus prompt_length_chars telemetry to catch OS-level URL truncation. No new route/hostname — Linear passes full context in {{context}}, so there's nothing to fetch (unlike the GitHub issue route). prompt goes last in the template so truncation only ever clips prompt text.
  • New Settings → Linear section with a copyable URL template (correct scheme per build) and setup steps; extracted the shared CopyableCommand component out of ClaudeCodeSettings.
  • Documented both params and the Linear flow in docs/DEEP-LINKS.md.

The Linear agents integration (delegate an issue → agent works it → activity streamed back) is out of scope here — it lives on the PostHog Django backend.

How did you test this?

  • Full pnpm typecheck, pnpm lint, and pnpm test pass locally. New unit cases cover source/issue parsing, rejection when neither prompt nor repo is present, unicode/newline round-trip, and analytics passthrough (new-task-link + newTaskLinkResolver).
  • Live check against the running dev app: fired posthog-code-dev://new?repo=…&source=linear&issue=ENG-123&prompt=… and confirmed the main-process handler logged source: 'linear', hasIssue: true, correct repo and prompt length, and queued the pending link.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Linear can launch custom coding tools from a URL template with
{{issue.identifier}} and {{context}} variables. Extend the existing
posthog-code://new deep link with optional source and issue params so
Linear-launched opens are attributed in analytics and carry the issue
identifier, add a Settings > Linear section with a copyable URL
template, and document the flow in DEEP-LINKS.md.

Generated-By: PostHog Code
Task-Id: 8c8167bc-4619-470c-a11c-b87b6012f6c7
@trunk-io

trunk-io Bot commented Jul 20, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

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.

Support opening Linear issues in PostHog Code (custom coding tool)

1 participant