token-efficient-workflow

Reduces token and context consumption through scoped searches, selective file reading, and filtered outputs.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/AliJ021/labelmod-core --skill token-efficient-workflow-alij021
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-efficient-workflow
Source: https://github.com/AliJ021/labelmod-core/tree/main/.claude/skills/token-efficient-workflow
Command: npx skills add https://github.com/AliJ021/labelmod-core --skill token-efficient-workflow-alij021

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Long-running coding sessions waste context window and tokens on full repository scans, repeated file reads, and unfiltered test or log output. This Skill enforces a discipline for working in the Label Mod Core repository that keeps context lean without compromising financial correctness, security, or test rigor. ## Core Features & Use Cases - Scope-First Discipline: Define the change scope in one to three sentences and ask a clarifying question instead of scanning the repo when the scope is ambiguous. - Targeted Search and Reading: Use rg on exact names, git ls-files for listings, line-range reads with sed, and \sf for current SQL function definitions instead of reading whole directories or migration chains. - Output Filtering and Test Strategy: Pipe long logs and test output to files and read only failure lines; run targeted tests first and reserve the full ops/db.sh test and pnpm check suites for the end of the task. - Model and Session Management: Suggests appropriate model and effort levels per task type, and recommends /compact or a new chat for long or off-topic sessions without acting unilaterally. - Use Case: When fixing a costing bug in the sales module, search for the exact function with rg, read only the relevant line ranges, run only db/test/costing.sql first, and run the full suite once at the end. ## Quick Start Ask the assistant to fix a bug in one specific module while following the token-efficient workflow discipline of scoped search, selective reading, and filtered test output.

Frequently Asked Questions about token-efficient-workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce token usage when working in a large code repository?

Define the task scope in one to three sentences first, then search with ripgrep on exact function or column names instead of reading whole directories. Read large files by line range and never re-read files already seen in the same session.

How to search a codebase efficiently with ripgrep instead of reading everything?

Start with rg -l to find candidate files by exact name, then use rg -n with minimal context to see matching lines. Use git ls-files for directory listings and git diff --stat before inspecting individual changed files.

How should I handle long test or log output without filling the context window?

Redirect output to a file and read only a summary, for example tail -30 or grep for FAIL and ERROR lines. Never paste raw bulk output into reports; state only the finding.

When should I run the full test suite versus targeted tests?

Run the test tied to your change first, such as a single SQL test file, and keep the full ops/db.sh test and pnpm check runs for the end of the task. The full suite must still pass before declaring the work done.

Does this workflow compromise testing or financial correctness to save tokens?

No. The skill explicitly states that CLAUDE.md, ADRs, and repository rules take priority, and where cheapness conflicts with financial correctness, correctness wins. It only makes the path cheaper, never the standards.

Can the assistant switch models or spawn subagents on its own to save effort?

No. Model changes are the user's decision, and expensive options like agent teams, loops, or subagents require explicit user permission with a stated reason and cost first.