<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Agent Session Management on RockB</title><link>https://baeseokjae.github.io/tags/agent-session-management/</link><description>Recent content in Agent Session Management on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 31 Aug 2026 10:05:07 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/agent-session-management/index.xml" rel="self" type="application/rss+xml"/><item><title>Coding Agent Experience Management: Manage, Migrate, and Extract Value from Local Sessions</title><link>https://baeseokjae.github.io/posts/agenthist-coding-agent-experience/</link><pubDate>Mon, 31 Aug 2026 10:05:07 +0000</pubDate><guid>https://baeseokjae.github.io/posts/agenthist-coding-agent-experience/</guid><description>Coding agent experience management means turning scattered local sessions into a searchable, migratable, reusable library. AgentHist handles browse, search, export, import, cross-agent conversion, and evidence-backed experience extraction.</description><content:encoded><![CDATA[<p>Coding agent experience management is the practice of turning the session history your local coding agents generate into a searchable, migratable, and reusable asset instead of leaving it as scattered log files. Open-source tools such as AgentHist bring sessions from Codex, Claude Code, OpenCode, and Pi into one library for browsing, searching, exporting, and selective importing — including cross-machine migration and cross-agent conversion. AgentHist is a TypeScript CLI, MIT-licensed, supporting Linux, macOS, and Windows, created August 2026 (source: GitHub API).</p>
<h2 id="why-your-coding-agents-history-is-your-most-underused-asset">Why your coding agent&rsquo;s history is your most underused asset</h2>
<p>Every coding agent session captures decisions, requirements, and working methods that your team paid tokens to produce. Yet in most setups, that history is treated as ephemeral. When a session ends, the transcript sinks into a verbose log file that nothing indexes, nothing searches, and nothing reuses. The next session on the same codebase starts from zero, re-reading the same files and re-deriving the same conclusions.</p>
<p>This is a real economic problem, not an aesthetic one. Consider what the research brief for this guide uncovered: the community has responded with at least three separate open-source tools — AgentHist, coding_agent_session_search (cass), and ctx — all built around the same insight that coding agents have git history for code but effectively no usable memory for the reasoning behind it. The core value proposition stated in the ctx project README is that coding agents already have git history but their session transcripts live in verbose log files the developer cannot query.</p>
<p>The return on experience management shows up in four measurable places: less repeated agent work, lower token spend, better task outcomes, and the ability to recover failed approaches and decisions from prior sessions. When a session disappears, a hard-won bug hunt, a rejected architecture, or a carefully tested workaround is gone with it. Managing that history turns a one-time cost into a compounding asset.</p>
<h2 id="what-agenthist-does--one-library-for-all-your-agent-sessions">What AgentHist does — one library for all your agent sessions</h2>
<p>AgentHist (lohoz/agenthist) is designed around a simple premise: your coding agents already produce rich session records, and you should own them in one place. It supports four agents today — Codex, Claude Code, OpenCode, and Pi — and brings their sessions into a unified store that you can browse, search, export, and selectively import.</p>
<table>
  <thead>
      <tr>
          <th>Capability</th>
          <th>What it does</th>
          <th>Agents supported</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Browse &amp; history</td>
          <td>List and inspect past sessions in one timeline</td>
          <td>Codex, Claude Code, OpenCode, Pi</td>
      </tr>
      <tr>
          <td>Resume</td>
          <td>Pick up a prior session where it left off</td>
          <td>Same as above</td>
      </tr>
      <tr>
          <td>Search</td>
          <td>Run unified search across all sessions</td>
          <td>Same as above</td>
      </tr>
      <tr>
          <td>Export</td>
          <td>Package sessions for backup or migration</td>
          <td>Same as above</td>
      </tr>
      <tr>
          <td>Selective import</td>
          <td>Pull specific sessions back in with conflict detection</td>
          <td>Same as above</td>
      </tr>
      <tr>
          <td>Cross-agent conversion</td>
          <td>Convert Codex sessions to Claude Code and back</td>
          <td>Across supported agents</td>
      </tr>
      <tr>
          <td>Experience extraction</td>
          <td>Extract recurring requirements, preferences, and methods</td>
          <td>Cross-session</td>
      </tr>
  </tbody>
