Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/sequenzia/claude-plugins/context-groupsgit clone --depth 1 https://github.com/sequenzia/claude-pluginsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00010 | $0.01741 |
| Opus 5 | $0.00005 | $0.00870 |
| Sonnet 5 | $0.00002 | $0.00348 |
| Haiku 4.5 | $0.00001 | $0.00174 |
Grade A, and why
context-groups scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate context groups from an existing task list, organizing tasks into batches that fit within AI context window limits.
Process
-
Parse arguments
$1= Project name (optional)--max-tokens=N= Maximum context window tokens (default: 100000)--reserve=N= Reserved tokens for agent responses (default: 20000)
-
Locate and read the task file
- If project name provided: Read
tasks/$1.tasks.json - If no project name: Find most recently modified
.tasks.json
- If project name provided: Read
-
Load token configuration
- Read defaults from
skills/spec-task-management/references/context-defaults.json - Apply any command-line overrides
- Read defaults from
-
Calculate token estimates for each task
Use complexity-based estimation:
Complexity Base Tokens XS 500 S 1,500 M 4,000 L 10,000 XL 25,000 Add overhead:
- Base per task: 200 tokens
- Per hard dependency: 100 tokens
-
Build dependency graph
- Create adjacency list from hard dependencies
- Detect any cycles (should already be handled)
- Calculate in-degree for each task
-
Topological sort by execution phase
- Order tasks by their execution_phase first
- Within phase, order by dependency depth (tasks that unblock more come first)
- Break ties by priority (critical > high > medium > low)
-
Bin-pack tasks into context groups
effective_limit = max_tokens - reserve_tokens current_group = new group current_tokens = 0 for each task in sorted_order: # Calculate tokens needed for task + any hard deps not yet assigned task_tokens = estimate_tokens(task) unassigned_dep_tokens = sum(estimate_tokens(d) for d in task.hard_deps if not d.assigned) total_needed = task_tokens + unassigned_dep_tokens # Check if task exceeds effective limit (oversized) if task_tokens > effective_limit: # Close current group if not empty if current_group.tasks.length > 0: mark_group_end(current_group.tasks.last) save_group(current_group) # Create dedicated group for oversized task oversized_group = new group with oversized_warning=true add_task(oversized_group, task) mark_group_start(task) mark_group_end(task) save_group(oversized_group) current_group = new group current_tokens = 0 continue # Check if adding task exceeds limit if current_tokens + total_needed > effective_limit: # Close current group mark_group_end(current_group.tasks.last) save_group(current_group) # Start new group current_group = new group current_tokens = 0 # Add unassigned hard dependencies first (in order) for dep in task.hard_deps: if not dep.assigned: if current_group.tasks.length == 0: mark_group_start(dep) add_task(current_group, dep) current_tokens += estimate_tokens(dep) # Add the task if current_group.tasks.length == 0: mark_group_start(task) add_task(current_group, task) current_tokens += task_tokens # Close final group if current_group.tasks.length > 0: mark_group_end(current_group.tasks.last) save_group(current_group) -
Handle dependency chains exceeding limit
- If a chain of hard dependencies exceeds limit, split at minimum-cut points
- Add
context_handoffmetadata to indicate split - Document which outputs from previous group are needed
-
Update task file
- Add
context_group_idto each task - Set
context_group_starton first task of each group - Set
context_group_endon last task of each group - Add
estimated_tokensto each task - Add
context_groupsarray at root level - Update
metadata.context_configwith configuration used - Set
metadata.total_context_groups
- Add
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 246 lines · 0 tokens per session scan A 7e2c825253d7
context-groups is a command published in the GitHub repository sequenzia/claude-plugins (2 stars, last pushed 7mo ago), licensed MIT. It adds 10 tokens to every session and 1,741 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.