Add backfill command and clarify LINEAR_API_KEY requirement#6
Merged
Conversation
- Add `npx linear-agent-hooks backfill` to post missing provenance comments for sessions where the stop hook couldn't run (e.g. key not set at Claude launch time) - Add per-session `.done` files to track which Linear issues have already received comments — makes stop.mjs and backfill idempotent at the issue level - Update stop.mjs: write/read done set, surface backfill hint in the no-key warning - Update README: explain why LINEAR_API_KEY is needed (stop hook runs after session ends, no MCP available), that it's the same key as the Linear MCP server, and that it must be in the shell profile before launching Claude/Codex - Add 3 new stop.mjs tests (backfill hint, done file written, done-set skip) — total 35 tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npx linear-agent-hooks backfill— new command that replays provenance comments for sessions where the stop hook couldn't post (most common cause:LINEAR_API_KEYnot set in environment when Claude launched).donefiles track which Linear issues have already received comments, making bothstop.mjsandbackfillidempotent at the issue level — safe to run multiple timesTest plan
.donefile written after run, done-set skip skips already-commented issues