</table>
<p>The differentiator versus earlier tools is the selective import and cross-agent conversion workflow. AgentHist treats your session history as something you can move and reshape, not just view. Before writing anything, it reports conflicts and lets you inspect what a migration would do, which fits a safe-by-design framing discussed below.</p>
<h2 id="setting-up-agenthist--install-doctor-and-first-scan">Setting up AgentHist — install, doctor, and first scan</h2>
<p>AgentHist runs on the JavaScript runtime and requires Node.js 24 (source: README). Installation is a standard package-manager step. Once installed, the workflow starts with a <code>doctor</code> command that validates your environment, then a <code>scan</code> that discovers sessions from each supported agent and ingests them incrementally into the local store.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install -g agenthist
</span></span><span style="display:flex;"><span><span style="color:#75715e"># or, without a global install</span>
</span></span><span style="display:flex;"><span>npx agenthist --help
</span></span></code></pre></div><p>The command set is documented in the README and includes: <code>doctor</code>, <code>scan</code>, <code>history</code>, <code>resume</code>, <code>export</code>, <code>inspect</code>, <code>import</code>, <code>experience</code>, <code>skill</code>, <code>codex provider</code>, and <code>transaction</code>. Two early commands matter most on first setup:</p>
<ul>
<li><code>doctor</code> — checks that the environment and any agent providers are healthy before you scan.</li>
<li><code>scan</code> — discovers and ingests sessions. Because processing is incremental, a second scan only handles sessions that changed since the last run, keeping repeat analysis cheap.</li>
</ul>
<p>If you hit a problem, <code>doctor</code> is the first place to look. It surfaces environment or provider issues before you waste time on an ingestion that cannot succeed.</p>
<h2 id="browse-search-and-resume-sessions-from-any-agent">Browse, search, and resume sessions from any agent</h2>
<p>Once sessions are scanned, the <code>history</code> command gives you a unified view across every supported agent. Rather than opening each agent&rsquo;s own log directory, you see one timeline. From there you can inspect a single session in detail and <code>resume</code> it when you need to continue the work.</p>
<p>The unified view matters because most developers run more than one coding agent. You might prototype in Codex, then switch to Claude Code for a long task, then use OpenCode for a small edit. Without a unified store, that workflow fragments your memory across three incompatible formats. AgentHist collapses them into one browsable source of truth.</p>
<p>The resume flow is also a form of continuity insurance. When you come back to a task days later, you do not have to reconstruct the context from a stale chat window. You recall the session by name or description, inspect its transcript, and resume exactly where the work left off.</p>
<h2 id="migrating-between-machines--export-inspect-and-selective-import">Migrating between machines — export, inspect, and selective import</h2>
<p>Experience management is not just about time; it is about machines. When you switch from a workstation to a laptop, or onto a new machine entirely, your coding agent history should come with you. AgentHist&rsquo;s migration path is export, inspect, then selective import, and it is deliberately granular so you never migrate more than you intend.</p>
<p>The workflow uses session references such as <code>ahsr1_codex_ck1_7d4c...</code> — a unique identifier for a source session. These refs let you target exactly which sessions you export or import rather than committing to a bulk copy of everything.</p>
<table>
  <thead>
      <tr>
          <th>Migration step</th>
          <th>Command / action</th>
          <th>What it protects</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>1. Export</td>
          <td>Package the sessions you want</td>
          <td>Selectivity — export only what you need</td>
      </tr>
      <tr>
          <td>2. Inspect</td>
          <td>Review the export and its refs before importing</td>
          <td>Safety — confirm exactly what will be written</td>
      </tr>
      <tr>
          <td>3. Import</td>
          <td>Pull sessions into the target machine</td>
          <td>Path mapping across OSes</td>
      </tr>
      <tr>
          <td>4. Verify</td>
          <td>Confirm conflicts were handled</td>
          <td>No silent duplicate or partial writes</td>
      </tr>
  </tbody>
