agent-session

A guide to continuing conversations with an agent across separate turns. It explains the difference between a fresh chat and a workspace that keeps task state, tool results, files, and progress.

In plain words
What is it for?
Use it to understand how to resume agent work, move from chat into a workspace, and reason about retained context and session limits.
Why use it?
It clarifies what the agent remembers and why a long task can continue without repeating all earlier work. It also explains limits caused by very long sessions.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/abilityai/trinity/agent-session
Clone the repo
git clone --depth 1 https://github.com/Abilityai/trinity
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,625 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01625
Opus 5 $0.00000 $0.00813
Sonnet 5 $0.00000 $0.00325
Haiku 4.5 $0.00000 $0.00162

Measured 2d ago against content hash 1ebb1bd6f437, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-session scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

TOKEN=$(curl -s -X POST http://localhost:8000/api/token \
docs/user-docs/agents/agent-session.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Continuous Conversations

Trinity has two conversation surfaces, and the difference is memory.

Surface Where What the agent remembers
Chat tab on Agent Detail /agents/{name}?tab=chat Nothing. Each message starts fresh.
Workspace /workspace Everything — tool results, mid-task state, reasoning — carried across turns.

The Session tab is retired. It was folded into the Chat tab as a mode, and that mode has now been removed in favour of the Workspace. Old ?tab=session links redirect to /workspace?agent=<name>, and the Chat tab carries a Continue in Workspace → link. The underlying session API still exists (see For Agents); what went away is the second UI for it.

This page covers the behavior of a resuming conversation — what carries over, what compaction does to it, and the limits a long task can hit. For the Workspace UI itself, see Workspace.

Concepts

Resume — Each turn reattaches to the same underlying agent session rather than replaying the transcript as text. That preserves strictly more than what was said: files the agent read, commands it ran, where it was in a multi-step skill, and its reasoning state.

Cold turn — A turn with no session to resume: the first message in a chat, the first turn after working memory is cleared, or a recovery turn after the underlying session file is gone. A cold turn re-sends the visible history as text so the agent still has the thread of the conversation.

Auto-compact — Claude Code's own mid-turn summarization of its history when it approaches the model's context limit.

How It Works

What resuming preserves

A resumed turn keeps the agent's working memory. A stateless turn keeps only the words. That is why long, multi-step work belongs in the Workspace: an agent that read three files in turn two still has them in turn six, instead of re-reading them.

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 106 lines · 0 tokens per session scan A 1ebb1bd6f437

Subscribe to this mod's changes

agent-session is an agent published in the GitHub repository Abilityai/trinity (496 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,625 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens