Open source · local · for Claude Code

Stop paying twice for the same context.

Every call to the model sends the whole conversation again. arricurdAI reads your Claude Code transcripts on your machine, shows where the tokens go, and stops the most expensive habit of all: resuming a large session after its prompt cache expired.

The name comes from arricurdari, Sicilian for “to remember”.

0.05×

the input price, to read a token from the cache on Claude Opus 5.5 and Sonnet 5.5.

2×

the input price, to write the whole context again once the one-hour cache expires.

−40%

cost of a new session with a note, against one long session, with a pause before each step.

0

network calls. It reads local files, sends no telemetry and uses no model.

Why sessions get expensive

The context is paid for on every call.

A coding agent sends the model everything it has read and said so far, on every call. The prompt cache makes that cheaper, but not free, and it forgets after an hour.

1

Each call reads it all again

A session that has gathered 500,000 tokens pays to read all of them on every call: about $0.10 per call with Opus 5.5, before the model writes a word.

2

A pause empties the cache

After an hour away, the next prompt writes the whole context to the cache again, at twice the input price. That one call costs as much as reading the context forty times.

3

Start fresh, carry a note

A new session starts from the system prompt and a short note on the old one. The agent reads files again only when it needs them, so every later call is cheaper too.

Try it

Continue, or start fresh?

You come back to a session after more than an hour. This is what the next calls cost in context. Output and new content cost the same either way, so they are left out.

Continue here
Start fresh with a note

What it does

One profiler, two hooks.

The profiler tells you where the tokens go. The hooks act on the biggest waste it finds, without changing how you work.

command

profile: see where the tokens go

The cost of every session, weighted by price. Which blocks of context carry it. What compacting at other moments would have saved. Memory lines never used, and files read again.

arricurdai profile --project .
hook · UserPromptSubmit

guard: stop the costly resume

When the cache of a session over 100,000 tokens has expired, it stops your first prompt once and shows what going on would cost. Send it again to go on.

arricurdai guard --min-tokens 100000
hook · SessionStart

handoff: start fresh, keep the thread

After that /clear, it gives the new session a note built from the transcript, without a model: the last requests, the files changed, the open tasks and the last reply. It also tells every new session how to run recall, which searches past sessions. A tool that sends /clear itself, such as Forchetta, asks for the note first with handoff --prepare.

arricurdai handoff

Evidence

Measured, then published.

Five steps of real work on go-chi/chi with Claude Code and Sonnet 5.5, under four ways of handling the context. Every variant passed hidden acceptance tests and the whole test suite.

Cost with a pause before each step

The cost Claude Code reported, plus writing the prefix of each step to the cache again after more than an hour.

One long session
$1.07
Auto-compact at 100k
$1.02
/compact between steps
$0.86
New session + note −40%
$0.64

Without pauses, compacting cost more than it saved: a summary is paid at the output price, five times the input price. The whole experiment

Baseline

What three public repositories spend.

Five scripted Claude Code sessions on each repository, coming back to the same area of the code, then profiled. Costs are in price-weighted tokens, with the cache-read price before Claude 5 models (0.1).

RepositoryAreaMean cost KRediscoveryS_maxMemory shareUnused memory lines
vitejs/viteHot module replacement58,0125.8%1.2%3.4%20 / 34
fastapi/fastapiDependency injection53,4225.7%0.95%3.5%14 / 23
gin-gonic/ginRouting43,7544.1%0.51%4.5%15 / 23

Start

Measure first, then let the hooks work.

It needs Node 20 or later.

1. Install and profile

npm install -g arricurdai
arricurdai profile --project /path/to/project

New here? The guide explains every part of the report.

2. Add the hooks

arricurdai setup

It shows the changes to your Claude Code settings and asks first. arricurdai setup --remove takes them out.

On any problem the hooks let the prompt through.

Roadmap

From measuring to remembering.

✓ Done

Profile

The price-weighted cost of every session, where it goes, and what other compaction policies would have saved.

✓ Done

Guard and handoff

No cache rewrite after a pause: a new session with a note, chosen by you.

✓ Done

Recall

arricurdai recall "<words>" searches past sessions, locally and without a model. The agent can keep a small context and still find what was decided. It reads each transcript once, so a search takes a fraction of a second.

✓ Done

Compare

arricurdai compare --since <date> compares the sessions before and after a change, and replays them to estimate what the auto-compact limit and the guard each did.

✓ Done

Status

arricurdai status lists the sessions of the last hours: how large their context is, when their cache expires, and what today cost. Also in the macOS menu bar.

✓ New

For the tools around Claude Code

Forchetta, a control centre for sessions that run side by side, reads its numbers from arricurdAI. handoff --prepare writes the note before a /clear it sends, and status --json gives each session its part of the day.