effective-tool-use
Skill3 starsChanged 7 months agoMITView on GitHub
Optimal tool selection, parallelism, and safety for coding tasks. Covers the IDE tool preference matrix, parallel vs sequential execution, git safety, sandbox awareness, and file operation hygiene. Use when writing tool calls, running commands, managing files, or performing git operations.
- Reads credentials
- Installs packages
In this repository14 other files it gives its agents.
- architectural-planningSkill
- browser-testingSkill
- codebase-explorationSkill
- code-reviewSkill
- code-verificationSkill
- context-summarizationSkill
- disciplined-codingSkill
- knowledge-managementSkill
- prompt-engineeringSkill
- safe-autonomous-modeSkill
- security-reviewSkill
- session-handoffSkill
- systematic-debuggingSkill
- task-orchestrationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. About 0 are common, 20 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Always use the dedicated tool instead of its shell equivalent:
- Distinctive: line 36
When research spans >5 files, spawn a subagent via the Agent tool to research in an isolated context and return a summary.
- Distinctive: line 40
Read files before editing them.
- Distinctive: line 41
Write tool requires a prior Read of the target file.
- Distinctive: line 43
When you already know which section you need (from a Grep match with line numbers), read just that range.
- Distinctive: line 44
Prefer Edit over Write for modifying existing files — Edit sends only the diff.
- Distinctive: line 45
Never create documentation files (*.md) or READMEs unless the user explicitly asks.
- Distinctive: line 50
Use when operations are independent and can run simultaneously:
- Distinctive: line 57
Use when operations depend on each other:
- Distinctive: line 63
Use only when you need sequential execution but don't care if earlier commands fail:
- Distinctive: line 67
Never use newlines to separate commands in a single Bash call (newlines OK inside quoted strings).
- Very specific: line 68
Don't use & to background processes — use the run_in_background parameter instead.
- Very specific: line 69
Don't sleep between commands that can run immediately.
- Distinctive: line 70
Don't retry failing commands in a sleep loop.
- Very specific: line 74
Before creating new directories or files, run ls to verify the parent directory exists and is the correct location.
- Distinctive: line 75
Always quote file paths containing spaces with double quotes.
- Distinctive: line 77
When checking if a file/resource exists before operating on it, prefer operating directly and handling the error (avoids TOCTOU race …
- Very specific: line 95
Never use interactive flags (-i) like git rebase -i or git add -i — they require terminal input that isn't supported.
- Distinctive: line 96
Never update the git config.
- Distinctive: line 97
If CI is configured for the project, check pipeline status after pushing.
- Distinctive: line 101
When running in a sandboxed environment:
- Very specific: line 102
Use $TMPDIR for temporary files, NOT /tmp directly.
- Distinctive: line 103
If a command fails with "Operation not permitted" or access denied errors, the sandbox may be restricting it.
- Distinctive: line 104
Default to running commands within the sandbox.
- Very specific: line 105
Don't suggest adding sensitive paths (~/.bashrc, ~/.zshrc, ~/.ssh/*, credential files) to the sandbox allowlist.
- Very specific: line 110
Use run_in_background for commands you don't need results from immediately.
- Distinctive: line 111
Don't sleep as a first action.
- Very specific: line 119
When building constrained tool flows for specialized tasks, apply prompt-engineering patterns.
- Very specific: line 123
If user-config.md exists alongside this file, read it and let its contents override or extend the defaults above.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Effective Tool Use
CRITICAL: Prefer dedicated IDE tools over shell equivalents. They provide better user experience, clearer diffs, and easier permission review.
Tool Preference Matrix
Always use the dedicated tool instead of its shell equivalent:
| Task | Use This | NOT This |
| Find files by pattern | Glob | find, ls -R |
| Search file contents | Grep | grep, rg, ag |
| Read a file | Read | cat, head, tail |
| Edit an existing file | Edit | sed, awk, inline scripts |
| Create / overwrite a file | Write | echo >, cat <<EOF >, tee |
| Communicate with the user | Direct text output | echo, printf |
Reserve the shell (Bash) tool for actual system commands: git, npm, docker, make, curl, test runners, build tools, and other CLI operations that have no dedicated tool equivalent.
Token Cost Hierarchy
Tools differ drastically in token cost. Always narrow before you read:
- Glob (near-zero tokens) — Returns file paths only. Start here to map the landscape.
- Grep with
-C 3(lightweight) — Returns matched lines plus context. Usehead_limitto cap results for common terms. Often sufficient without a full file read. - Read (heavy, 500-5000+ tokens) — Full file content. Use ONLY after Glob/Grep confirmed the file is relevant.
For meaning-based queries ("how does authentication work"), check if MCP tools like search_code are available before falling back to broad Grep with keywords and synonyms.
When research spans >5 files, spawn a subagent via the Agent tool to research in an isolated context and return a summary. This prevents context exhaustion in the main session.
Reading Files
- Read files before editing them. An edit to unread code is a guess, not a fix.
- Write tool requires a prior Read of the target file. It will fail otherwise.
- For large files, use offset/limit to read only the relevant section. Don't load 2000 lines when you need 20.
- When you already know which section you need (from a Grep match with line numbers), read just that range.
- Prefer Edit over Write for modifying existing files — Edit sends only the diff. Use Write for new files or complete rewrites.
- Never create documentation files (*.md) or READMEs unless the user explicitly asks.
Parallel vs Sequential Execution
Parallel (separate tool calls in one message)
Use when operations are independent and can run simultaneously:
- Multiple Grep searches for different patterns
git statusandgit diffat the same time- Reading multiple unrelated files
- Independent test runs across different modules
Sequential (&& chaining in a single Bash call)
Use when operations depend on each other:
mkdir -p dir && cp file dir/— directory must exist before copygit add file && git commit— file must be staged before commitnpm install && npm build— deps before build
Fire-and-forget (; chaining)
Use only when you need sequential execution but don't care if earlier commands fail:
rm -f old.log ; echo "cleaned"— proceed regardless
Rules
- Never use newlines to separate commands in a single Bash call (newlines OK inside quoted strings).
- Don't use
&to background processes — use therun_in_backgroundparameter instead. - Don't sleep between commands that can run immediately. If you need to wait for a background task you started with
run_in_background, you'll be notified when it completes — don't poll. - Don't retry failing commands in a sleep loop. Diagnose the root cause.
File Operations
- Before creating new directories or files, run
lsto verify the parent directory exists and is the correct location. - Always quote file paths containing spaces with double quotes.
- Maintain your working directory — use absolute paths and avoid
cdunless the user requests it. - When checking if a file/resource exists before operating on it, prefer operating directly and handling the error (avoids TOCTOU race conditions).
Git Safety
- Prefer new commits over amending. After pre-commit hook failure, the commit did NOT happen —
--amendwould modify the PREVIOUS commit and risk destroying work. - Never skip hooks (
--no-verify,--no-gpg-sign) unless the user explicitly asks. If a hook fails, investigate and fix the underlying issue. - Never force-push to main/master. Warn the user if they request it.
- Never run destructive commands (
reset --hard,checkout .,clean -f,branch -D) unless the user explicitly requests them. - Stage specific files by name rather than
git add -Aorgit add ., which can accidentally include secrets or binaries. - HEREDOC for commit messages to preserve formatting:
git commit -m "$(cat <<'EOF'
Commit message here.
EOF
)"- Never use interactive flags (
-i) likegit rebase -iorgit add -i— they require terminal input that isn't supported. - Never update the git config.
- If CI is configured for the project, check pipeline status after pushing. A green local build with a red CI pipeline is not "done."
Sandbox Awareness
When running in a sandboxed environment:
- Use
$TMPDIRfor temporary files, NOT/tmpdirectly. The sandbox sets$TMPDIRto the correct writable directory. - If a command fails with "Operation not permitted" or access denied errors, the sandbox may be restricting it. Check the sandbox configuration before retrying.
- Default to running commands within the sandbox. Only disable sandboxing when you see clear evidence of sandbox-caused failure (not general command failures).
- Don't suggest adding sensitive paths (~/.bashrc, ~/.zshrc, ~/.ssh/*, credential files) to the sandbox allowlist.
Command Timeouts and Background Tasks
- Commands have a default timeout. For long-running operations (builds, large test suites), set an appropriate timeout.
- Use
run_in_backgroundfor commands you don't need results from immediately. You'll be notified when they complete — no polling needed. - Don't sleep as a first action. If waiting for rate limiting or deliberate pacing, keep it under 2 seconds.
CRITICAL REMINDER: Use dedicated IDE tools over shell equivalents. Narrow searches with Glob/Grep before reading full files. Read before editing. Never skip git hooks or force-push without explicit user consent.
Related Skills
- For search-heavy workflows, apply
codebase-explorationpatterns for systematic investigation. - Git commit and PR creation workflows interact with
disciplined-codingscope and verification standards. - When building constrained tool flows for specialized tasks, apply
prompt-engineeringpatterns.
Project Customization
If user-config.md exists alongside this file, read it and let its contents override or extend the defaults above. Common customizations:
- Project-specific shell commands and aliases
- Custom sandbox allowlist paths
- Git workflow conventions (branch naming, commit message format)
- Preferred package manager and build commands
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

