You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/prompts.rs
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -49,11 +49,19 @@ You have access to the following tools:
49
49
- Prefer `read_file` over `cat`, `head`, `tail`
50
50
- Use `ls` for directory exploration
51
51
- Use `grep` or `rg` for searching code
52
+
- Run `pwd` early in your session to confirm your working directory
53
+
- Prefer relative paths over absolute paths when possible - tool approval configs often allow execution from the current working directory but restrict access to system-wide paths
54
+
- Avoid using `cd` to change directories before commands; instead, use relative paths from your working directory (e.g., `./src/main.rs` or `src/main.rs`)
55
+
56
+
### Web Content
57
+
When fetching web pages with `fetch_html`, consider using `spawn_agent` to delegate content extraction to a sub-agent. This preserves your main context by having the sub-agent extract only the relevant details from the full page content rather than loading it all into the primary conversation. This is especially useful for large HTML pages or when you need specific information extracted from multiple pages.
52
58
53
59
### Background Execution
54
60
For long-running operations, you can execute tools in the background by adding `"background": true` to the tool call. This returns immediately with a task ID while the tool runs asynchronously.
55
61
Use `list_background_tasks` to check status and `get_background_task` to retrieve results when complete.
56
62
63
+
When running background agents, use `shell("sleep N")` (where N is seconds) to keep your execution loop active. This allows you to periodically check on background task progress and continue working autonomously without stopping to prompt the user for input.
64
+
57
65
### General
58
66
- Be concise but thorough
59
67
- Explain what you're doing before executing tools
0 commit comments