You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fit the connector's per-request steps inside the compaction cut - #890
basecamp-connect now leads with the steps each request needs, and the subagent's instructions move to skills/basecamp-connect/subagent.md. The subagent reads that file itself.
On main the skill is ~13,300 tokens, and the cut falls before the handoff. A compacted orchestrator could acknowledge a request and then never dispatch it.
Running the connector (start and watch, then the request line)
For each request (a. acknowledge, b. choose the repo, c. dispatch)
Then rules, invocation, first-time setup, stopping and checking
Rules, invocation and setup matter at start, when the whole file is in context.
subagent.md is the former "The subagent's instructions" section. It inlines the boost loop it used to reach "as above".
The handoff passes the file's path and tells the subagent to read it in full first. The orchestrator no longer pastes ~4.3k tokens into every dispatch.
Two cross-references now point at subagent.md.
scripts/check-skill-drift.sh stripped everything before a second ---, so a file without frontmatter was skipped whole. It now strips frontmatter only when the file opens with one. make check-skill-drift checks subagent.md too.
internal/release/manifests_test.go requires subagent.md to ship.
Verification
Token counts from API usage (haiku, prompt with the text minus a baseline):
per-request part of the rendered body: 4,474 tokens
whole skill: 9,353 (main: 13,294)
subagent.md: 4,276
internal/connector/skill_layout_test.go:
The per-request steps end within 14,000 characters of the body, about 4,800 tokens at this file's ~2.9 chars/token, and come in order.
The subagent's steps live in subagent.md.
Both tests fail on main's skill.
make check-skill-drift passes: subagent.md has 12 commands and 23 flags validated, and appending a bogus command turns it red. make test-skill-drift, test-sync-skills, and go test ./internal/connector/ ./internal/release/ pass.
golangci-lint on this machine trips on a sibling worktree's file (../basecamp-cli-worktrees/security-ci-main/...), not on this diff.
Alternatives
Trimming prose to fit: the subagent text alone is ~4.3k tokens, so the order had to change anyway.
Keeping the subagent text in SKILL.md after the cut: the orchestrator would still paste it into every handoff and would need it after compaction. A file the subagent reads removes both costs.
Summary by cubic
Fits the basecamp-connect per-request steps within the 5,000-token cut Claude Code re-attaches after compaction. The skill ran ~13,300 tokens, so the cut fell before the handoff and a compacted orchestrator could acknowledge a request but never dispatch it.
Opens with start/watching, the request line, and acknowledge, choose-repo, dispatch; repo choice names ~/.config/basecamp-connect/last.json and its mapping shape. The post-as-the-agent rule joined the per-request part, which still posts a holding reply and a refusal itself and points at step 5 of subagent.md for the reply commands; the restart after a setup change stays before the cut. A connector change an owner asks for mid-run reads SKILL.md in full first, after the acknowledgement, since setup, stopping and checking sit past the cut, using the base directory as fallback if the placeholder reads literally. Rules, invocation, and first-time setup follow, and the skill drops to ~9,353 tokens.
Moves the subagent's instructions to subagent.md; the handoff passes ${CLAUDE_SKILL_DIR}/subagent.md, which Claude Code expands (with the skill's base directory as fallback if it reads literally), and tells the subagent to read it in full, so the orchestrator no longer pastes ~4.3k tokens into every handoff. The quoting rule joined the per-request window, since it sat past the cut while the boost still interpolated the acknowledgement, which would break on values like "I'm on it". The person lookup in subagent.md uses the handed-off account, which a Person id needs.
Adds a layout test holding the per-request steps within 14,000 characters (they end at 13,900, about 4,765 tokens), asserting they come in order, reading the handoff section alone to check it passes subagent.md and the read-it-first instruction, and asserting the '\'' escape in the acknowledgement and in subagent.md; it fails on main.
Fixes scripts/check-skill-drift.sh, which skipped frontmatter-less files whole; it now strips frontmatter only when present, checks subagent.md too, and two new drift-test fixtures cover frontmatter-less files.
Written for commit 479f4cd. Summary will update on new commits.
After a compaction Claude Code re-attaches a skill cut to its first
5,000 tokens. basecamp-connect ran about 13,300 tokens, and the cut fell
before the handoff, so a compacted orchestrator could acknowledge a
request and lose the steps that dispatch it.
The skill now opens with what each request needs: starting and watching
the connector, the request line, and acknowledge, choose the repo, hand
off. The rules, invocation and first-time setup follow it, since they
matter only at start. The subagent's instructions move to subagent.md
beside SKILL.md, and the handoff passes its path for the subagent to
read itself, so the orchestrator no longer carries them or pastes them
into every dispatch. The subagent file inlines the boost loop it used to
reach "as above".
Measured by token usage through the API: the per-request part is 4,474
tokens (the rendered body, without frontmatter), the whole skill 9,353
(from 13,294), subagent.md 4,276. A test holds the per-request steps
within 14,000 characters of the body (about 4,800 tokens at this file's
2.9 characters a token) and checks the subagent file holds its steps;
both fail on main's skill.
The drift check stripped everything before a second "---", so it read
none of a file without frontmatter; it now strips frontmatter only when
the file opens with one, and checks subagent.md (12 commands, 23 flags),
shown red on a bogus command.
The reason will be displayed to describe this comment to others. Learn more.
All reported issues were addressed across 6 files
You’re at about 97% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
Reorganizes the connector skill so essential request handling survives context compaction and delegates work through a standalone subagent guide.
Changes:
Moves per-request orchestration before the compaction cutoff.
Extracts subagent instructions into subagent.md.
Adds drift, layout, and packaging checks.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
File
Description
skills/basecamp-connect/SKILL.md
Reorders orchestration and references the subagent guide.
…fixes
Copilot found the quoting rule now sits past the compaction cut while
the boost still interpolates the acknowledgement, so "I'm on it" would
break the command; and subagent.md never had the rule at all. Section a
and subagent.md now say how to quote a value, with that example. The
per-request part ends at 13,305 characters, inside the 14,000 budget.
cubic and Copilot found the handoff test could pass on the other
mention of subagent.md: it now reads section c alone and asserts the
instruction to read the file first, red with that line removed. Copilot
found the drift fix untested: two fixtures without frontmatter, one with
a later thematic break, both red against main's check-skill-drift.sh.
The reason will be displayed to describe this comment to others. Learn more.
All reported issues were addressed across 4 files (changes from recent commits).
You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
cubic found the test checked only the Shell quoting heading, so the
escape could go and the test still pass. It now asserts the '\'' escape
in the acknowledgement step and in subagent.md, red with the escape
removed from subagent.md.
The reason will be displayed to describe this comment to others. Learn more.
All reported issues were addressed across 1 file (changes from recent commits).
You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
Update AGENTS.md to document the fourth drift-checked file
Makefile:490
This fourth drift input makes the contributor guidance stale: AGENTS.md:84-86 still says make check-skill-drift checks only the three SKILL.md files. Please include skills/basecamp-connect/subagent.md there so the documented CI contract matches this target.
The reason will be displayed to describe this comment to others. Learn more.
All reported issues were addressed across 2 files (changes from recent commits).
You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Retained post-compaction reply paths can write through the default human profile because their explicit agent-profile requirement moved beyond the cut.
Copilot found the rule to post with --profile had moved past the cut
with the other rules, while the per-request part still posts a holding
reply and a refusal itself; it now says so before step a, and the
layout test asserts it. cubic found the full read before an owner's
connector change could delay the acknowledgement; it now comes after.
The per-request part ends at 13,900 characters, 4,765 tokens by API
usage, under the 5,000 kept after a compaction.
One pattern, named so the next round doesn't keep growing it. Five findings in a row have been one class: something a compacted session might need sits past the 5,000-token cut (last.json, the restart after a setup change, setup itself, --profile, connector-exit recovery). The per-request part now holds what every request uses, at 4,765 tokens of 5,000. It can't also hold every rare path. The rare paths are covered by #887's SessionStart hook, which makes the session read the whole SKILL.md after every compaction, and by the one-line rule here to read it before an owner's connector change. I'd decline further findings of this class unless they name a step every request takes.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The owner-control reload lacks the fallback needed when ${CLAUDE_SKILL_DIR} remains literal, and extracted behavior remains outside model-eval coverage.
…s fallback
The per-request part tells the orchestrator to post a refusal and a holding
reply itself, before any subagent starts, but the reply commands now live
only in subagent.md, which it hands on without reading. It now points at
step 5 there. The owner-control reread used `${CLAUDE_SKILL_DIR}` with no
fallback for a client that leaves it literal; it now names the base
directory, as the handoff does.
The layout test pins both, and goes red on the previous text. The wording
around "as the agent" is shorter to stay inside the 14,000-character cut.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
basecamp-connectnow leads with the steps each request needs, and the subagent's instructions move toskills/basecamp-connect/subagent.md. The subagent reads that file itself.Why
Change
subagent.mdis the former "The subagent's instructions" section. It inlines the boost loop it used to reach "as above".subagent.md.scripts/check-skill-drift.shstripped everything before a second---, so a file without frontmatter was skipped whole. It now strips frontmatter only when the file opens with one.make check-skill-driftcheckssubagent.mdtoo.internal/release/manifests_test.gorequiressubagent.mdto ship.Verification
subagent.md: 4,276internal/connector/skill_layout_test.go:subagent.md.make check-skill-driftpasses:subagent.mdhas 12 commands and 23 flags validated, and appending a bogus command turns it red.make test-skill-drift,test-sync-skills, andgo test ./internal/connector/ ./internal/release/pass.golangci-linton this machine trips on a sibling worktree's file (../basecamp-cli-worktrees/security-ci-main/...), not on this diff.Alternatives
Summary by cubic
Fits the
basecamp-connectper-request steps within the 5,000-token cut Claude Code re-attaches after compaction. The skill ran ~13,300 tokens, so the cut fell before the handoff and a compacted orchestrator could acknowledge a request but never dispatch it.~/.config/basecamp-connect/last.jsonand its mapping shape. The post-as-the-agent rule joined the per-request part, which still posts a holding reply and a refusal itself and points at step 5 ofsubagent.mdfor the reply commands; the restart after a setup change stays before the cut. A connector change an owner asks for mid-run readsSKILL.mdin full first, after the acknowledgement, since setup, stopping and checking sit past the cut, using the base directory as fallback if the placeholder reads literally. Rules, invocation, and first-time setup follow, and the skill drops to ~9,353 tokens.subagent.md; the handoff passes${CLAUDE_SKILL_DIR}/subagent.md, which Claude Code expands (with the skill's base directory as fallback if it reads literally), and tells the subagent to read it in full, so the orchestrator no longer pastes ~4.3k tokens into every handoff. The quoting rule joined the per-request window, since it sat past the cut while the boost still interpolated the acknowledgement, which would break on values like "I'm on it". The person lookup insubagent.mduses the handed-off account, which a Person id needs.subagent.mdand the read-it-first instruction, and asserting the'\''escape in the acknowledgement and insubagent.md; it fails on main.scripts/check-skill-drift.sh, which skipped frontmatter-less files whole; it now strips frontmatter only when present, checkssubagent.mdtoo, and two new drift-test fixtures cover frontmatter-less files.Written for commit 479f4cd. Summary will update on new commits.