Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

feat: Make Claude CLI timeout configurable, increase default, and bump version to 1.11.0#26

Closed
steipete wants to merge 11 commits into
mainfrom
chore/update-tool-description-1.10.13
Closed

feat: Make Claude CLI timeout configurable, increase default, and bump version to 1.11.0#26
steipete wants to merge 11 commits into
mainfrom
chore/update-tool-description-1.10.13

Conversation

@steipete
Copy link
Copy Markdown
Owner

@steipete steipete commented May 20, 2025

This PR introduces a configurable timeout for the Claude CLI via the CLAUDE_CLI_TIMEOUT_SECONDS environment variable, defaulting to 3600 seconds (60 minutes). It also updates the README and CHANGELOG accordingly. Version bumped to 1.11.0.


Note

Medium Risk
Moderate risk: changes execution timeout behavior for Claude CLI calls and upgrades core dependencies/build tooling (tsgo/pnpm), which could affect runtime behavior and CI/release reliability.

Overview
Adds configurable Claude CLI execution timeout via CLAUDE_CLI_TIMEOUT_SECONDS (default now 60 minutes) and wires it into tool invocation timeout handling.

Bumps release to 1.11.0 and refreshes docs/changelog to describe the new env var and updated tool/version messaging, plus minor markdown/formatting cleanups.

Modernizes project tooling: switches build/test scripts toward tsgo + pnpm, adds oxfmt/oxlint workflows, updates dependencies (notably @modelcontextprotocol/sdk and zod), and removes package-lock.json; GitHub Actions YAML is also reformatted for consistency.

Reviewed by Cursor Bugbot for commit 1e7f75c. Bugbot is set up for automated code reviews on this repo. Configure here.

@steipete steipete changed the title Chore: Update Claude tool description and bump version to 1.10.13 feat: Make Claude CLI timeout configurable and increase default to 60min May 24, 2025
@steipete steipete changed the title feat: Make Claude CLI timeout configurable and increase default to 60min feat: Make Claude CLI timeout configurable, increase default, and bump version to 1.11.0 May 24, 2025
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pseudotensor
Copy link
Copy Markdown

Looks like a good change, any reason why not merged?

@steipete
Copy link
Copy Markdown
Owner Author

Mostly because I'm not using this anymore - buuuut I'll add that to my list and craft a new release soon, thanks for the ping!

@pseudotensor
Copy link
Copy Markdown

I see, is there an alternative to this repo in terms of built-in aspects of claude code? I couldn't find any other way to avoid the permissions issues while allowing (say) claude code or some other MCP client to use claude code itself as MCP server.

@steipete
Copy link
Copy Markdown
Owner Author

run claude with --dangerously-skip-permissions?

@pseudotensor
Copy link
Copy Markdown

For background, the existing sub agents or tasks cannot themselves run tasks. Yet I and others want this feature. maybe it's coming, but one never knows.

To solve this, I tried running

claude mcp add claude_code_unrestricted_server -- claude mcp serve

(claude mcp serve has no permissions options) including with settings.json changes for allowing everything.

The idea is then separate claude talking to this MCP can run full claude that also allows tasks inside.

This works, but fails due to permissions when that every is encountered, regardless of how one runs claude with --dangerously-skip-permissions or allowing all tools in settings.json or whatever.

Only your package was able to be used in this way.

I'm not even clear how people using cursor use the normal claude mcp server since it would be asking for permissions constantly.

Comment thread LICENSE Outdated
MIT License

Copyright (c) 2025 Peter Steinberger
\g<1>2026 Peter Steinberger
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LICENSE file corrupted by malformed regex replacement

The copyright line in the LICENSE file contains \g<1>2026 Peter Steinberger instead of Copyright (c) 2026 Peter Steinberger. This appears to be a regex replacement pattern (Python-style backreference syntax) that was accidentally left in the file during a find-and-replace operation. This corrupts the legal copyright notice, which could have implications for the project's licensing.

Fix in Cursor Fix in Web

Comment thread src/constants.ts
1. Be concise, explicit & step-by-step for complex tasks. No need for niceties, this is a tool to get things done.
2. For multi-line text, write it to a temporary file in the project root, use that file, then delete it.
3. If you get a timeout, split the task into smaller steps.
4. **Seeking a second opinion/analysis**: If you\\'re stuck or want advice, you can ask \\\`claude_code\\\` to analyze a problem and suggest solutions. Clearly state in your prompt that you are looking for analysis only and no actual file modifications should be made.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Escaped apostrophe causes visible backslash in tool description

In the tool description template, \\'re will produce \'re in the output string (with a visible backslash before the apostrophe). In JavaScript template literals, single quotes don't need escaping, so \\' produces a literal backslash followed by an apostrophe. The text "If you're stuck" will be displayed to users instead of the intended "If you're stuck". The apostrophe should simply be ' without any escaping.

Fix in Cursor Fix in Web

Comment thread src/utils.ts
err.stderr = stderr.trim();
err.exitCode = code;
reject(err);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Timeout detection fails due to missing signal/code properties

When Node.js spawn times out, the process is killed and the close event fires with code: null. The error object created in spawnAsync sets exitCode, stdout, and stderr but does not set signal or code properties. However, the timeout detection in the CallToolRequest handler checks for error.signal === 'SIGTERM' or error.code === 'ETIMEDOUT'. Since these properties are never set by spawnAsync, timeout errors are not properly detected, causing users to receive a generic "Claude CLI execution failed" message instead of the timeout-specific message. The tests pass because they mock spawnAsync to reject with the expected properties.

Additional Locations (1)

Fix in Cursor Fix in Web

Comment thread LICENSE Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 066a539. Configure here.

Comment thread .github/workflows/ci.yml
- name: Install dependencies
run: npm ci
- name: Install dependencies
run: npm ci
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CI broken: npm ci requires deleted package-lock.json

High Severity

The project was migrated to pnpm (packageManager field added, pnpm-lock.yaml exists, package-lock.json deleted), but both CI workflows still run npm ci, which strictly requires a package-lock.json to exist. This will cause every CI run to fail immediately. The workflows also reference npm run test:coverage and npm run test:unit, which internally invoke pnpm run build — that too will fail since pnpm isn't installed in the CI environment.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 066a539. Configure here.

@steipete
Copy link
Copy Markdown
Owner Author

Closing this as superseded by a focused extraction on current main: 0c3d630.

I did not merge this branch because it is now dirty against current main and mixes the timeout behavior with old version bumps, package-manager/tooling migration, workflow changes, and broad test rewrites.

What landed instead:

  • Default Claude CLI execution timeout is now 60 minutes.
  • CLAUDE_CLI_TIMEOUT_SECONDS can override it locally.
  • Added parser validation tests and a handler test proving the configured timeout is passed to spawn.
  • Updated README and changelog.

Proof: npm run build && npx vitest run passed with 62 tests, 3 skipped.

@steipete steipete closed this May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants