Skip to content

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

Merged
mnriem merged 1 commit into
github:mainfrom
mnriem:mnriem-fix-3185-analyze-no-fork
Jun 26, 2026
Merged

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

Conversation

@mnriem

@mnriem mnriem commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3185.

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

PR #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>
Copilot AI review requested due to automatic review settings June 26, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Rolls back Claude Code’s /speckit-analyze forked-subagent execution by default to prevent long-session slowdowns/freezes caused by repeatedly injecting large analysis reports back into the main conversation context, while keeping the fork-injection machinery available for future opt-in.

Changes:

  • Empties FORK_CONTEXT_COMMANDS in the Claude integration so no skills receive context: fork / agent: … frontmatter by default.
  • Updates Claude integration tests to assert no skills fork by default and that speckit-analyze specifically no longer forks.
  • Retains coverage for the fork injection mechanism via a monkeypatched FORK_CONTEXT_COMMANDS entry to ensure the feature remains functional and idempotent when re-enabled.
Show a summary per file
File Description
src/specify_cli/integrations/claude/__init__.py Removes default fork frontmatter injection by setting FORK_CONTEXT_COMMANDS to {} and documents the rationale.
tests/integrations/test_integration_claude.py Adjusts assertions to match the new default (no fork) and keeps the injection mechanism tested via monkeypatch.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Low

@mnriem mnriem merged commit c49966d into github:main Jun 26, 2026
12 checks passed
@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

2 participants