---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/claude_code_cli/adapter/functions/resolveWrapperPathWithFallback.md
---

# Function: \_\_resolveWrapperPathWithFallback()

```ts
function __resolveWrapperPathWithFallback(
  seams?: WrapperPathResolutionSeams,
): Promise<string>;
```

Defined in: [src/batteries/llm/claude\_code\_cli/adapter.ts:328](https://github.com/NHTIO/ADK/blob/v1.20260924.0/src/src/batteries/llm/claude_code_cli/adapter.ts#L328)

Internal, non-public resolver used by the executor call site (never `resolveDefaultWrapperPath`
itself, which stays synchronous and unchanged for backwards compatibility with any caller that
already imports it directly). Tries the existing relative-to-module resolution FIRST — zero
behavior change for the common unbundled case — and only falls back to the self-reference
lookup when that candidate does not exist on disk (bundling relocated the adapter). Throws
[E\_CLAUDE\_CODE\_CLI\_WRAPPER\_NOT\_FOUND](../../exceptions/variables/E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND.md) naming every path tried — the relative candidate (or
its resolution error) AND every self-reference candidate/reason from
[resolveWrapperPathViaSelfReference](resolveWrapperPathViaSelfReference.md) — when neither resolves, rather than letting a bundled
consumer hit an opaque `MODULE_NOT_FOUND`/ENOENT deep inside `execa`, or a truncated error that
hides what the self-reference fallback actually attempted.

## Parameters

| Parameter | Type                         |
| --------- | ---------------------------- |
| `seams`   | `WrapperPathResolutionSeams` |

## Returns

`Promise`<`string`>

## Remarks

Electron/asar note: an app packaged into an `asar` archive can still `readFileSync`/`existsSync`
transparently-unpacked paths through Electron's patched `fs`, so this existence-check strategy
keeps working there without special-casing — but a wrapper asset that ships unpacked (outside
`asar`) is still the consumer's responsibility to arrange, same as any other spawned-executable
asset; `wrapperPath` remains the escape hatch when that layout doesn't line up.
