Skip to content

Commit 1768e0f

Browse files
barkainclaude
andauthored
Add token-efficient CLI output compression and mandatory multi-agent execution (#35)
## Token Efficiency (CLAUDE_TOKEN_EFFICIENCY=1, default enabled) Two-layer approach to minimize context token consumption: 1. Behavioral guidance (system-prompts/token_efficient_cli.md): Injected via SessionStart hook with mandatory MUST/MUST NOT rules for compact CLI flags (git -sb, ruff --output-format concise --quiet, pytest -q --tb=short, etc). Rules added to all 8 agent definitions and orchestrator template for full subagent coverage. 2. Output compression (hooks/compact_run.py): PreToolUse hook rewrites matching Bash commands through compact_run.py for post-execution output compression. Supports git (push/pull/commit/ fetch/add/merge/rebase/stash), pytest, cargo test, npm/pnpm/yarn/bun test, npx (vitest/jest/mocha/playwright), go test, make test/check, docker/kubectl logs. Cross-platform Python (not bash). ## Mandatory Multi-Agent Execution - Plan mode defaults to team mode when CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 (fallback to subagent only when team_mode_score <= -3) - Minimum 2 subtasks per plan (single-subtask plans prohibited) - Execution section with teammate/agent table added to plan output format - 3 reinforcement points in workflow_orchestrator.md for compliance ## Test Suite (196 tests) - tests/test_compact_run.py: 100 tests for all output compression handlers - tests/test_token_rewrite_hook.py: command matching, metachar detection, env gating - tests/test_inject_token_efficiency.py: injection hook, file reading, JSON output - tests/test_integration.py: end-to-end subprocess execution - pytest.ini and conftest.py with importlib-based module loading - CI workflow enabled with ruff lint + pytest ## Other Changes - Statusline reorganized: row 1 static info, row 2 dynamic metrics - Removed alwaysThinkingEnabled from settings - Windows .exe command normalization in rewrite hook and compact_run - Configurable subprocess timeout (COMPACT_RUN_TIMEOUT, default 120s) - Plugin version bumped to 1.12.0 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 42458b6 commit 1768e0f

38 files changed

Lines changed: 2917 additions & 129 deletions

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "workflow-orchestrator",
99
"source": "./",
1010
"description": "Delegation system with workflow orchestration, specialized agents, and parallel execution for Claude Code",
11-
"version": "1.11.1",
11+
"version": "1.12.0",
1212
"author": {
1313
"name": "Nadav Barkai"
1414
},

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "workflow-orchestrator",
3-
"version": "1.11.1",
3+
"version": "1.12.0",
44
"description": "Delegation system with workflow orchestration, specialized agents, and parallel execution for Claude Code",
55
"author": {
66
"name": "Nadav Barkai"

.github/workflows/ci.yml

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,25 @@ jobs:
2929
with:
3030
fetch-depth: 0
3131

32-
# Tests removed - will reimplement later
33-
# The previous test suite had hardcoded paths and environment issues
34-
# that made it incompatible with CI environments
35-
36-
# - name: Setup test environment
37-
# run: |
38-
# find tests -name "*.sh" -type f -exec chmod +x {} \;
39-
# find hooks -name "*.sh" -type f -exec chmod +x {} \;
40-
# test -f tests/run_integration_tests.sh || exit 1
41-
# mkdir -p .claude/state
42-
43-
# - name: Install uv
44-
# uses: astral-sh/setup-uv@v7
45-
# with:
46-
# enable-cache: true
47-
# if: hashFiles('hooks/PostToolUse/python_posttooluse_hook.sh') != ''
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v7
34+
with:
35+
enable-cache: true
4836

49-
# - name: Install Python 3.12
50-
# run: uv python install 3.12
51-
# if: hashFiles('hooks/PostToolUse/python_posttooluse_hook.sh') != ''
37+
- name: Set up Python 3.12
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: "3.12"
5241

53-
# - name: Run integration tests
54-
# run: |
55-
# bash tests/run_integration_tests.sh --verbose
56-
# env:
57-
# VERBOSE: 1
58-
# CI: true
42+
- name: Setup test environment
43+
run: mkdir -p .claude/state
5944

60-
# - name: Upload test logs
61-
# uses: actions/upload-artifact@v4
62-
# if: always()
63-
# with:
64-
# name: test-logs
65-
# path: |
66-
# tests/test-logs/
67-
# tests/output/
68-
# retention-days: 7
45+
- name: Run linting
46+
run: |
47+
uvx ruff check --no-fix .
48+
uvx ruff format --check .
6949
70-
- name: Placeholder
71-
run: echo "Test suite will be reimplemented with proper CI compatibility"
50+
- name: Run tests
51+
run: uvx pytest tests/ -v --tb=short
52+
env:
53+
CI: true

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.12.0] - 2026-03-14
6+
7+
### Added
8+
- Token-efficient CLI usage: behavioral guidance injection and output compression hook for reduced context consumption
9+
- Mandatory multi-agent execution: all plans now produce 2+ subtasks
10+
- Token efficiency rules enforced across all 8 agent definitions
11+
- `inject_token_efficiency.py` SessionStart hook and `token_rewrite_hook.py` PreToolUse hook
12+
13+
### Changed
14+
- Reorganized statusline layout: static info on row 1, metrics on row 2
15+
- Removed `alwaysThinkingEnabled` from settings
16+
517
## [1.11.1] - 2026-03-10
618

719
### Fixed

CLAUDE.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ uvx ruff format . # Format code (auto-fix)
4646
uvx ruff check --no-fix . # Lint code (check only)
4747
uvx pyright . # Type checking
4848
uvx deadcode hooks/ scripts/ # Dead code detection
49+
uvx pytest tests/ -v # Run test suite
4950
```
5051

5152
The PostToolUse hook enforces a specific ruff rule subset on edited Python files:
5253
```bash
5354
uvx ruff check --select F,E711,E712,UP006,UP007,UP035,UP037,T201,S <file>
5455
```
5556

56-
CI workflow exists (`.github/workflows/ci.yml`) but tests are currently disabled/placeholder.
57+
Test suite exists in `tests/` with comprehensive coverage for hooks and token efficiency features.
5758

5859
---
5960

@@ -105,14 +106,14 @@ User prompt
105106
→ Stop hook: calculate turn duration, quality analysis
106107
```
107108

108-
### Hook System (6 lifecycle events, 12 scripts)
109+
### Hook System (6 lifecycle events, 15 scripts)
109110

110111
| Event | Scripts | Purpose |
111112
|-------|---------|---------|
112-
| **PreToolUse** (`*`) | `require_delegation.py`, `validate_task_graph_compliance.py` | Block non-allowed tools; validate Agent/Task invocations against active task graph |
113+
| **PreToolUse** (`*`, `Bash`) | `require_delegation.py`, `validate_task_graph_compliance.py`, `token_rewrite_hook.py` | Block non-allowed tools; validate Agent/Task invocations against active task graph; rewrite Bash commands for token efficiency |
113114
| **PostToolUse** | `python_posttooluse_hook.py` (Edit/Write/MultiEdit), `remind_skill_continuation.py` (ExitPlanMode\|Skill\|SlashCommand), `validate_task_graph_depth.py` + `remind_todo_after_task.py` (Agent/Task) | Python validation (Ruff, Pyright, security), workflow continuation state (triggers on ExitPlanMode for plan mode flows), depth-3 enforcement, task reminders |
114115
| **UserPromptSubmit** | `clear-delegation-sessions.py` | Clear delegation state, record turn start timestamp, clear team state (`team_mode_active`, `team_config.json`), rotate logs |
115-
| **SessionStart** (`startup\|resume\|clear\|compact`) | `inject_workflow_orchestrator.py`, `inject-output-style.py` | Inject system prompt + output style |
116+
| **SessionStart** (`startup\|resume\|clear\|compact`) | `inject_workflow_orchestrator.py`, `inject-output-style.py`, `inject_token_efficiency.py` | Inject system prompt + output style + token efficiency guidance |
116117
| **SubagentStop** (`*`) | `remind_todo_update.py` (async), `trigger_verification.py` | Remind to update tasks, suggest verification |
117118
| **Stop** | `python_stop_hook.py` | Turn duration, workflow continuation (block stop + inject "continue"), quality analysis |
118119

@@ -165,7 +166,9 @@ All 8 agents include a conditional COMMUNICATION MODE section: when running as a
165166

166167
The framework supports two execution modes, selected at planning time during native plan mode:
167168

168-
**Subagent mode** (default): Current pipeline. Main agent spawns Agent tool instances per wave. Agents return `DONE|{path}`. Context-efficient, optimal for most workflows.
169+
Multi-agent execution is mandatory — all plans produce ≥2 subtasks. Default is team mode when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, otherwise parallel subagents.
170+
171+
**Subagent mode**: Current pipeline. Main agent spawns Agent tool instances per wave. Agents return `DONE|{path}`. Context-efficient, used when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` is not set.
169172

170173
**Team mode** (experimental): Uses Claude Code's Agent Teams feature. Lead agent calls `TeamCreate(team_name=...)`, then spawns teammates via `Agent(team_name=..., subagent_type=..., prompt=...)`. The `team_name` parameter makes Agent invocations teammates (shared context, `SendMessage`) vs isolated subagents. Teammates self-claim tasks, communicate peer-to-peer. Bridge pattern syncs team task completions to framework Tasks API. Teammates use `SendMessage(type: "message")` for point-to-point communication and `SendMessage(type: "broadcast")` for team-wide announcements. Broadcast sends N separate messages (one per teammate) so prefer point-to-point messaging; reserve broadcast for critical announcements only.
171174

@@ -177,7 +180,8 @@ Two team workflow patterns:
177180
- Phase count >8: +2, Tier 3 complexity: +2, cross-phase data flow: +3
178181
- Review-fix cycles: +3, iterative refinement: +2, user keyword "collaborate"/"team": +5
179182
- Breadth task: -5, phase count <=3: -3
180-
- Score >=5 with `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` = team mode
183+
- With `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`: default to team mode; only fall back to subagent when `team_mode_score <= -3` (breadth-only tasks)
184+
- Without env var: always parallel subagent mode (≥2 subtasks mandatory)
181185

182186
**When team mode is active:**
183187
- `validate_task_graph_compliance.py` hook is bypassed (team handles dependencies)
@@ -240,6 +244,21 @@ Agent config format: YAML frontmatter (`name`, `description`, optional `tools`/`
240244
| `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` | `0` | Enable Agent Teams dual-mode (`1` to enable team mode scoring and tools) |
241245
| `CLAUDE_CODE_ENABLE_TASKS` | `true` | Set `false` to revert to TodoWrite |
242246
| `CLAUDE_CODE_TASK_LIST_ID` | Per-session | Share task list across sessions |
247+
| `CLAUDE_TOKEN_EFFICIENCY` | `1` | Enable token-efficient CLI output compression (`0` to disable) |
248+
249+
---
250+
251+
## Token-Efficient CLI Usage
252+
253+
Minimize command output to reduce context consumption. Enabled by default (`CLAUDE_TOKEN_EFFICIENCY=1`).
254+
255+
**Two-layer approach:**
256+
1. **Behavioral guidance** (`system-prompts/token_efficient_cli.md`): Injected via SessionStart, teaches compact flag usage (e.g., `git status -sb`, `pytest -q --tb=short`)
257+
2. **Output compression** (`hooks/compact_run.py`): PreToolUse hook rewrites matching Bash commands through `compact_run.py`, which compresses git/test/log output post-execution
258+
259+
**Supported command families:** git (push/pull/commit/etc), pytest, cargo test, npm/pnpm/yarn/bun test, npx (vitest/jest/mocha/playwright), go test, make test/check, docker/kubectl logs
260+
261+
Disable: `export CLAUDE_TOKEN_EFFICIENCY=0`
243262

244263
---
245264

@@ -274,7 +293,7 @@ export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
274293
The PreToolUse hook blocks all team tools (`TeamCreate`, `SendMessage`, pattern `*team*`/`*teammate*`) unless this env var is set. The hook prints a specific error message indicating the env var is missing.
275294

276295
**Team mode not activating despite keywords:**
277-
Ensure `team_mode_score >= 5`. Simple tasks (<=3 phases) get -3, breadth tasks get -5. Add explicit keywords like "collaborate" or "team" (+5) to trigger team mode. Check `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set -- without it, plan mode always selects `"subagent"` mode regardless of score.
296+
When `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set, team mode is the default. It only falls back to subagent mode when `team_mode_score <= -3` (breadth-only tasks with no complexity factors). Without the env var, plan mode always selects `"subagent"` mode (with ≥2 subtasks mandatory).
278297

279298
**Team state files stale after crash:**
280299
```bash

README.md

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 # Disable async background tasks
227227
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 # Enable Agent Teams dual-mode execution
228228
```
229229

230+
**Token Efficiency:**
231+
```bash
232+
CLAUDE_TOKEN_EFFICIENCY=1 # Enable token-efficient CLI output (default: 1)
233+
```
234+
230235
**Debug & Control:**
231236
```bash
232237
DEBUG_DELEGATION_HOOK=1 # Enable hook debug logging
@@ -245,29 +250,18 @@ See [Environment Variables](./docs/environment-variables.md) for detailed config
245250

246251
The `plugin-hooks.json` configures the delegation enforcement hooks using cross-platform Python scripts:
247252

248-
```json
249-
{
250-
"hooks": {
251-
"PreToolUse": [
252-
{
253-
"matcher": "*",
254-
"hooks": [{"type": "command", "command": "uv run --no-project --script \"${CLAUDE_PLUGIN_ROOT}/hooks/PreToolUse/require_delegation.py\""}]
255-
}
256-
],
257-
"UserPromptSubmit": [
258-
{
259-
"hooks": [{"type": "command", "command": "uv run --no-project --script \"${CLAUDE_PLUGIN_ROOT}/hooks/UserPromptSubmit/clear-delegation-sessions.py\""}]
260-
}
261-
]
262-
}
263-
}
264-
```
265-
266253
**Note:** All hooks use `uv run --no-project --script` for cross-platform compatibility (Windows, macOS, Linux). The `--no-project` flag allows execution without requiring a pyproject.toml, and `--script` directly runs Python scripts using uv's managed interpreter.
267254

268-
**PreToolUse Hook**: Intercepts every tool call and enforces delegation policy
269-
**UserPromptSubmit Hook**: Clears delegation state between user prompts to ensure fresh enforcement
270-
**SessionStart Hook**: Automatically appends workflow_orchestrator system prompt for seamless multi-step workflow detection
255+
**Hook Events (6 lifecycle points, 15 scripts):**
256+
257+
| Event | Scripts | Purpose |
258+
|-------|---------|---------|
259+
| **PreToolUse** | `validate_task_graph_compliance.py`, `require_delegation.py`, `token_rewrite_hook.py` (Bash only) | Validate task graph compliance; block non-delegated tools; rewrite Bash commands for token efficiency |
260+
| **PostToolUse** | `python_posttooluse_hook.py` (Edit/Write), `remind_skill_continuation.py` (ExitPlanMode/Skill/SlashCommand), `validate_task_graph_depth.py` (Agent/Task), `remind_todo_after_task.py` (Agent/Task, async) | Python validation (Ruff/Pyright); workflow continuation state; depth-3 enforcement; task reminders |
261+
| **UserPromptSubmit** | `clear-delegation-sessions.py` | Clear delegation/team state, record turn timestamp |
262+
| **SessionStart** | `inject_workflow_orchestrator.py`, `inject-output-style.py`, `inject_token_efficiency.py` | Inject system prompts (workflow orchestration, output style, token efficiency) |
263+
| **SubagentStop** | `remind_todo_update.py` (async), `trigger_verification.py` | Remind to update tasks, suggest verification |
264+
| **Stop** | `python_stop_hook.py` | Turn duration tracking, workflow continuation |
271265

272266
### workflow_orchestrator Requirements
273267

@@ -505,6 +499,33 @@ Team mode creates two additional state files (automatically cleaned up on comple
505499
| Permissions set at spawn | Teammates inherit lead's permission mode |
506500
| Split panes need tmux/iTerm2 | Not supported in VS Code terminal or Windows Terminal |
507501

502+
## Token-Efficient CLI Usage
503+
504+
The framework minimizes command output to reduce context consumption and preserve tokens for meaningful work. Token efficiency is enabled by default (`CLAUDE_TOKEN_EFFICIENCY=1`).
505+
506+
### Two-Layer Approach
507+
508+
1. **Behavioral Guidance** — The `token_efficient_cli.md` system prompt (injected via SessionStart) teaches compact flag usage:
509+
- `git status -sb` (short branch format)
510+
- `pytest -q --tb=short` (quiet mode, short tracebacks)
511+
- `npm test -- -q` (quiet test output)
512+
- Encourages `--help` parsing and targeted commands
513+
514+
2. **Output Compression** — The `token_rewrite_hook.py` PreToolUse hook rewrites matching Bash commands through `compact_run.py`, which compresses git/test/log output post-execution:
515+
- Git: `push`, `pull`, `commit`, `merge`, `rebase`, `status`, etc.
516+
- Test runners: `pytest`, `cargo test`, `npm/pnpm/yarn/bun test`, `vitest`, `jest`, `mocha`, etc.
517+
- Logs: `docker logs`, `kubectl logs`, `make` output
518+
519+
### Disable Token Efficiency
520+
521+
To temporarily disable token-efficient output:
522+
523+
```bash
524+
export CLAUDE_TOKEN_EFFICIENCY=0
525+
```
526+
527+
This disables both the behavioral guidance and output compression layers.
528+
508529
## Contributing
509530

510531
We welcome contributions to the Claude Code Workflow Orchestration System! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
@@ -563,6 +584,31 @@ Found a bug or have a feature request? Please open a GitHub Issue with:
563584

564585
Always run quality checks locally before submitting to catch issues early.
565586

587+
### Test Suite
588+
589+
The project includes a comprehensive test suite covering hooks, token efficiency, and integration:
590+
591+
```bash
592+
# Run all tests
593+
uv run pytest
594+
595+
# Run with verbose output and coverage
596+
uv run pytest -v --cov=hooks --cov=scripts --cov=system-prompts
597+
598+
# Run specific test file
599+
uv run pytest tests/test_token_rewrite_hook.py -v
600+
601+
# Run tests matching a pattern
602+
uv run pytest -k "token_efficiency" -v
603+
```
604+
605+
Test files:
606+
- `tests/test_token_rewrite_hook.py` - Token rewriting hook tests
607+
- `tests/test_inject_token_efficiency.py` - Token efficiency injection tests
608+
- `tests/test_compact_run.py` - Compact output runner tests
609+
- `tests/test_integration.py` - End-to-end integration tests
610+
- `tests/conftest.py` - Test fixtures and configuration
611+
566612
### We Value
567613

568614
- Clear, well-documented code

agents/code-cleanup-optimizer.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ Explain why changes improve the code. Distinguish critical improvements from nic
5656

5757
---
5858

59+
## CLI Efficiency (MANDATORY)
60+
61+
Use compact CLI flags to minimize output tokens:
62+
- Git: `--quiet` on push/pull/commit, `-sb` on status, `--oneline -n 10` on log, `--stat` on diff
63+
- Tests: `pytest -q --tb=short --no-header`, `npm test -- --silent`
64+
- Ruff: ALWAYS `ruff check --output-format concise --quiet`, NEVER bare `ruff check`
65+
- Files: `ls -1` not `ls -la`, `head -50` not `cat`, `wc -l` before reading
66+
- Search: `rg -l` for file list, `rg -m 5` to cap matches, scope to directories
67+
- Always: `| head -N` when output may exceed 50 lines, `--no-pager` on git
68+
5969
## FILE WRITING
6070

6171
- You HAVE Write tool access for the scratchpad directory ($CLAUDE_SCRATCHPAD_DIR)

agents/code-reviewer.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ Provide specific, actionable feedback explaining the 'why' behind recommendation
5050
- Return EXACTLY: `DONE|{output_file_path}`
5151
- No summaries, no explanations -- only the path
5252

53+
## CLI Efficiency (MANDATORY)
54+
55+
Use compact CLI flags to minimize output tokens:
56+
- Git: `--quiet` on push/pull/commit, `-sb` on status, `--oneline -n 10` on log, `--stat` on diff
57+
- Tests: `pytest -q --tb=short --no-header`, `npm test -- --silent`
58+
- Ruff: ALWAYS `ruff check --output-format concise --quiet`, NEVER bare `ruff check`
59+
- Files: `ls -1` not `ls -la`, `head -50` not `cat`, `wc -l` before reading
60+
- Search: `rg -l` for file list, `rg -m 5` to cap matches, scope to directories
61+
- Always: `| head -N` when output may exceed 50 lines, `--no-pager` on git
62+
5363
## FILE WRITING
5464

5565
- You HAVE Write tool access for the scratchpad directory ($CLAUDE_SCRATCHPAD_DIR)

agents/codebase-context-analyzer.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ Communicate with precision, cite specific files/functions/lines. State explicitl
5252
- Return EXACTLY: `DONE|{output_file_path}`
5353
- No summaries, no explanations -- only the path
5454

55+
## CLI Efficiency (MANDATORY)
56+
57+
Use compact CLI flags to minimize output tokens:
58+
- Git: `--quiet` on push/pull/commit, `-sb` on status, `--oneline -n 10` on log, `--stat` on diff
59+
- Tests: `pytest -q --tb=short --no-header`, `npm test -- --silent`
60+
- Ruff: ALWAYS `ruff check --output-format concise --quiet`, NEVER bare `ruff check`
61+
- Files: `ls -1` not `ls -la`, `head -50` not `cat`, `wc -l` before reading
62+
- Search: `rg -l` for file list, `rg -m 5` to cap matches, scope to directories
63+
- Always: `| head -N` when output may exceed 50 lines, `--no-pager` on git
64+
5565
## FILE WRITING
5666

5767
- You HAVE Write tool access for the scratchpad directory ($CLAUDE_SCRATCHPAD_DIR)

agents/dependency-manager.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ Analyze current state, identify conflicts, provide clear plan with risk assessme
6464
- Return EXACTLY: `DONE|{output_file_path}`
6565
- No summaries, no explanations -- only the path
6666

67+
## CLI Efficiency (MANDATORY)
68+
69+
Use compact CLI flags to minimize output tokens:
70+
- Git: `--quiet` on push/pull/commit, `-sb` on status, `--oneline -n 10` on log, `--stat` on diff
71+
- Tests: `pytest -q --tb=short --no-header`, `npm test -- --silent`
72+
- Ruff: ALWAYS `ruff check --output-format concise --quiet`, NEVER bare `ruff check`
73+
- Files: `ls -1` not `ls -la`, `head -50` not `cat`, `wc -l` before reading
74+
- Search: `rg -l` for file list, `rg -m 5` to cap matches, scope to directories
75+
- Always: `| head -N` when output may exceed 50 lines, `--no-pager` on git
76+
6777
## FILE WRITING
6878

6979
- You HAVE Write tool access for the scratchpad directory ($CLAUDE_SCRATCHPAD_DIR)

0 commit comments

Comments
 (0)