streamlinear
CLAUDE.md90 starsChanged 7 months agoMITView on GitHub
streamlinear is a lightweight Linear integration published as the npm package @primeradianthq/streamlinear. It ships two runtime binaries from one TypeScript codebase: The repo also contains .claude-plugin/ for clone-based Claude Code plugin usage. That plugin surface is intentionally repo-only and is not included in the npm package. Most behavior lives in mcp/src/linear-core.ts. The MCP server and CLI should stay thin shells over that shared module. Install dependencies in both workspaces: Run commands from the repository root unless noted otherwise. To exercise…
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Run commands from the repository root unless noted otherwise.
- Very specific: line 79
Avoid adding npm lifecycle hooks such as prepare, postinstall, or prepublishOnly.
- Very specific: line 98
When adding an action, update the schema, dispatcher, handler, handleHelp(), CLI argument routing, tests, and buildToolDescription() …
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code when working in this repository.
What This Is
streamlinear is a lightweight Linear integration published as the npm package
@primeradianthq/streamlinear.
It ships two runtime binaries from one TypeScript codebase:
streamlinear: the stdio MCP server atmcp/dist/index.js.streamlinear-cli: the local CLI atmcp/dist/cli.js.
The repo also contains .claude-plugin/ for clone-based Claude Code plugin
usage. That plugin surface is intentionally repo-only and is not included in
the npm package.
Most behavior lives in mcp/src/linear-core.ts. The MCP server and CLI should
stay thin shells over that shared module.
Setup
Install dependencies in both workspaces:
npm ci
npm --prefix mcp ciCommon Commands
Run commands from the repository root unless noted otherwise.
npm run build # bundle mcp/dist/index.js and mcp/dist/cli.js
npm run typecheck # TypeScript check for mcp/src
npm run test # node:test coverage under mcp/test
npm run dist:check # verify committed dist artifacts match source
npm run package:check # verify npm metadata and release invariants
npm run pack:verify # pack and install into a temp consumer
npm run check # full local release gate
npm start --prefix mcp # run the MCP server over stdioTo exercise the CLI locally:
LINEAR_API_TOKEN=lin_api_xxx node mcp/dist/cli.js search
node mcp/dist/cli.js --token-cmd "op read 'op://vault/linear/token'" get ABC-123Build Artifacts
mcp/dist/index.js and mcp/dist/cli.js are checked into git because they are
the files npm executes. Do not hand-edit them. If you change mcp/src/**, run
npm run build and commit any matching mcp/dist/** changes.
Both dist files need a #!/usr/bin/env node shebang. The mcp/package.json
esbuild commands add it with --banner:js.
Package Boundary
The npm package is intentionally small. The root package.json files
allowlist controls the published surface:
mcp/dist/index.jsmcp/dist/cli.jsmcp/package.jsonREADME.mdLICENSESECURITY.mdCONTRIBUTING.mdCHANGELOG.md
CLAUDE.md, AGENTS.md, .claude-plugin/**, GitHub workflows, scripts, tests,
and source files are clone/dev-only unless the allowlist is changed on purpose.
Avoid adding npm lifecycle hooks such as prepare, postinstall, or
prepublishOnly. Consumers should be able to install the package without
running a local build. Clone-time hooks are optional and should stay behind
explicit commands such as npm run hooks:install.
Architecture Notes
mcp/src/linear-core.ts owns:
- The Linear GraphQL helper and runtime token handling.
- Lazy caches for the authenticated viewer and teams.
- Resolution helpers for issue IDs, team names, workflow state names, and assignees.
- Action handlers for
search,get,update,comment,create,graphql, andhelp. - The Zod
LinearParamsschema anddispatchAction(params)dispatcher. buildToolDescription(), which fetches teams/states at MCP startup so the model sees valid options in the tool description.
When adding an action, update the schema, dispatcher, handler, handleHelp(),
CLI argument routing, tests, and buildToolDescription() together.
Handlers should return useful strings for user-recoverable failures, especially unknown teams or workflow states. Throw only for unrecoverable setup/API errors that the MCP and CLI entry points should surface as command failures.
The graphql action is the deliberate escape valve for Linear capabilities not
covered by the typed actions. Prefer using it before growing the typed surface.
Runtime Contract
The MCP server requires LINEAR_API_TOKEN at runtime. Product consumers can
expose their own operator-facing variable names, but they should map those
values to LINEAR_API_TOKEN before starting streamlinear.
The CLI token precedence is:
--token--token-cmdLINEAR_API_TOKEN
Release Notes
Release tags are vX.Y.Z and must match the package version. The release
workflow runs npm run release:verify-tag, npm run check, then
npm publish --access public --provenance.
The first scoped npm publish may still need to happen manually with a human logged into npm. After that, prefer the GitHub release workflow once npm auth is configured.
Runtime bugs and security hardening belong in the follow-up ticket, not in the npm publication plumbing, unless Drew explicitly expands the release scope.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

