Trail of Bits' gh-cli plugin stops long Claude Code sessions from breaking every Bash call
1 month ago
Trail of Bits fixed gh-cli, its Claude Code plugin that routes GitHub fetches through the gh CLI. Its SessionStart hooks appended a PATH and a session ID export on every startup, resume and compact, until the session env passed about 8 KB and every Bash call failed. gh-cli 1.6.3 writes each line once. https://github.com/trailofbits/skills/pull/347 https://github.com/trailofbits/skills/issues/341
Ask about this presentation
Chapters
Show transcriptHide transcript
Trail of Bits has fixed gh-cli, its Claude Code plugin that sends GitHub fetches through your signed-in GitHub command line tool. Its session start hooks kept writing the same two lines into the session's environment, until every Bash call in that session failed. Version 1.6.3 writes each line once.
Session start fires when a session starts, when it resumes, and after every compact. Each time, both hooks appended an export line, one for PATH and one for the session ID, without checking for a copy already there. One user found 88 to 246 duplicate lines in each of seven long-running sessions.
Claude Code joins those environment files and cuts the result off at about 8 kilobytes. Once the duplicates pass that size, the cut lands in the middle of a line. From then on every Bash call in the session fails, even echo hi, with an unexpected end of file.
Before, each hook appended its line on every fire. Now it searches all of the session's environment files for that exact line, and writes it only when it is missing. Skipping the hook on resume and compact would have missed repeated startup fires, so the check covers more.
Resume and compact also start a new environment file, and Claude Code joins them all. Checking only the current file would still let the line repeat once per file. A maintainer asked for a test across two files. Fired four times across a pair, the old hook left four session ID lines, and the new one leaves one.
The fix ships in gh-cli 1.6.3, merged on October 15. The bug was reported on version 1.6.0 under Windows 11 and Git Bash, and 1.6.2 had the same code. New regression tests fail on the old hooks and pass on the new ones. The pull request carries the diff and the tests.
Up next
2:54Anthropic’s Excel skill stops LibreOffice from rewriting your workbook
@skill-repos
4 hours ago
2:01Agent Skills’ frontend skill stops installing test runners just to check its work
@skill-repos
15 hours ago
2:23Trail of Bits’ taint-trace skill adds the source and sink models your taint analyzer is missing
@skill-repos
2 days ago
1:30Anthropic’s Word, PDF, PowerPoint and Excel skills are now Apache 2.0
@skill-repos
1 week ago
2:32Trail of Bits' cvss-scoring skill turns a bug description into a CVSS v4.0 vector
@skill-repos
1 week ago
3:02Superpowers 7.0.2 fixes skill loading on Pi, OpenCode and Copilot for Windows
@skill-repos
1 week ago
2:12Superpowers’ brainstorming skill now asks why first and stops asking filler questions
@skill-repos
1 week ago
1:37Agent Skills' code review skill now drops findings your code already rules out
@skill-repos
1 week ago
2:10Superpowers 7.0.1 keeps its five-round fix limit after Claude Code compacts
@skill-repos
3 weeks ago
2:11Trail of Bits' regression-hunt skill only reports a bug a fresh agent can reproduce
@skill-repos
3 weeks ago
2:30Superpowers’ brainstorming skill now reads your project before it asks you anything
@skill-repos
3 weeks ago
2:13Trail of Bits fixes mermaid-to-proverif, which read ProVerif's results backwards
@skill-repos
1 month ago





