MCPcopy
hub / github.com/codeaashu/claude-code / maybeShortenFilePath

Function maybeShortenFilePath

src/utils/fileHistory.ts:867–876  ·  view source on GitHub ↗

* Use the relative path as the key to reduce session storage space for tracking.

(filePath: string)

Source from the content-addressed store, hash-verified

865 * Use the relative path as the key to reduce session storage space for tracking.
866 */
867function maybeShortenFilePath(filePath: string): string {
868 if (!isAbsolute(filePath)) {
869 return filePath
870 }
871 const cwd = getOriginalCwd()
872 if (filePath.startsWith(cwd)) {
873 return relative(cwd, filePath)
874 }
875 return filePath
876}
877
878function maybeExpandFilePath(filePath: string): string {
879 if (isAbsolute(filePath)) {

Callers 2

fileHistoryTrackEditFunction · 0.85

Calls 1

getOriginalCwdFunction · 0.85

Tested by

no test coverage detected