#!/usr/bin/env -S ai --sonnet --skipSummarize the architecture of this codebase. List the main entry points,key modules, and how data flows through the system.
From examples/analyze-code.md. Uses Sonnet for better code understanding.
This is shorthand for --dangerously-skip-permissions. It allows the AI to:
Read files without prompting you for each one
Use tools automatically
Explore the codebase freely
Wait, isn’t --skip dangerous?Yes, but only for write operations. This script’s prompt is read-only - it only asks for analysis. The AI won’t modify files unless your prompt tells it to.For true safety, use granular permissions:
Copy
#!/usr/bin/env -S ai --sonnet --allowedTools 'Read' 'Grep' 'Glob'Summarize the architecture of this codebase.
# Use AWS Bedrock insteadai --aws analyze-code.md# Use Opus for deeper analysisai --opus analyze-code.md# Use local Ollama (free!)ai --ollama analyze-code.md
#!/usr/bin/env -S ai --sonnet --skipAnalyze this codebase for security issues. Check for:- SQL injection vulnerabilities- XSS vulnerabilities - Authentication/authorization flaws- Sensitive data exposureBe specific about file paths and line numbers.
Performance analysis:
Copy
#!/usr/bin/env -S ai --sonnet --skipAnalyze this codebase for performance issues:- Inefficient algorithms (O(n²) or worse)- Unnecessary re-renders- Memory leaks- Large bundle size contributors
Test coverage analysis:
Copy
#!/usr/bin/env -S ai --sonnet --skipAnalyze test coverage in this codebase:- Which modules have tests?- Which critical paths are untested?- Are there obsolete tests?- Suggest priority areas for new tests.
#!/usr/bin/env -S ai --sonnet --skipAnalyze only the API layer in src/api/. Document:- Available endpoints- Request/response schemas- Authentication requirements