Skip to content

fix(claude): stop forking /speckit-analyze to prevent long-session freezes#17

Closed
mnriem wants to merge 1 commit into
mainfrom
mnriem-fix-3185-analyze-no-fork
Closed

fix(claude): stop forking /speckit-analyze to prevent long-session freezes#17
mnriem wants to merge 1 commit into
mainfrom
mnriem-fix-3185-analyze-no-fork

Conversation

@mnriem

@mnriem mnriem commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes github#3185.

/speckit-analyze freezes or becomes very slow when run more than once in a long Claude Code session, a regression introduced in github#2511 (v0.11.8).

PR github#2511 added context: fork + agent: general-purpose to the generated speckit-analyze SKILL.md on the assumption that the command's heavy reads collapse to a short summary. In practice /speckit-analyze returns a 300–500 line report that is injected back into the main conversation on every run. In long sessions each subsequent fork inherits that growing context, compounding overhead until the chat output freezes. A fresh session (first message = /speckit-analyze) is unaffected, which matches the reported behavior.

Fix

This implements Option A from the issue — the minimal rollback:

  • Empty FORK_CONTEXT_COMMANDS in src/specify_cli/integrations/claude/__init__.py so no command opts into context: fork, restoring direct in-session execution for analyze.
  • The injection mechanism (FORK_CONTEXT_COMMANDS + post_process_skill_content) is intentionally retained so a command can be re-enabled in the future once it genuinely returns a compact result (Option B).

Tests

Updated tests/integrations/test_integration_claude.py:

  • Assert analyze (and all skills) no longer receive context/agent frontmatter.
  • Assert FORK_CONTEXT_COMMANDS is empty by default.
  • Retain coverage of the injection mechanism via a monkeypatched entry, so the fork machinery stays tested and idempotent.

Full suite passes: 4584 passed, 4 skipped.


Posted on behalf of @mnriem by GitHub Copilot (model: Claude Opus 4.8).

…eezes

PR github#2511 added `context: fork` + `agent: general-purpose` to the generated
speckit-analyze SKILL.md on the assumption that its heavy reads collapse to a
short summary. In practice /speckit-analyze returns a 300-500 line report that
is injected back into the main conversation. In long sessions each subsequent
fork inherits that growing context, compounding overhead until the chat
freezes (github#3185).

Empty FORK_CONTEXT_COMMANDS so no command opts into context: fork, restoring
direct in-session execution for analyze. The injection mechanism is retained
so a command can be re-enabled once it genuinely returns a compact result.

Fixes github#3185

Assisted-by: GitHub Copilot (model: Claude Opus 4.8, autonomous)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mnriem

mnriem commented Jun 26, 2026

Copy link
Copy Markdown
Owner Author

Superseded by upstream PR github#3188.

@mnriem mnriem closed this Jun 26, 2026
@mnriem mnriem deleted the mnriem-fix-3185-analyze-no-fork branch June 26, 2026 17:11
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.

[Bug]: /speckit-analyze freezes in long sessions after context:fork added in #2511

1 participant