Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(cc)!: wave A — project scope default, lazy heartbeat, terse surface - #108

#108
Merged
github-actions[bot] merged 1 commit into
mainanipotts/claude-code-tips:mainfrom
feat/cc-wave-a-scope-lazy-trimanipotts/claude-code-tips:feat/cc-wave-a-scope-lazy-trimCopy head branch name to clipboard
May 7, 2026
Merged

feat(cc)!: wave A — project scope default, lazy heartbeat, terse surface#108
github-actions[bot] merged 1 commit into
mainanipotts/claude-code-tips:mainfrom
feat/cc-wave-a-scope-lazy-trimanipotts/claude-code-tips:feat/cc-wave-a-scope-lazy-trimCopy head branch name to clipboard

Conversation

@anipotts

@anipotts anipotts commented May 7, 2026

Copy link
Copy Markdown
Owner

Summary

Three orthogonal simplifications that every cc session benefits from on every turn. Closes #74, addresses #68 morally, removes the 30s heartbeat thread.

Changes

1. Per-project scope default (resolves #74)

cc(action='sessions') and cc(action='check') default to scope='project': peers in the same git project_root as the caller. Opt-in scope='global' restores v3 behavior. Non-git cwds fall back to global automatically. On a machine running 5 claudes across 3 repos, this drops the listed peer count to the ones that can plausibly collide with you.

2. Lazy heartbeat (drops the 30s timer)

  • 30s setInterval deleted from lifecycle
  • last_seen + git context refresh now: (a) every action call, (b) every transcript-tail readDelta via a new onActivity callback
  • Git context refresh rate-limited to 60s TTL — busy edit bursts don't fork git rev-parse per line
  • Net: one fewer thread, no behavior change for active sessions, silent sessions correctly stale after STALE_SESSION_AFTER_MS. Transcript activity is the natural liveness signal.

3. Terse model-facing surface (addresses #68)

  • TOOL_DESCRIPTION: 570 → 276 chars
  • SERVER_INSTRUCTIONS: 700 → 312 chars
  • Routing/identity/overlap detail moves to SKILL.md (already the skill-triage entrypoint)
  • Security guards (prompt-injection + exfil) stay — load-bearing for every call
  • Test threshold lowered to 512B

Cumulative per-session system prompt savings: ~700 chars × every cc session × every turn. Material for Haiku tier; rounding error for Opus 1M. Honest about the asymmetry.

Test plan

  • bun test tests/ — 36 pass (was 35, added test refactor)
  • CLAUDE_CODE_SESSION_ID=... bun run smoke — server boots, instructions block correct length
  • tools/list returns oneOf schema with scope on sessions + check only
  • bunx tsc --noEmit — clean (pre-existing schema.sql warning unrelated)

Breaking?

! per conventional commits — cc(action='sessions') and cc(action='check') now scope to project by default. Existing callers wanting the old behavior pass scope: 'global'. Schema bytes change once (one prompt-cache invalidation), then byte-stable forever.

🤖 Generated with Claude Code

Three orthogonal simplifications that every cc session benefits from on
every turn. Closes #74 (per-project scope), addresses #68 (model-aware
context surface), and removes the 30s heartbeat thread.

1. Per-project scope default (#74)
   `cc(action='sessions')` and `cc(action='check')` default to scope='project':
   peers in the same git project_root as the caller. Opt-in scope='global'
   restores the v3 behavior. Non-git cwds fall back to global automatically.
   On a machine running multiple claudes across multiple repos, this drops
   the listed peer count to the ones that can plausibly collide with you.

2. Lazy heartbeat
   Drops the 30s setInterval. last_seen + git context now refresh on every
   action call AND on every transcript-tail readDelta. A new onActivity
   callback wires the two: transcript activity is the natural liveness
   signal for sessions that aren't calling cc actions. Git context refresh
   is rate-limited to 60s so a busy edit burst doesn't fork `git rev-parse`
   per line. Net: one fewer thread, no behavior change for active sessions,
   silent sessions correctly stale after STALE_SESSION_AFTER_MS.

3. Terse model-facing surface
   TOOL_DESCRIPTION trimmed 570 → 276 chars. SERVER_INSTRUCTIONS trimmed
   700 → 312 chars. Routing/identity/overlap detail moves to SKILL.md
   where the skill-triage model already reads it. Security guards
   (prompt-injection defense + exfil refusal) stay in instructions, since
   they're load-bearing for every call. Test threshold lowered to 512B.

Cumulative per-session system prompt savings: ~700 chars × every cc
session × every turn. Material for haiku tier; rounding error for opus
1M. Honest about the asymmetry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

@claude @codex please review this pr per .github/AI_REVIEW_RUBRIC.md.

lanes:

  • claude: prose, voice, api/contract shape, skill + hook + plugin surface correctness, tests for the public path.
  • codex: bugs, security, type/shell correctness, dependency hygiene, ci config.

output one pr comment each in the exact shape from the rubric. if an app is not installed on this repo, the mention sits unanswered and ci stays green.

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

quality gate: all checks passed

  • PR description -- present
  • version stamps -- no doc files changed
  • hook conventions -- no shell scripts changed

automated check -- see CLAUDE.md for conventions.

@github-actions
github-actions Bot merged commit 827f221 into main May 7, 2026
11 of 13 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@anipotts
anipotts deleted the feat/cc-wave-a-scope-lazy-trim branch May 7, 2026 22:10
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.

[cc] per-project mesh — scope sessions list to same project_root by default

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.