</table>
<p>AgentHist also handles path mapping across operating systems, so a session recorded on a macOS machine with <code>/Users/me/project</code> can be imported sensibly onto a Linux machine that references <code>/home/me/project</code>. This path mapping is what makes cross-machine and cross-OS migration practical rather than theoretical.</p>
<h2 id="converting-sessions-between-agents-codex--claude-code-with-dry-run-and-apply">Converting sessions between agents (Codex → Claude Code) with &ndash;dry-run and &ndash;apply</h2>
<p>Perhaps the most distinctive feature of AgentHist is cross-agent conversion: turning a session from one agent into the format of another. The flagship example is converting a Codex session into a Claude Code session, but the tool supports conversion in either direction among the supported agents.</p>
<p>This feature is a direct answer to vendor lock-in. Your accumulated session history in one agent is a sunk investment; the ability to convert it to another agent&rsquo;s format means you can switch tools without abandoning the context you have built up. The project frames this as &ldquo;cross-Agent conversion (Codex -&gt; Claude, etc.)&rdquo; and positions it as a core reason to manage history rather than let each agent own its fragments in isolation.</p>
<p>Two flags govern the write path and they are the safety rail for the whole feature:</p>
<ul>
<li><code>--dry-run</code> — preview exactly which sessions would convert and how, without changing anything on disk.</li>
<li><code>--apply</code> — actually perform the conversion after you have reviewed the dry run.</li>
</ul>
<p>This preview-then-apply pattern is what separates conversion from destructive migration. You see the plan, confirm it matches your intent, and only then commit the write. It is the same conservative behavior applied to imports and experience writes.</p>
<h2 id="extracting-cross-session-experience--the-fastdeep-model-two-tier-workflow">Extracting cross-session experience — the fast/deep model two-tier workflow</h2>
<p>Browsing, migrating, and converting organize your history, but the reason most tools in this space exist is reuse — turning the raw transcript pile into something you can act on. AgentHist addresses this with an <code>experience</code> command that extracts recurring requirements, preferences, and working methods across sessions, then surfaces them as evidence-backed candidates for review, merging, and refinement.</p>
<p>The extraction pipeline uses a two-tier model strategy that is explicitly designed to control cost. A fast model first extracts evidence from each session. An optional deep model then organizes that evidence into structured candidates across sessions. This tiers the expensive reasoning to the top of the funnel only, never re-analyzing unchanged sessions.</p>
<table>
  <thead>
      <tr>
          <th>Workflow stage</th>
          <th>Model tier</th>
          <th>What it produces</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>1. Extract</td>
          <td>Fast model</td>
          <td>Discrete evidence per session</td>
      </tr>
      <tr>
          <td>2. Organize</td>
          <td>Deep model (optional)</td>
          <td>Cross-session candidates</td>
      </tr>
      <tr>
          <td>3. Filter</td>
          <td>Reviewer</td>
          <td>Merged, refined, human-validated preferences</td>
      </tr>
      <tr>
          <td>4. Re-run</td>
          <td>Cached</td>
          <td>No repeat analysis of unchanged sessions</td>
      </tr>
  </tbody>
</table>
<p>The cost control is deliberate. The README identifies incremental processing and cached model results for unchanged sessions as the mechanism that keeps repeated analysis cheap. This matters because experience extraction is not a one-time event — it is something you re-run as new sessions accumulate. If every run re-analyzed everything, the expense would grow unbounded. Because unchanged sessions are skipped, the marginal cost of a daily or weekly extraction stays low.</p>
<p>The output is explicitly framed as candidates, not final answers. Recurring patterns are surfaced for a human to review, merge, and refine before they become durable preferences or working methods. This keeps extracted knowledge grounded in evidence rather than in a model&rsquo;s confident guess.</p>
<h2 id="safety-first--transactions-duplicate-detection-and-what-agenthist-does-not-touch">Safety first — transactions, duplicate detection, and what AgentHist does NOT touch</h2>
<p>A history tool is only trustworthy if it cannot damage the very thing it presides over. AgentHist is built around transactional safety: deduplicate sessions, report conflicts before writing, and recover or roll back changes when something goes wrong.</p>
<p>The <code>transaction</code> command is the mechanism behind this guarantee. Writes to the session store — whether imports, conversions, or experience outputs — are treated as transactions with defined success and rollback paths. If a write fails midway, you can recover rather than being left with a half-updated store.</p>
<p>Duplicate detection is a specific concern in migration. When you import a session that is already present, AgentHist deduplicates by session reference rather than creating a second copy. This prevents the store from ballooning with repeated imports across machine moves.</p>
<p>Equally important is what AgentHist will not do. The README is explicit: it handles history records only and does NOT migrate Base URLs, API keys, tokens, OAuth data, or connection settings. Your credentials and provider configuration stay exactly where they are. This is a meaningful safety boundary — migration tools that copy credentials are a credential-leak risk; AgentHist deliberately avoids that category of data entirely.</p>
<h2 id="agenthist-vs-the-alternatives-cass-ctx-agenthistory--what-to-choose">AgentHist vs the alternatives (cass, ctx, AgentHistory) — what to choose</h2>
<p>AgentHist is not the only tool trying to organize coding-agent history. The field has at least four serious options, and each has a different center of gravity. Choosing among them is a matter of what you value most.</p>
<table>
  <thead>
      <tr>
          <th>Tool</th>
          <th>Approach</th>
          <th>Standout strength</th>
          <th>License / status</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>AgentHist</strong> (lohoz/agenthist)</td>
          <td>TypeScript CLI; browse, search, export, import, cross-agent convert, experience extraction</td>
          <td>Migration + cross-agent conversion + experience reuse</td>
          <td>MIT; ~71 GitHub stars</td>
      </tr>
      <tr>
          <td><strong>cass</strong> (Dicklesworthstone)</td>
          <td>Rust TUI/CLI; unified search/index of ~20+ agents</td>
          <td>Breadth of agents indexed into one timeline</td>
          <td>MIT + AI licenses; ~1,097 stars</td>
      </tr>
      <tr>
          <td><strong>ctx</strong> (ctxrs/ctx)</td>
          <td>CLI for fast local search across sessions; paid <code>ctx pro</code> for transcript provenance</td>
          <td>&ldquo;Git blame for agent sessions&rdquo;</td>
          <td>~1,052 stars, paid add-on</td>
      </tr>
      <tr>
          <td><strong>AgentHistory</strong> (LinnkLabs)</td>
          <td>Local-first task board + searchable librarian for Claude Code / Codex</td>
          <td>Live status board + one-click resume</td>
          <td>VS Code / npx</td>
      </tr>
  </tbody>
