<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[starbased's blog: Find the V in your Q's K]]></title><description><![CDATA[Equipped Engineer Earning Excellence]]></description><link>https://blog.starbased.net</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 11:13:39 GMT</lastBuildDate><atom:link href="https://blog.starbased.net/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Uncovering Claude Code's Hidden --teleport Flag]]></title><description><![CDATA[I've been working on an AST graph analysis of Claude Code's cli.js in my free time, and recently I stumbled upon something I have not seen mentioned anywhere on the internet: fully implemented remote session storage features hidden behind undocumente...]]></description><link>https://blog.starbased.net/uncovering-claude-codes-hidden-teleport-flag</link><guid isPermaLink="true">https://blog.starbased.net/uncovering-claude-codes-hidden-teleport-flag</guid><category><![CDATA[AI]]></category><category><![CDATA[claude-code]]></category><category><![CDATA[claude]]></category><category><![CDATA[codex]]></category><category><![CDATA[coding]]></category><category><![CDATA[ vscode]]></category><category><![CDATA[llm]]></category><dc:creator><![CDATA[starbased]]></dc:creator><pubDate>Sat, 04 Oct 2025 00:45:31 GMT</pubDate><content:encoded><![CDATA[<p>I've been working on an AST graph analysis of Claude Code's <code>cli.js</code> in my free time, and recently I stumbled upon something I have not seen mentioned anywhere on the internet: fully implemented remote session storage features hidden behind undocumented flags. At a later date I can write more about my process, but for now, here’s what I was able to ascertain buried in the AST:</p>
<ul>
<li><p><code>--remote &lt;description&gt;</code> - Creates sessions on <a target="_blank" href="http://claude.ai">claude.ai</a> servers instead of local storage</p>
</li>
<li><p><code>--teleport [session]</code> - Resumes remote sessions from any machine (interactive or direct mode)</p>
</li>
</ul>
<p>Instead of sessions being tied to <code>~/.claude/{projects,todos, etc...}</code>, you get cloud-synced sessions with shareable URLs.</p>
<p>Unsurprisingly, attempting to use these options results in an error:</p>
<pre><code class="lang-bash">claude --remote <span class="hljs-string">"Implementing OAuth2 authentication"</span>
Error: Unable to create remote session
</code></pre>
<p>But that doesn't mean the fun stops here. The exact output strings are embedded in the source, and analyzing the obfuscated AST's control flow graph reveals the underlying behavior patterns, letting us speculate about what this will look like when released.</p>
<h2 id="heading-what-remote-actually-does">What <code>--remote</code> Actually Does</h2>
<pre><code class="lang-bash">claude --remote <span class="hljs-string">"Implementing OAuth2 authentication"</span>
Created remote session: Implementing OAuth2 authentication
View: https://claude.ai/code/550e8400-e29b-41d4-a716-446655440000?m=0
Resume with: claude --teleport 550e8400-e29b-41d4-a716-446655440000
</code></pre>
<p>Sessions are stored on <a target="_blank" href="http://claude.ai"><code>claude.ai</code></a> and all messages are synced automatically.</p>
<h3 id="heading-resuming-a-remote-session">Resuming a Remote Session</h3>
<p>Teleport supports two modes:</p>
<h4 id="heading-interactive-selector">Interactive selector</h4>
<p><code>--teleport</code> with no args:</p>
<pre><code class="lang-bash">claude --teleport
</code></pre>
<p>Fires telemetry event <code>tengu_teleport_interactive_mode</code>, then displays a filterable session list. If you're in a git repo, it automatically filters to show only sessions from that repo, preventing accidental cross-project contamination.</p>
<h4 id="heading-direct-resume">Direct resume</h4>
<p><code>--teleport &lt;id&gt;</code>:</p>
<pre><code class="lang-bash">claude --teleport 550e8400-e29b-41d4-a716-446655440000
</code></pre>
<p>Fetches conversation history from <a target="_blank" href="http://claude.ai"><code>claude.ai</code></a> and resumes locally. Repository validation is enforced and throws an error if current repo doesn't match session metadata:</p>
<h3 id="heading-authentication-required">Authentication Required</h3>
<p>Remote sessions require OAuth tokens from <a target="_blank" href="http://claude.ai">claude.ai</a>. The code explicitly blocks:</p>
<ul>
<li><p><code>ANTHROPIC_API_KEY</code> (shows error: "Remote sessions require <a target="_blank" href="http://claude.ai">claude.ai</a> account")</p>
</li>
<li><p><code>CLAUDE_CODE_USE_BEDROCK</code> environment variable</p>
</li>
<li><p><code>CLAUDE_CODE_USE_VERTEX</code> environment variable</p>
</li>
</ul>
<p>Accepted auth sources:</p>
<ul>
<li><p><code>ANTHROPIC_AUTH_TOKEN</code></p>
</li>
<li><p><code>CLAUDE_CODE_OAUTH_TOKEN</code></p>
</li>
</ul>
<h3 id="heading-implementation-details">Implementation Details</h3>
<p>Here are some of the key functions:</p>
<ul>
<li><p><code>createRemoteSessionAPI()</code> - Creates session via <a target="_blank" href="http://claude.ai">claude.ai</a> API</p>
</li>
<li><p><code>aI1()</code> - Main teleport entry point</p>
</li>
<li><p><code>r4Q()</code> - Interactive session selector with keyboard nav</p>
</li>
<li><p><code>LJB()</code> / <code>MJB()</code> - Dual API implementation (new Sessions API vs. legacy)</p>
</li>
</ul>
<p>The codebase uses two different API versions based on a feature flag check. Session metadata includes:</p>
<pre><code class="lang-javascript">{
  <span class="hljs-attr">id</span>: uuid,
  <span class="hljs-attr">title</span>: string,
  <span class="hljs-attr">updated_at</span>: timestamp,
  <span class="hljs-attr">repo</span>: { owner, name },
  <span class="hljs-attr">branch</span>: string,
  <span class="hljs-attr">log</span>: <span class="hljs-comment">/* conversation history */</span>
}
</code></pre>
<p>No device-specific data is stored; sessions are purely remote state with OAuth-based access from any location. Notably, this differs from other applications with cross-device workflows (e.g. syncthing) that have explicit multi-device syncing.</p>
<h3 id="heading-telemetry-events">Telemetry Events</h3>
<p>Every remote operation emits specific events:</p>
<ul>
<li><p><code>tengu_remote_create_session_success</code> - Session creation</p>
</li>
<li><p><code>tengu_teleport_interactive_mode</code> - Interactive selector shown</p>
</li>
<li><p><code>tengu_teleport_resume_session</code> - Session resumed</p>
</li>
<li><p><code>tengu_teleport_cancelled</code> - User cancelled selection</p>
</li>
</ul>
<h3 id="heading-background-task-integration">Background Task Integration</h3>
<p>Remote sessions integrate with Claude's background task system (<code>cli.js</code> line 3193). When you run a long task in the background, the output includes:</p>
<pre><code class="lang-plaintext">Monitor it with /tasks or at https://claude.ai/tasks/&lt;task-id&gt;.

Or, resume it later with: claude --teleport &lt;session-id&gt;
</code></pre>
<p>The evidence suggests cross-device workflows (start on laptop, resume on desktop) or possibly remote agents running tasks server-side. Let me know if you have an idea.</p>
<h3 id="heading-custom-headers">Custom Headers</h3>
<p>The code checks for <code>TELEPORT_HEADERS</code> environment variable (<code>cli.js</code> line 2839):</p>
<pre><code class="lang-bash"><span class="hljs-built_in">export</span> TELEPORT_HEADERS=<span class="hljs-string">'{"X-Header-Name": "true"}'</span> <span class="hljs-comment"># idk</span>
claude --teleport abc-123-def
</code></pre>
<p>Parsed as JSON and included in API requests. Maybe related to enterprise features?</p>
<h3 id="heading-additional-info">Additional Info</h3>
<ul>
<li><p>Requires internet connectivity</p>
</li>
<li><p>Strict repository validation (throws error on mismatch)</p>
</li>
<li><p>OAuth authentication required</p>
</li>
<li><p>Local MCP servers don't sync</p>
</li>
<li><p>Likely account-locked (no cross-account transfer mechanism visible)</p>
</li>
<li><p>No client-side expiration logic (server-side retention unknown)</p>
</li>
</ul>
<hr />
<p>One last speculation I will make is that these discoveries suggest Anthropic is preparing for enterprise-grade collaborative features in Claude Code, and it may even be only for enterprise with the extent that Anthropic is catering Claude Code to Enterprise customers. Maybe I should figure out how to switch myself to an enterprise plan...</p>
]]></content:encoded></item></channel></rss>