# smart-context — routing rules

When you need to analyze, count, filter, compare, search, parse, transform, or process data:
**write a Bash script** that does the work and logs only the answer. Do NOT read raw files
into context to process mentally. One script replaces ten Read calls and saves 100x context.

## Think in Code

Example: Instead of `Read(src/auth.ts)` to count functions, run:
```
Bash: grep -c "^export function" src/auth.ts
```

Write pure shell or JavaScript — no npm dependencies. Always handle errors. Print only the
result, not the raw data.

## Tool selection

- **Bash** — for `git`, `mkdir`, `rm`, `mv`, short-output commands, and analysis scripts
- **Read** — only for files you intend to **Edit** (Edit needs content in context)
- **Grep** — use `grep -c` or `grep -l` before `grep -n` to avoid large output

## Output constraints

- Keep responses under 500 words.
- Write code, configs, and docs to FILES — never return them as inline text.
- Return only: file path + 1-line description.