</table>
<p>The pattern is clear: the mainstream tools are converging on local-first search as the baseline. What separates AgentHist is the active data plane — migration, selective import, and cross-agent conversion — plus experience extraction. cass excels if your priority is indexing sessions from every agent you have ever installed, including ChatGPT, Copilot, and Hermes, into one searchable timeline. ctx wins if your main pain is provenance — knowing exactly which session produced a given line or commit. AgentHistory wins if you want a live board of what is happening now with click-to-jump resume.</p>
<p>For most developers, the decision comes down to intent. If you want to search history, cass and ctx are strong. If you want to own, move, convert, and mine that history as a durable asset, AgentHist is the more complete fit. Several of these tools are young — AgentHist&rsquo;s star count (~71) is far lower than cass (~1,097) or ctx (~1,052) as of the research date, which reflects its newness, not a lack of capability.</p>
<h2 id="privacy-and-security-notes-on-handling-agenthist-files">Privacy and security notes on handling .agenthist files</h2>
<p>AgentHist stores session content in <code>.agenthist</code> files, and the project is explicit about what those files contain: chat content, including the prompts and responses from your conversations with coding agents. That is not neutral data. A session transcript can include source code, internal design reasoning, customer references, or other material you would not want to leave unguarded.</p>
<p>The README&rsquo;s guidance is blunt: handle <code>.agenthist</code> files as carefully as you would the original conversations. Several practical rules follow from that:</p>
<ul>
<li>Encrypt or restrict access to the directories where AgentHist stores its data, especially on shared or cloud-synced machines.</li>
<li>Do not commit <code>.agenthist</code> files to a repository unless the repository is private and the content is cleared for that exposure.</li>
<li>Be deliberate about what you export and where you import it. A cross-machine migration is a data transfer; treat <code>.agenthist</code> exports the way you would treat exporting chat logs with confidential content.</li>
<li>Remember that experience extraction sends session content through model calls. Because AgentHist supports local models and a tiered call strategy, you can choose the model tier and provider that match your confidentiality needs.</li>
<li>Revisit your store before migrating machines or sharing your terminal environment — a stale transcript is still a sensitive transcript.</li>
</ul>
<p>The privacy boundary matters precisely because the rest of the tool is so capable. If migration, search, and extraction work well, they become the default way your history moves around. The security note is the reminder that every one of those flows is moving chat content that deserves the same care as the original conversation.</p>
<h2 id="faq">FAQ</h2>
<p><strong>What is coding agent experience management?</strong>
Coding agent experience management is the practice of organizing your local coding-agent session history into a searchable, migratable, and reusable asset. It goes beyond searching transcripts to include backing up sessions, migrating them between machines and agents, and extracting recurring requirements and preferences so future sessions do not redo past work.</p>
<p><strong>Which coding agents does AgentHist support?</strong>
As of the research date, AgentHist supports Codex, Claude Code, OpenCode, and Pi. It provides a unified store for browsing, searching, and resuming sessions across all four, and supports cross-agent conversion between them (for example, Codex sessions converted to Claude Code).</p>
<p><strong>Does AgentHist migrate my API keys and connection settings?</strong>
No. AgentHist explicitly handles history records only. It does not migrate Base URLs, API keys, tokens, OAuth data, or connection settings. Your credentials and provider configuration remain untouched, which removes a major credential-leak risk from migration.</p>
<p><strong>How does AgentHist keep migration and import safe?</strong>
It uses transactional writes, duplicate detection, and conflict reporting. Sessions are deduplicated by reference, conflicts are reported before any write, and the transaction command lets you recover or roll back failed writes. Cross-agent conversion additionally uses a <code>--dry-run</code> preview before <code>--apply</code>.</p>
<p><strong>Is AgentHist experience extraction expensive to run?</strong>
The two-tier strategy keeps it cheap. A fast model extracts evidence per session, and an optional deep model organizes candidates across sessions. Incremental processing skips unchanged sessions and caches model results, so repeated extraction runs do not re-analyze everything and the marginal cost stays low.</p>
]]></content:encoded></item></channel></rss>