DEV Community

VANSH ARORA
VANSH ARORA

Posted on

Closing the Agent Loop: How TokenCap Stages and Redacts Conversation Memory

One of the biggest productivity leaks in AI-assisted engineering is context reset. You spend an hour explaining architectural constraints to an agent, write code, close the tab, and the next day you start from zero.

We built Session Capture in TokenCap to close the loop between agent chat and repository history.

The Staged Memory Pipeline

Instead of auto-committing raw chat dumps, TokenCap implements a staged review pipeline:

  1. Capture: Client sends a structured summary via POST /capture or tokencap remember.
  2. Normalization and Redaction: Regex scanners strip credentials, JWTs, emails, and private tokens.
  3. Path Grounding: Every referenced file is verified against the filesystem.
  4. Scoring: Assigns a confidence tier (LOW, MEDIUM, HIGH) based on path validity, anchor count, and novelty.
  5. Inbound Staging: The session is written as an immutable JSON proposal in .tokencap/memory/inbound/.
# Review staged inbound memory sessions
tokencap remember --list

# Inspect and approve
tokencap remember --approve session-2026-09-24-auth-refactor
Enter fullscreen mode Exit fullscreen mode

Once approved, the session moves to .tokencap/memory/sessions/ and updates agent-pack.md and Architecture Decision Records (ADRs). Future agent sessions automatically read these verified notes.

Learn more about the memory engine at tokencap.vansharora.app

Top comments (0)