Skip to content

Instantly share code, notes, and snippets.

@1337hero
Created December 24, 2025 08:04
Show Gist options
  • Select an option

  • Save 1337hero/3fc50ca6e2080d246140afcc8f483997 to your computer and use it in GitHub Desktop.

Select an option

Save 1337hero/3fc50ca6e2080d246140afcc8f483997 to your computer and use it in GitHub Desktop.
{"messages": [{"role": "user", "content": "Read the contents of src/components/Button.tsx"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "read", "arguments": "{\"filePath\": \"/project/src/components/Button.tsx\"}"}}]}]}
{"messages": [{"role": "user", "content": "Find all TypeScript files in the src directory"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "glob", "arguments": "{\"pattern\": \"src/**/*.ts\"}"}}]}]}
{"messages": [{"role": "user", "content": "Search for usages of useState in the codebase"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "grep", "arguments": "{\"pattern\": \"useState\", \"include\": \"*.tsx\"}"}}]}]}
{"messages": [{"role": "user", "content": "Run the test suite"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "bash", "arguments": "{\"command\": \"npm test\", \"description\": \"Run test suite\"}"}}]}]}
{"messages": [{"role": "user", "content": "Install lodash as a dependency"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "bash", "arguments": "{\"command\": \"npm install lodash\", \"description\": \"Install lodash package\"}"}}]}]}
{"messages": [{"role": "user", "content": "Review this bash tool call:\n\n```json\n{\"command\": \"cat src/index.ts\"}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. Missing required `description` parameter\n2. Using `cat` instead of the Read tool - prefer dedicated tools over bash equivalents\n\n**Fixed approach:**\nUse the Read tool instead:\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/src/index.ts\"}}\n```\n\nOr if bash is truly needed:\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"cat src/index.ts\", \"description\": \"Read index.ts contents\"}}\n```"}]}
{"messages": [{"role": "user", "content": "Review this tool call:\n\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"cd /project && npm install\", \"description\": \"Install dependencies\"}}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. Using `cd` command chain instead of `workdir` parameter\n2. Unnecessarily changing directory when workdir parameter exists\n\n**Fixed:**\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"npm install\", \"workdir\": \"/project\", \"description\": \"Install dependencies\"}}\n```\n\nOr use absolute paths:\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"npm install --prefix /project\", \"description\": \"Install dependencies\"}}\n```"}]}
{"messages": [{"role": "user", "content": "Review this tool call:\n\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"find . -name '*.ts'\", \"description\": \"Find TypeScript files\"}}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. Using `find` command instead of the dedicated Glob tool\n2. Glob tool is faster and optimized for file pattern matching\n\n**Fixed:**\n```json\n{\"name\": \"glob\", \"arguments\": {\"pattern\": \"**/*.ts\"}}\n```\n\nThe Glob tool:\n- Works with any codebase size\n- Returns files sorted by modification time\n- Supports standard glob patterns like `**/*.ts` or `src/**/*.tsx`"}]}
{"messages": [{"role": "user", "content": "Review this tool call:\n\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"grep -r 'function' src/\", \"description\": \"Search for functions\"}}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. Using bash `grep` instead of the dedicated Grep tool\n2. The Grep tool is optimized for content search with regex support\n\n**Fixed:**\n```json\n{\"name\": \"grep\", \"arguments\": {\"pattern\": \"function\", \"include\": \"src/**/*\"}}\n```\n\nThe Grep tool:\n- Fast content search that works with any codebase size\n- Supports full regex syntax (e.g., `function\\s+\\w+`)\n- Returns file paths and line numbers sorted by modification time\n- Filter by file pattern with `include` parameter"}]}
{"messages": [{"role": "user", "content": "I need to create a new file at src/utils/helpers.ts with some utility functions"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "write", "arguments": "{\"filePath\": \"/project/src/utils/helpers.ts\", \"content\": \"// Utility functions\\n\\nexport function formatDate(date: Date): string {\\n return date.toISOString().split('T')[0]\\n}\\n\\nexport function capitalize(str: string): string {\\n return str.charAt(0).toUpperCase() + str.slice(1)\\n}\\n\"}"}}]}]}
{"messages": [{"role": "user", "content": "Review this edit tool call:\n\n```json\n{\"name\": \"edit\", \"arguments\": {\"filePath\": \"src/App.tsx\", \"oldString\": \"const App\", \"newString\": \"const MyApp\"}}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. `filePath` should be an absolute path, not relative\n2. `oldString` is too short - may match multiple occurrences\n3. Must read the file first before editing\n\n**Correct workflow:**\n1. First, read the file:\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/src/App.tsx\"}}\n```\n\n2. Then edit with more context:\n```json\n{\"name\": \"edit\", \"arguments\": {\"filePath\": \"/project/src/App.tsx\", \"oldString\": \"const App = () => {\", \"newString\": \"const MyApp = () => {\"}}\n```\n\nOr use `replaceAll` if renaming everywhere:\n```json\n{\"name\": \"edit\", \"arguments\": {\"filePath\": \"/project/src/App.tsx\", \"oldString\": \"App\", \"newString\": \"MyApp\", \"replaceAll\": true}}\n```"}]}
{"messages": [{"role": "user", "content": "How do I run multiple independent commands efficiently?"}, {"role": "assistant", "content": "For independent commands, make multiple parallel tool calls in a single message:\n\n```json\n[\n {\"name\": \"bash\", \"arguments\": {\"command\": \"git status\", \"description\": \"Show git status\"}},\n {\"name\": \"bash\", \"arguments\": {\"command\": \"git diff\", \"description\": \"Show unstaged changes\"}},\n {\"name\": \"bash\", \"arguments\": {\"command\": \"git log -5 --oneline\", \"description\": \"Show recent commits\"}}\n]\n```\n\nFor dependent commands that must run sequentially, chain them:\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"git add . && git commit -m 'fix: resolve issue' && git push\", \"description\": \"Stage, commit, and push changes\"}}\n```\n\nUse `&&` for sequential commands where later commands depend on earlier ones succeeding."}]}
{"messages": [{"role": "user", "content": "When should I use the Read tool vs the Bash tool with cat?"}, {"role": "assistant", "content": "**Always prefer the Read tool over bash cat/head/tail.**\n\n**Read tool advantages:**\n- Provides line numbers in output (cat -n format)\n- Handles pagination with `offset` and `limit` parameters\n- Automatically truncates long lines (2000 char max)\n- Can read images and PDFs\n- Blocks access to .env files for security\n- Suggests similar files if path not found\n\n**Use Read:**\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/src/index.ts\"}}\n```\n\n**For large files:**\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/large-file.log\", \"offset\": 1000, \"limit\": 100}}\n```\n\n**Only use bash for:**\n- Actual shell operations (git, npm, build commands)\n- Commands that need shell features (pipes, redirects)\n- When you need specific command output format"}]}
{"messages": [{"role": "user", "content": "When should I use Glob vs Grep?"}, {"role": "assistant", "content": "**Glob** - Find files by name/path pattern:\n```json\n{\"name\": \"glob\", \"arguments\": {\"pattern\": \"src/**/*.tsx\"}}\n```\nUse when: \"Find all React components\", \"List TypeScript files\", \"Find config files\"\n\n**Grep** - Search file contents:\n```json\n{\"name\": \"grep\", \"arguments\": {\"pattern\": \"useState\", \"include\": \"*.tsx\"}}\n```\nUse when: \"Find usages of useState\", \"Search for TODO comments\", \"Find function definitions\"\n\n**Combined workflow:**\n1. Glob to find relevant files\n2. Grep to search within those files\n3. Read to examine specific matches\n\n**Example - find components using a hook:**\n```json\n{\"name\": \"grep\", \"arguments\": {\"pattern\": \"useCustomHook\", \"include\": \"src/components/**/*.tsx\"}}\n```"}]}
{"messages": [{"role": "user", "content": "Review this tool usage for creating a git commit:\n\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"git add . && git commit -m 'update'\", \"description\": \"Commit all changes\"}}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. Using `git add .` may stage unintended files\n2. Commit message 'update' is too vague\n3. Should check git status first to understand what's being committed\n4. Missing analysis of changes before committing\n\n**Correct workflow:**\n\n1. First, check status and diff in parallel:\n```json\n[\n {\"name\": \"bash\", \"arguments\": {\"command\": \"git status\", \"description\": \"Show working tree status\"}},\n {\"name\": \"bash\", \"arguments\": {\"command\": \"git diff\", \"description\": \"Show unstaged changes\"}},\n {\"name\": \"bash\", \"arguments\": {\"command\": \"git log -3 --oneline\", \"description\": \"Show recent commits\"}}\n]\n```\n\n2. Stage specific files:\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"git add src/components/Button.tsx src/styles/button.css\", \"description\": \"Stage button component files\"}}\n```\n\n3. Commit with descriptive message:\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"git commit -m 'feat: add hover state to Button component'\", \"description\": \"Commit button changes\"}}\n```"}]}
{"messages": [{"role": "user", "content": "How do I handle files with spaces in the path?"}, {"role": "assistant", "content": "**Always quote paths containing spaces with double quotes.**\n\n**Bash tool:**\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"mkdir \\\"/Users/name/My Documents/project\\\"\", \"description\": \"Create directory with spaces\"}}\n```\n\n**Read tool:**\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/Users/name/My Documents/file.txt\"}}\n```\n\n**Edit tool:**\n```json\n{\"name\": \"edit\", \"arguments\": {\"filePath\": \"/Users/name/My Documents/file.txt\", \"oldString\": \"old\", \"newString\": \"new\"}}\n```\n\n**Common mistakes:**\n```bash\n# Wrong - will fail\nmkdir /Users/name/My Documents\npython /path/with spaces/script.py\n\n# Correct\nmkdir \"/Users/name/My Documents\"\npython \"/path/with spaces/script.py\"\n```"}]}
{"messages": [{"role": "user", "content": "Review this tool call for reading a large file:\n\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/logs/app.log\"}}\n```"}, {"role": "assistant", "content": "**Potential issues:**\n1. Log files can be very large (default limit is 2000 lines)\n2. May want to read the end of the file, not the beginning\n3. Output lines over 2000 characters will be truncated\n\n**Better approaches:**\n\nRead the last 100 lines:\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"wc -l /project/logs/app.log\", \"description\": \"Count log file lines\"}}\n```\nThen read from near the end:\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/logs/app.log\", \"offset\": 9900, \"limit\": 100}}\n```\n\nOr search for specific errors:\n```json\n{\"name\": \"grep\", \"arguments\": {\"pattern\": \"ERROR|FATAL\", \"include\": \"logs/*.log\"}}\n```\n\nFor real-time logs, use bash:\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"tail -100 /project/logs/app.log\", \"description\": \"Show last 100 log lines\"}}\n```"}]}
{"messages": [{"role": "user", "content": "What's the correct way to edit a file I haven't read yet?"}, {"role": "assistant", "content": "**You MUST read a file before editing it.** The Edit tool will fail if you haven't read the file first in the conversation.\n\n**Correct workflow:**\n\n1. Read the file first:\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/src/utils.ts\"}}\n```\n\n2. Then edit with exact string matching:\n```json\n{\"name\": \"edit\", \"arguments\": {\"filePath\": \"/project/src/utils.ts\", \"oldString\": \"export function oldName(\", \"newString\": \"export function newName(\"}}\n```\n\n**Why this requirement exists:**\n- Ensures you understand the current file state\n- Prevents editing based on outdated assumptions\n- Helps provide enough context for unique string matching\n\n**Tips:**\n- Copy the exact text from Read output (preserving indentation)\n- Include enough surrounding context for unique matches\n- Use `replaceAll: true` for renaming across the file"}]}
{"messages": [{"role": "user", "content": "How should I handle a command that might take a long time?"}, {"role": "assistant", "content": "**Use the `timeout` parameter to prevent hanging:**\n\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"npm run build\", \"timeout\": 300000, \"description\": \"Build project (5 min timeout)\"}}\n```\n\n**Default behavior:**\n- Commands timeout after 120000ms (2 minutes)\n- Maximum timeout is 600000ms (10 minutes)\n- Output is truncated at 30000 characters\n\n**For long-running processes:**\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"npm run build 2>&1 | head -500\", \"timeout\": 300000, \"description\": \"Build with limited output\"}}\n```\n\n**For tests that may hang:**\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"timeout 60 npm test\", \"description\": \"Run tests with 60s limit\"}}\n```\n\n**Watch for:**\n- Build processes\n- Test suites\n- Database migrations\n- Large file operations"}]}
{"messages": [{"role": "user", "content": "Review this approach to searching for a function definition:\n\n```json\n{\"name\": \"grep\", \"arguments\": {\"pattern\": \"handleSubmit\"}}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. Will match all usages, not just the definition\n2. No file filter - searches entire codebase\n3. May return too many results\n\n**Better approaches:**\n\nFind function definition specifically:\n```json\n{\"name\": \"grep\", \"arguments\": {\"pattern\": \"(function|const|let|var)\\\\s+handleSubmit\", \"include\": \"*.{ts,tsx,js,jsx}\"}}\n```\n\nOr for arrow functions:\n```json\n{\"name\": \"grep\", \"arguments\": {\"pattern\": \"handleSubmit\\\\s*[=:]\", \"include\": \"src/**/*.tsx\"}}\n```\n\nFor class methods:\n```json\n{\"name\": \"grep\", \"arguments\": {\"pattern\": \"handleSubmit\\\\s*\\\\(\", \"include\": \"*.ts\"}}\n```\n\n**Pro tip:** After finding the file, use Read to see the full context:\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/src/components/Form.tsx\"}}\n```"}]}
{"messages": [{"role": "user", "content": "When should I use Write vs Edit?"}, {"role": "assistant", "content": "**Edit** - Modify existing files with surgical precision:\n```json\n{\"name\": \"edit\", \"arguments\": {\"filePath\": \"/project/src/App.tsx\", \"oldString\": \"const count = 0\", \"newString\": \"const count = 10\"}}\n```\nUse when:\n- Changing specific parts of a file\n- Renaming variables/functions\n- Fixing bugs in existing code\n- Adding/removing lines in context\n\n**Write** - Create new files or completely replace contents:\n```json\n{\"name\": \"write\", \"arguments\": {\"filePath\": \"/project/src/newFile.ts\", \"content\": \"// New file content\"}}\n```\nUse when:\n- Creating new files\n- Complete file rewrites\n- Generating boilerplate\n\n**Important rules:**\n- ALWAYS prefer Edit over Write for existing files\n- NEVER use Write to modify existing files unless rewriting entirely\n- Must Read before Edit (not required for Write to new files)\n- Write will overwrite without warning"}]}
{"messages": [{"role": "user", "content": "Review this tool call:\n\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"echo 'export const API_URL = \\\"https://api.example.com\\\"' > src/config.ts\", \"description\": \"Create config file\"}}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. Using `echo >` instead of the Write tool\n2. Shell escaping can cause issues with quotes\n3. Write tool is more reliable for file creation\n\n**Fixed - use Write tool:**\n```json\n{\"name\": \"write\", \"arguments\": {\"filePath\": \"/project/src/config.ts\", \"content\": \"export const API_URL = \\\"https://api.example.com\\\"\\n\"}}\n```\n\n**Why Write is better:**\n- No shell escaping issues\n- Consistent behavior across platforms\n- Better error handling\n- Integrates with editor/LSP\n\n**Only use bash echo/cat for:**\n- Appending to files (`>>`)\n- Complex shell variable interpolation\n- When explicitly needed for shell scripting"}]}
{"messages": [{"role": "user", "content": "How do I verify a directory exists before creating files in it?"}, {"role": "assistant", "content": "**Use the List tool or bash ls to verify:**\n\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"ls -la /project/src/components\", \"description\": \"List components directory\"}}\n```\n\nOr use glob to check:\n```json\n{\"name\": \"glob\", \"arguments\": {\"pattern\": \"src/components/*\"}}\n```\n\n**If directory doesn't exist, create it first:**\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"mkdir -p /project/src/components/forms\", \"description\": \"Create forms directory\"}}\n```\n\n**Then write the file:**\n```json\n{\"name\": \"write\", \"arguments\": {\"filePath\": \"/project/src/components/forms/LoginForm.tsx\", \"content\": \"...\"}}\n```\n\n**Best practice workflow:**\n1. List parent directory to verify location\n2. Create subdirectory if needed (mkdir -p)\n3. Write the new file"}]}
{"messages": [{"role": "user", "content": "Review this parallel tool usage:\n\n```json\n[\n {\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/src/App.tsx\"}},\n {\"name\": \"edit\", \"arguments\": {\"filePath\": \"/project/src/App.tsx\", \"oldString\": \"old\", \"newString\": \"new\"}}\n]\n```"}, {"role": "assistant", "content": "**Issue:** These operations have a dependency - Edit requires Read to complete first.\n\n**Problem:**\n- Edit tool requires the file to be read first in the conversation\n- Running in parallel means Edit may execute before Read completes\n- This will cause the Edit to fail\n\n**Fixed - run sequentially:**\n\nFirst message:\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/src/App.tsx\"}}\n```\n\nSecond message (after Read completes):\n```json\n{\"name\": \"edit\", \"arguments\": {\"filePath\": \"/project/src/App.tsx\", \"oldString\": \"old\", \"newString\": \"new\"}}\n```\n\n**When to parallelize:**\n- Independent reads: `[read(file1), read(file2)]` ✓\n- Independent commands: `[git status, git diff]` ✓\n- File search + content search: `[glob(...), grep(...)]` ✓\n\n**Never parallelize:**\n- Read → Edit (dependency)\n- mkdir → write file (dependency)\n- git add → git commit (dependency)"}]}
{"messages": [{"role": "user", "content": "Find all React components that import useState"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "grep", "arguments": "{\"pattern\": \"import.*useState.*from ['\\\"]react['\\\"]\", \"include\": \"*.tsx\"}"}}]}]}
{"messages": [{"role": "user", "content": "Create a new React component file for a navigation bar"}, {"role": "assistant", "content": "First, let me check the existing component structure.", "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "glob", "arguments": "{\"pattern\": \"src/components/**/*.tsx\"}"}}]}]}
{"messages": [{"role": "user", "content": "The previous glob returned: src/components/Button.tsx, src/components/Header.tsx, src/components/Footer.tsx"}, {"role": "assistant", "content": "I can see the component structure. Let me create a NavBar component following the same pattern.", "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "read", "arguments": "{\"filePath\": \"/project/src/components/Header.tsx\"}"}}]}]}
{"messages": [{"role": "user", "content": "After reading Header.tsx, create the NavBar component"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "write", "arguments": "{\"filePath\": \"/project/src/components/NavBar.tsx\", \"content\": \"import { useState } from 'react'\\n\\ninterface NavBarProps {\\n items: Array<{ label: string; href: string }>\\n}\\n\\nexport function NavBar({ items }: NavBarProps) {\\n const [isOpen, setIsOpen] = useState(false)\\n\\n return (\\n <nav className=\\\"navbar\\\">\\n <button onClick={() => setIsOpen(!isOpen)}>\\n Menu\\n </button>\\n {isOpen && (\\n <ul>\\n {items.map((item) => (\\n <li key={item.href}>\\n <a href={item.href}>{item.label}</a>\\n </li>\\n ))}\\n </ul>\\n )}\\n </nav>\\n )\\n}\\n\"}"}}]}]}
{"messages": [{"role": "user", "content": "Rename the 'handleClick' function to 'onButtonClick' in Button.tsx"}, {"role": "assistant", "content": "I need to read the file first to see the current implementation.", "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "read", "arguments": "{\"filePath\": \"/project/src/components/Button.tsx\"}"}}]}]}
{"messages": [{"role": "user", "content": "Button.tsx contains:\n```\nimport { useState } from 'react'\n\nexport function Button({ label }: { label: string }) {\n const [clicked, setClicked] = useState(false)\n \n const handleClick = () => {\n setClicked(true)\n }\n \n return <button onClick={handleClick}>{label}</button>\n}\n```"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "edit", "arguments": "{\"filePath\": \"/project/src/components/Button.tsx\", \"oldString\": \"handleClick\", \"newString\": \"onButtonClick\", \"replaceAll\": true}"}}]}]}
{"messages": [{"role": "user", "content": "Check if the project has any TypeScript errors"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "bash", "arguments": "{\"command\": \"npx tsc --noEmit\", \"timeout\": 60000, \"description\": \"Check TypeScript errors\"}"}}]}]}
{"messages": [{"role": "user", "content": "Review this tool selection: User wants to see the package.json dependencies\n\n```json\n{\"name\": \"bash\", \"arguments\": {\"command\": \"cat package.json | jq '.dependencies'\", \"description\": \"Show dependencies\"}}\n```"}, {"role": "assistant", "content": "**Issues:**\n1. Using `cat` and pipe instead of Read tool\n2. Relies on `jq` being installed\n3. More complex than needed\n\n**Better approach - just read the file:**\n```json\n{\"name\": \"read\", \"arguments\": {\"filePath\": \"/project/package.json\"}}\n```\n\nThe Read tool will show the full package.json with line numbers, making it easy to see dependencies, devDependencies, scripts, etc.\n\n**When jq approach might be valid:**\n- Extremely large JSON files\n- Need specific programmatic extraction\n- Building automation scripts\n\nBut for viewing package.json, Read is simpler and more reliable."}]}
{"messages": [{"role": "user", "content": "Help me understand what files were changed in the last commit"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "bash", "arguments": "{\"command\": \"git show --stat HEAD\", \"description\": \"Show last commit changes\"}"}}]}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment