MCPcopy Index your code
hub / github.com/codeaashu/claude-code / reattach

Method reattach

src/server/web/session-store.ts:78–89  ·  view source on GitHub ↗

* Attach a new WebSocket to an existing session. * Cancels any running grace timer. * Returns null if the session does not exist.

(token: string, ws: WebSocket)

Source from the content-addressed store, hash-verified

76 * Returns null if the session does not exist.
77 */
78 reattach(token: string, ws: WebSocket): StoredSession | null {
79 const session = this.sessions.get(token);
80 if (!session) return null;
81
82 if (session.graceTimer) {
83 clearTimeout(session.graceTimer);
84 session.graceTimer = null;
85 }
86 session.ws = ws;
87 session.lastActive = new Date();
88 return session;
89 }
90
91 /**
92 * Detach the WebSocket from a session and start the grace period timer.

Callers 1

resumeMethod · 0.80

Calls 1

getMethod · 0.65

Tested by

no test coverage detected