Skip to content

docs(coding-agents): say which harnesses retainEveryTurns applies to - #3380

Merged
nicoloboschi merged 1 commit into
mainfrom
docs-retain-every-turns-scope
Aug 11, 2026
Merged

docs(coding-agents): say which harnesses retainEveryTurns applies to#3380
nicoloboschi merged 1 commit into
mainfrom
docs-retain-every-turns-scope

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Fell out of triaging #2143.

retainEveryTurns has exactly one consumer:

// core/runtime.ts:186
if (users - st.retainedUsers >= this.cfg.retainEveryTurns) {

RuntimeCore is the persistent-plugin path — opencode, Kilo, Cline CLI. Those hosts load the plugin once and keep it alive, so it chooses when to write back, and a cadence is the only thing stopping a write every turn.

The hook harnesses (claude-code, codex, cursor-cli, copilot-cli, grok-build, antigravity, devin) never consult it, and that's structural rather than an oversight: the host decides when they run, and each Stop is a fresh process with no memory of how many turns have passed.

Neither the config comment nor the settings table said any of this. Its neighbour retainSessions does spell out the same split ("hook harnesses always write on Stop"), so the silence on this one reads as "applies everywhere" — a Claude Code user setting retainEveryTurns: 5 gets no effect and no warning. That happens to be the exact workaround #2143's reporter reached for, so the gap was load-bearing rather than cosmetic.

The README row also said "opencode", which undersold it: Kilo and Cline CLI share that runtime.

Docs-only; the page and skill mirror are regenerated from the README through sync-coding-agents-doc.mjs. 433 tests, tsc and lint clean.

It has exactly one consumer, RuntimeCore — the persistent-plugin harnesses
(opencode, Kilo, Cline CLI), which stay loaded and therefore choose when to write
back. The hook harnesses ignore it, and not by oversight: the host decides when
they run, and each Stop is a fresh process with no memory of how many turns have
passed.

Neither the config comment nor the settings table said so. Its neighbour
retainSessions does spell out the same split ("hook harnesses always write on
Stop"), so the silence read as "applies everywhere" — a Claude Code user setting
retainEveryTurns: 5 gets no effect and no warning. That is the workaround #2143's
reporter reached for, so the gap was load-bearing.

The README also said "opencode", which undersold it: Kilo and Cline CLI share
that runtime.
@nicoloboschi
nicoloboschi merged commit 291d2b1 into main Aug 11, 2026
89 checks passed
nicoloboschi added a commit that referenced this pull request Aug 12, 2026
I committed this in #3380 and it has been on main since, in the v0.2.0 and
v0.2.1 tags: a symlink at hindsight-integrations/coding-agents/node_modules
pointing at an absolute path on my own machine. Anyone cloning gets a dangling
link where the package's node_modules belongs.

The published npm tarballs are unaffected — npm excludes node_modules from packs
— so this is repository hygiene, not a shipped defect.

.gitignore had `node_modules/`, which matches directories only. A symlink is a
file, so it slipped straight past — which is exactly how it got committed, since
pointing a scratch worktree at an already-installed node_modules is the fast way
to run this package's tests. Adding the slashless pattern closes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant