Skip to content

harness: sessions cap agent context, delete merged branches - #69

Merged
lneto merged 1 commit into
masterfrom
claude_bump_ceiling
Nov 27, 2026
Merged

lneto merged 1 commit into
masterfrom
claude_bump_ceiling

Conversation

@lneto

@lneto lneto commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

A workflow agent's context grows with no limit while every request sends all of it again, and a session cannot delete a branch that merged, so the delete falls to the maintainer.

const checkout = '/srv/luaebpf'            // a clone of luainkernel/luaebpf, the harness mounted at harness/
const issue = 1234                         // the issue to implement
Workflow({scriptPath: `${checkout}/harness/.agents/skills/implement-issue/implement.js`,
          args: {issue: issue, github: 'luainkernel/luaebpf', effort: 'high',
                 scratch: `${checkout}/scratch/${issue}`, repo: checkout, mount: 'harness',
                 ceiling: 250000}})

A launch of implement-issue or review-pr can now name a ceiling in tokens of context, as above: past it, an agent saves where it is to its checkpoint and pushes its work, and a fresh agent continues from that checkpoint. A session can also delete a merged branch itself, through the harness's tools/delete-branch.sh, once the user's Claude Code settings allow that one command:

$ # /srv/luaebpf is the checkout; token.txt holds a GitHub token that may write the repository's contents
$ jq .permissions.allow ~/.claude/settings.json
[
  "Bash(bash /srv/luaebpf/harness/tools/delete-branch.sh *)"
]
$ bash /srv/luaebpf/harness/tools/delete-branch.sh luainkernel/lunatik claude_tests_inline_code token.txt
delete-branch: no merged pull request of luainkernel/lunatik has claude_tests_inline_code at c883be2aa94b1dc18141c5ed4fd93f5d54464e89 as its head

The script deletes a branch only while its tip is the head a merged pull request had, so it refuses that branch until luainkernel/lunatik#2751, which it heads, merges, and the merged skill now deletes through it.

This pull request moves the mount to c945ed1, which luainkernel/harness#54, luainkernel/harness#56 and luainkernel/harness#58 merged, and wires the ceiling's hook in .claude/settings.json. A launch that names no ceiling runs as before; one that names it pays for each fresh agent reading the checkpoint again.

The mount moves from e373af1 to c945ed1. With luainkernel/harness#54 a
launch of implement-issue or review-pr can name a context ceiling, past
which ceiling-guard.sh, wired here before every tool call, stops the
groomer, the implementer, a fix or the reviewer, and the workflow launches
one in its place that reads its checkpoint. With luainkernel/harness#56
and luainkernel/harness#58 tools/delete-branch.sh deletes a merged branch
under a permissions.allow rule, its push leased on the tip it read, and the
merged skill deletes through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto lneto added the complexity: small One line or one file, with a trivial or existing test label Nov 27, 2026
@lneto

lneto commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Note

This comment was written by an LLM, not a human.

Proof for head 8faabb7.

Before, at the base 17d7004 with the mount at e373af1: .claude/settings.json wires no PreToolUse hook on the matcher *, and the mount carries no ceiling guard, so a workflow agent past the ceiling its prompt names runs every call:

$ git show 17d7004:.claude/settings.json | jq '[.hooks.PreToolUse[] | select(.matcher=="*")] | length'
0
$ git -C harness cat-file -e e373af1:tools/checks/ceiling-guard.sh
fatal: Not a valid object name e373af1:tools/checks/ceiling-guard.sh

After, at this head with the mount at c945ed1: the hook command .claude/settings.json wires on *, run with CLAUDE_PROJECT_DIR at the checkout over the transcripts harness/tools/checks/cases/ceiling-guard.fixture.sh builds: past an agent whose prompt sets a ceiling of 250000 tokens and whose last request carried 260000, under the same ceiling at 100000, unset no ceiling at 400000, and a call of the session's own thread, which carries no agent_id:

$ cmd=$(jq -r '.hooks.PreToolUse[] | select(.matcher=="*") | .hooks[].command' .claude/settings.json); echo "$cmd"
bash "$CLAUDE_PROJECT_DIR/harness/tools/checks/ceiling-guard.sh"
[past, make] exit 2
[past, git push] exit 0
[under, make] exit 0
[unset, make] exit 0
[session, make] exit 0

Still refused: make from past, with ceiling-guard: your context carries 260000 tokens, past the ceiling of 250000 your prompt sets. ... on stderr; its git push runs, so what is done reaches the branch before the agent answers.

Not run: a workflow launched with ceiling, which runs once this head reaches the checkout sessions start in.

@lneto
lneto merged commit 1c03443 into master Nov 27, 2026
2 checks passed
@lneto
lneto deleted the claude_bump_ceiling branch November 27, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: small One line or one file, with a trivial or existing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant