fix(claude): stop forking /speckit-analyze to prevent long-session freezes#3188
Merged
Merged
Conversation
…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>
Contributor
There was a problem hiding this comment.
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_COMMANDSin the Claude integration so no skills receivecontext: fork/agent: …frontmatter by default. - Updates Claude integration tests to assert no skills fork by default and that
speckit-analyzespecifically no longer forks. - Retains coverage for the fork injection mechanism via a monkeypatched
FORK_CONTEXT_COMMANDSentry 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
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
Fixes #3185.
/speckit-analyzefreezes 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-purposeto the generatedspeckit-analyzeSKILL.md on the assumption that the command's heavy reads collapse to a short summary. In practice/speckit-analyzereturns 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:
FORK_CONTEXT_COMMANDSinsrc/specify_cli/integrations/claude/__init__.pyso no command opts intocontext: fork, restoring direct in-session execution foranalyze.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:analyze(and all skills) no longer receivecontext/agentfrontmatter.FORK_CONTEXT_COMMANDSis empty by default.Full suite passes:
4584 passed, 4 skipped.Posted on behalf of @mnriem by GitHub Copilot (model: Claude Opus 4.8).