---
title: "ssh2shell 4.2.1 Breaking Changes on npm | Since.dev"
description: "What each ssh2shell release removed, renamed or changed: 15 breaking changes in 2 versions on npm, each with its source."
canonical_url: https://since.dev/packages/npm/ssh2shell
last_updated: 2026-12-04
---

# ssh2shell breaking changes

ssh2shell 4.2.1 (November 24, 2026) is its newest release with breaking changes, 11 of them. The first: Removed HostConfig.\_\_index. Every breaking API change we have recorded in ssh2shell on npm: 15 breaking changes in 2 versions. Below, its 2 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `4.2.1`, released November 24, 2026. [Source repository](https://github.com/cmp-202/ssh2shell)

Packages on npm run on Node.js. [Node.js end of life dates](https://since.dev/calendar/nodejs.md).

- From [4.0.3](#v-4-0-3) to [4.2.1](#v-4-2-1): 11 breaking changes in 1 version.

## ssh2shell 4.2.1 breaking changes

ssh2shell 4.2.1, released November 24, 2026: 11 breaking changes.

- **Removed** `HostConfig.__index`  

HostConfig.\_\_index was removed in ssh2shell 4.2.1 [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed**  

Command responses are now typed as strings, HostConfig carries ThisType\<SSH2Shell>, stop() returns this, and addListener has EventEmitter-compatible overloads. Typed code that relied on the looser declarations may need adjusting; runtime... [github.com](https://github.com/cmp-202/ssh2shell/releases/tag/v4.2.1)
- **Signature changed** `CommandCompleteDetails.rawResponse`  

Was rawResponse: string | Uint8Array; now rawResponse: string. [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed** `CommandCompleteHandler`  

Was type CommandCompleteHandler = (this: SSH2Shell, command: string, response: string | Uint8Array, host: HostConfig, details: CommandCompleteDetails) => void; now type CommandCompleteHandler = (this: SSH2Shell, command: string, response... [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed** `CommandProcessingHandler`  

Was type CommandProcessingHandler = (this: SSH2Shell, command: string, response: string | Uint8Array, host: HostConfig, stream: ShellStream) => void; now type CommandProcessingHandler = (this: SSH2Shell, command: string, response: string... [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed** `CommandTimeoutHandler`  

Was type CommandTimeoutHandler = (this: SSH2Shell, command: string, response: string | Uint8Array, stream: ShellStream, connection: SSHConnection, details: TimeoutDetails) => void; now type CommandTimeoutHandler = (this: SSH2Shell... [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed** `default.stop`  

Was stop(reason?: string): unknown; now stop(reason?: string): this. [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed** `EventMap.commandComplete`  

Was commandComplete: \[string, string | Uint8Array, HostConfig, CommandCompleteDetails\]; now commandComplete: \[string, string, HostConfig, CommandCompleteDetails\]. [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed** `EventMap.commandProcessing`  

Was commandProcessing: \[string, string | Uint8Array, HostConfig, ShellStream\]; now commandProcessing: \[string, string, HostConfig, ShellStream\]. [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed** `EventMap.commandTimeout`  

Was commandTimeout: \[string, string | Uint8Array, ShellStream, SSHConnection, TimeoutDetails\]; now commandTimeout: \[string, string, ShellStream, SSHConnection, TimeoutDetails\]. [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)
- **Signature changed** `HostConfig`  

Was interface HostConfig; now type HostConfig = HostOptions & ThisType\<SSH2Shell>. [npmjs.com](https://www.npmjs.com/package/ssh2shell/v/4.2.1)

## ssh2shell 4.0.3 breaking changes

ssh2shell 4.0.3, released November 18, 2026: 4 breaking changes.

- **Behavior changed** `connect`  

Each SSH2Shell instance runs once. Calling connect() again now throws instead of calling back with an empty string; construct a new instance to run again. [github.com](https://github.com/cmp-202/ssh2shell/releases/tag/v4.0.3)
- **Behavior changed** `pty`  

The pty option was previously ignored and is now honored, so setting pty to false turns off the pseudo-terminal for the connection. [github.com](https://github.com/cmp-202/ssh2shell/releases/tag/v4.0.3)
- **Behavior changed** `stop`  

Calling stop() after a run that failed is now a no-op. Code that relied on stop() acting in that state must change. [github.com](https://github.com/cmp-202/ssh2shell/releases/tag/v4.0.3)
- **Behavior changed** `verbose`  

With verbose set to true, privateKey is now hidden in the config dump, like password and passphrase. Code that expects it in that output must use exposeCredentials: true. [github.com](https://github.com/cmp-202/ssh2shell/releases/tag/v4.0.3)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
