This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A zero-dependency Linear CLI for AI-assisted development workflows. Single-file implementation (bin/linear.mjs) that wraps Linear's GraphQL API.
This is a single-file CLI with no build step. The entire implementation is in bin/linear.mjs.
# Run locally during development
node bin/linear.mjs <command>
# Test the postinstall script
node postinstall.mjsNo tests exist currently. The CLI requires Node 18+ (uses native fetch).
Single-file design: All CLI logic lives in bin/linear.mjs (~2000 lines). This is intentional - zero npm dependencies, just Node.js built-ins.
Configuration loading (priority order):
./.linear(project-specific)~/.linear(global fallback)- Environment variables (
LINEAR_API_KEY,LINEAR_TEAM)
Key functions:
gql()- GraphQL client using native fetchparseArgs()- Custom argument parser supporting--flag valueand--booleanpatternscmd*()functions - Command handlers (e.g.,cmdIssues,cmdIssueCreate)
Postinstall (postinstall.mjs): Copies Claude skill/command files from claude/ to ~/.claude/ and adds Bash(linear:*) permission to ~/.claude/settings.json.
The claude/ directory contains files installed to ~/.claude/:
skills/linear-cli.md- Teaches Claude how to use the CLIskills/product-planning.md- Product planning workflowscommands/next.md-/nextcommand implementationcommands/done.md-/donecommand implementation
Branch names: ISSUE-ID-slugified-title (e.g., ISSUE-5-add-caching-layer)
Commit messages should include issue ID: ISSUE-5: Add cache invalidation
--unblockedfilter: Finds issues with no active blockers (the main differentiator)- Worktree support:
linear nextcreates isolated git worktrees in~/.claude-worktrees/ .worktreeinclude: Lists gitignored files to copy to new worktrees (e.g.,.linear,.env)- T-shirt sizing: XS/S/M/L/XL estimates map to Linear's numeric scale