claude-code - 💡(How to fix) Fix [Bug] Claude stops functioning autonomously at 300K tokens, requests session closure and truncates responses [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49191Fetched 2026-04-17 08:48:19
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:40.128Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n at async L (B:/~BUN/root/src/entrypoints/cli.js:5936:10285)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:42.299Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n at async T (B:/~BUN/root/src/entrypoints/cli.js:5936:11055)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:42.300Z"}]

Code Example

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:40.128Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n    at async L (B:/~BUN/root/src/entrypoints/cli.js:5936:10285)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:42.299Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n    at async T (B:/~BUN/root/src/entrypoints/cli.js:5936:11055)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:42.300Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description A los 300 K tokens Claude deja de ser autónomo y pide cerrar la sesión constantemente, es imposible trabajar o hacer las cosas bien pues recorta sus respuestas y tiempo de procesamiento.

Environment Info

  • Platform: win32
  • Terminal: null
  • Version: 2.1.90
  • Feedback ID: fdc4fbb9-cbee-4e02-b419-a9956929aca2

Errors

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:40.128Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n    at async L (B:/~BUN/root/src/entrypoints/cli.js:5936:10285)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:42.299Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at YMH (B:/~BUN/root/src/entrypoints/cli.js:1594:34041)\n    at async T (B:/~BUN/root/src/entrypoints/cli.js:5936:11055)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T14:19:42.300Z"}]

extent analysis

TL;DR

Set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable to resolve the MCP server error.

Guidance

  • The error messages indicate a missing GITHUB_PERSONAL_ACCESS_TOKEN environment variable, which is required for the MCP server to function correctly.
  • To fix this, you need to set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable with a valid token.
  • You can do this by creating a new environment variable in your operating system or by setting it in your terminal/command prompt before running the application.
  • Verify that the token is correctly set by checking the environment variables in your system or by printing the variable value in your terminal/command prompt.

Example

No code snippet is provided as it is not necessary for this specific issue.

Notes

The issue seems to be related to a missing environment variable, which is a common configuration issue. Setting the GITHUB_PERSONAL_ACCESS_TOKEN environment variable should resolve the error.

Recommendation

Apply workaround: Set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable with a valid token to resolve the MCP server error. This is the most straightforward solution to the problem, and it does not require any code changes or upgrades.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING