MCPcopy Create free account
hub / github.com/codeaashu/claude-code / wrapWithCwd

Function wrapWithCwd

src/tools/AgentTool/AgentTool.tsx:641–641  ·  view source on GitHub ↗
(fn: () => T)

Source from the content-addressed store, hash-verified

639 // takes precedence over worktree isolation path.
640 const cwdOverridePath = cwd ?? worktreeInfo?.worktreePath;
641 const wrapWithCwd = <T,>(fn: () => T): T => cwdOverridePath ? runWithCwdOverride(cwdOverridePath, fn) : fn();
642
643 // Helper to clean up worktree after agent completes
644 const cleanupWorktreeIfNeeded = async (): Promise<{

Callers 1

callFunction · 0.70

Calls 1

runWithCwdOverrideFunction · 0.85

Tested by

no test coverage detected