Skip to content

chore(commands): split /prime into lightweight and deep variants#5651

Merged
MarkusNeusinger merged 4 commits into
mainfrom
claude/optimize-list-performance-6J6sh
May 2, 2026
Merged

chore(commands): split /prime into lightweight and deep variants#5651
MarkusNeusinger merged 4 commits into
mainfrom
claude/optimize-list-performance-6J6sh

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

Reduce per-session token overhead from /prime. The previous version pulled in project-guide.md (4,030 words), vision.md, pyproject.toml, and context.md on every invocation — ~7,500 tokens before any work started.

  • /prime (new, ~330 tokens): self-contained — project description, top-level dirs, GitHub pipeline summary, git status. Enough context to start everyday work without loading the full architecture tour.
  • /prime-deep (new): identical to the previous /prime — full architecture, vision, all referenced docs. Use when starting refactors or when deep context is genuinely needed.

CLAUDE.md is auto-loaded by the harness, so neither variant re-includes it.

Token impact

Command Before After
/prime ~7,500 tokens ~330 tokens
/prime-deep (didn't exist) ~7,500 tokens (opt-in)

Test plan

  • Run /prime in a fresh session — confirm git status runs and project basics are clear
  • Run /prime-deep — confirm full project guide loads as before
  • Verify both commands appear in the slash-command list

Generated by Claude Code

Reduce per-session token overhead by making /prime self-contained
(~330 tokens) with project basics, top-level dirs, and the GitHub
pipeline summary. Move the full architecture tour (project-guide.md +
vision.md + pyproject.toml) to /prime-deep for when it's actually
needed.
Copilot AI review requested due to automatic review settings May 2, 2026 20:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Splits the existing /prime slash command into a lightweight, self-contained quick-start (/prime) and a full-context variant (/prime-deep) to reduce per-session token overhead while keeping deep orientation available when needed.

Changes:

  • Replaced /prime with a short orientation (project summary, directory map, minimal git/PR status).
  • Added /prime-deep containing the previous full /prime content (reads + Serena/tooling guidance).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
agentic/commands/prime.md Slims /prime down to minimal, always-useful context and short status commands.
agentic/commands/prime-deep.md Introduces an opt-in deep primer that mirrors the prior /prime behavior and includes referenced docs.

Comment thread agentic/commands/prime.md Outdated
Comment thread agentic/commands/prime-deep.md Outdated
Comment on lines +27 to +48
- Run `check_onboarding_performed`
- Run `list_memories` and read relevant ones

### JetBrains Tools (prefer over brute-force scanning)

Use Serena's JetBrains-backed tools for code navigation — they provide semantic understanding
that grep/glob cannot:

- `jet_brains_get_symbols_overview` — get top-level symbols in a file (classes, functions, variables). Use with `depth: 1` to also see methods of classes. Start here to understand a file before diving deeper.
- `jet_brains_find_symbol` — search for a symbol by name across the codebase. Supports name path patterns like `MyClass/my_method`. Use `include_body: true` to read source code, `include_info: true` for docstrings/signatures.
- `jet_brains_find_referencing_symbols` — find all usages of a symbol (who calls this function? who imports this class?). Essential for understanding impact of changes.
- `jet_brains_find_declaration` — jump to where a symbol is defined.
- `jet_brains_find_implementations` — find implementations of an interface/abstract class.
- `jet_brains_type_hierarchy` — understand class inheritance chains.

### Editing via Serena

For structural edits, prefer Serena's symbol-aware tools over raw text replacement:

- `replace_symbol_body` — replace an entire function/class body
- `insert_after_symbol` / `insert_before_symbol` — add code relative to a symbol
- `search_for_pattern` — regex search across the codebase (fast, flexible)
@MarkusNeusinger
Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

- Activate the project with `mcp__serena__activate_project` if not already active
- Run `mcp__serena__check_onboarding_performed` once per session
- Prefer JetBrains-backed tools for code navigation and edits
- See `/prime-deep` for the full tool catalog
@MarkusNeusinger MarkusNeusinger enabled auto-merge (squash) May 2, 2026 21:16
@MarkusNeusinger
Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits May 2, 2026 21:18
… names

Co-authored-by: MarkusNeusinger <2921697+MarkusNeusinger@users.noreply.github.com>
Co-authored-by: MarkusNeusinger <2921697+MarkusNeusinger@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 2, 2026 21:19
auto-merge was automatically disabled May 2, 2026 21:19

Head branch was pushed to by a user without write access

@MarkusNeusinger MarkusNeusinger review requested due to automatic review settings May 2, 2026 21:19
Copy link
Copy Markdown
Contributor

Copilot AI commented May 2, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 43dafe7f. The conflict in agentic/commands/prime.md was resolved by keeping the lightweight structure (the PR's intent) while also fixing incorrect mcp__serena__jet_brains_* mixed names to the correct canonical mcp__serena__* forms. prime-deep.md was also updated to replace all legacy jet_brains_* names with mcp__serena__* (addressing the open review comment).

Copy link
Copy Markdown
Contributor

Copilot AI commented May 2, 2026

@copilot resolve the merge conflicts in this pull request

The merge conflicts were already resolved in commit 43dafe7f — the branch is fully up to date with main. No further action needed.

@MarkusNeusinger MarkusNeusinger enabled auto-merge (squash) May 2, 2026 21:20
@MarkusNeusinger MarkusNeusinger disabled auto-merge May 2, 2026 21:24
@MarkusNeusinger MarkusNeusinger merged commit 05ca8b8 into main May 2, 2026
5 checks passed
@MarkusNeusinger MarkusNeusinger deleted the claude/optimize-list-performance-6J6sh branch May 2, 2026 21:24
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.

4 participants