Skip to content

Commit b2018d3

Browse files
trevor-eclaude
andauthored
feat(ai-dev-docs): update with latest Boris tips + overhaul section organization (#16379)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR - Updates with some latest tips from https://x.com/bcherny/status/2021699851499798911 - Big overhaul on the general organization, I settled on The Basics, Prompting, Working in Parallel, and Workflows as the top four themes. - Included more mcp/tooling info ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [x] Checked Vercel preview for correctness, including links - [x] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 980e8f3 commit b2018d3

1 file changed

Lines changed: 122 additions & 66 deletions

File tree

develop-docs/engineering-practices/ai-assisted-development.mdx

Lines changed: 122 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,7 @@ AI assistants have broad knowledge but no inherent context about your codebase.
1616

1717
Luckily for us, software engineering is full of largely mechanical boilerplate changes that can make great use of agents. That said, **always fully review agent changes before merging**. Pay special attention to tests, where agents tend to write assertions that pass rather than assertions that are correct.
1818

19-
## Start With a Plan
20-
21-
The most effective workflow is to have the AI create a plan before writing any code. Describe the task with any constraints, let the AI explore the codebase and propose an approach, then iterate on the plan until it meets your criteria. Once the plan is solid, the AI can often one-shot the implementation.
22-
23-
Most AI coding tools have a native "plan mode" or "agent mode" that enforces this workflow. Use it! For extra rigor, have one Claude write the plan, then spin up a second Claude to review it as a staff engineer.
24-
25-
The moment something goes sideways during implementation, switch back to plan mode and re-plan. Don't keep pushing. You can also explicitly tell Claude to enter plan mode for verification steps, not just for the initial build.
26-
27-
**Example workflow:**
28-
29-
```
30-
I need to add a new API endpoint POST /api/projects/{id}/archive
31-
that archives a project and all its associated data. This should follow
32-
standard API route conventions and have appropriate testing. Follow the
33-
POST /api/projects/{id}/blah endpoint as an example. Archiving a project
34-
could have many downstream side effects and bugs, can you please also
35-
analyze any potential risks that could happen in other parts of our product
36-
from using this feature.
37-
```
38-
39-
After reviewing the proposed plan:
40-
41-
```
42-
The plan looks good, but we also need to revoke API keys
43-
when archiving. Update the plan.
44-
```
45-
46-
The goal is to allow the agent to work independently for as long as possible without needing your input.
47-
48-
## Context Files
19+
### Context Files
4920

5021
Most AI tools support project-level context files that provide instructions and codebase knowledge:
5122

@@ -61,11 +32,19 @@ Invest in your context file. After every correction, end with: "Update your CLAU
6132

6233
These files have already been added to our main repos but are by no means complete, please contribute to them!
6334

64-
## Extending AI Tools
35+
### Extending AI Tools
6536

6637
There are two main ways to extend AI coding tools. **Skills** are prompt templates that teach the AI how to perform specific tasks like following commit conventions. They run inside the AI's context. **MCP (Model Context Protocol)** connects the AI to external services and data sources, providing tools the AI can call.
6738

68-
### Sentry Skills
39+
#### Plugins
40+
41+
Plugins are the primary way to install extensions in Claude Code. A plugin can bundle LSPs (available for every major language), MCPs, skills, agents, and custom hooks into a single installable package.
42+
43+
Install plugins from the official Anthropic plugin marketplace, or create a private marketplace for your company. Check the `settings.json` into your codebase to auto-add marketplaces for your team so everyone gets the same tooling.
44+
45+
Run `/plugin` to browse and install plugins. See the [plugin documentation](https://code.claude.com/docs/en/discover-plugins) for more.
46+
47+
#### Sentry Skills
6948

7049
[Sentry Skills](https://github.com/getsentry/skills) are available for Claude Code users:
7150

@@ -89,7 +68,7 @@ claude plugin install sentry-skills@sentry-skills
8968

9069
If you do something more than once a day, turn it into a skill or command. Create your own skills and commit them to git so you can reuse them across projects. See the [Claude Code skills documentation](https://docs.anthropic.com/en/docs/claude-code/skills) for more on how skills work.
9170

92-
### MCP Tools
71+
#### MCP Tools
9372

9473
[Model Context Protocol](https://modelcontextprotocol.io/) is an open standard for connecting AI tools to external systems (think USB-C for AI). While skills teach the AI _how_ to do something, MCP gives it _access_ to things it otherwise couldn't reach: databases, APIs, external services, and the ability to take actions like creating tickets or sending messages.
9574

@@ -99,20 +78,102 @@ For example, with the Sentry MCP server configured, you can ask your AI assistan
9978

10079
MCP works across tools that support it, including Claude Code and Cursor. See the [MCP documentation](https://modelcontextprotocol.io/docs) for setup and available servers.
10180

102-
### Subagents
81+
#### Custom Agents
10382

104-
Subagents are child agents spawned to handle specific tasks in parallel. They each run in their own context window and return a summary to the parent agent. General-purpose and Plan agents inherit the full parent conversation context, while Explore agents start fresh with no prior context (useful for independent search tasks).
83+
Custom agents let you define specialized personas with their own tools, permissions, and models. Drop `.md` files in `.claude/agents/` to create them. Each agent can have a custom name, color, tool set, pre-allowed and pre-disallowed tools, permission mode, and model.
10584

106-
This isolation keeps your main conversation focused. A subagent can read thousands of lines of code, but only returns a concise summary, so your parent context stays clean. Use subagents when searching multiple code paths in parallel, running independent operations simultaneously, or doing large refactors across many files.
85+
You can also set a default agent for your main conversation using the `"agent"` field in `settings.json` or the `--agent` CLI flag. This is useful for teams that want a consistent base configuration.
10786

108-
Append "use subagents" to any request where you want Claude to throw more compute at the problem. You can also route permission requests to Opus 4.5 via a [hook](https://code.claude.com/docs/en/hooks#permissionrequest) to scan for attacks and auto-approve the safe ones.
87+
Run `/agents` to get started, or see the [custom agents documentation](https://code.claude.com/docs/en/sub-agents).
10988

110-
See the [Claude Code subagents documentation](https://code.claude.com/docs/en/sub-agents) for details.
89+
### Recommended Tools
90+
91+
Connect your AI assistant to the services your team already uses. These are the MCP servers and CLIs we've found most useful at Sentry.
92+
93+
| Tool | What it gives you | Setup |
94+
| ---- | ----------------- | ----- |
95+
| [Sentry MCP](https://docs.sentry.io/product/sentry-mcp/) | Query errors, search issues, analyze traces, and get root cause analysis directly from your editor. | `claude mcp add sentry -- npx @sentry/mcp` |
96+
| [Linear MCP](https://github.com/jerhadf/linear-mcp-server) | Create, search, and update Linear issues without leaving your session. Great for turning bug findings into tickets on the spot. | See repo README |
97+
| [Notion MCP](https://github.com/makenotion/notion-mcp-server) | Search and read Notion pages. Useful for pulling in specs, RFCs, and team docs as context. | See repo README |
98+
| [Slack MCP](https://github.com/nicholasgriffintn/slack-mcp-server) | Read Slack threads and channels. Paste a bug report thread and say "fix." | See repo README |
99+
100+
#### CLIs
101+
102+
AI assistants can use any CLI tool you have installed. A few that work especially well:
103+
104+
- **`gcloud`** — Fetch logs, query BigQuery, and inspect GCP resources. Point Claude at `gcloud logging read` output to troubleshoot production issues.
105+
- **`gh`** — Read PRs, issues, CI logs, and review comments from GitHub.
106+
- **`bq`** — Run BigQuery queries for ad-hoc analytics (see [Data & Analytics](#data--analytics)).
107+
108+
If there's a service your team uses daily and it has a CLI or MCP server, connect it. The fewer context switches between your editor and browser, the better.
109+
110+
## Prompting
111+
112+
### Start With a Plan
113+
114+
The most effective workflow is to have the AI create a plan before writing any code. Describe the task with any constraints, let the AI explore the codebase and propose an approach, then iterate on the plan until it meets your criteria. Once the plan is solid, the AI can often one-shot the implementation.
115+
116+
Most AI coding tools have a native "plan mode" or "agent mode" that enforces this workflow. Use it! For extra rigor, have one Claude write the plan, then spin up a second Claude to review it as a staff engineer.
117+
118+
The moment something goes sideways during implementation, switch back to plan mode and re-plan. Don't keep pushing. You can also explicitly tell Claude to enter plan mode for verification steps, not just for the initial build.
119+
120+
**Example workflow:**
121+
122+
```
123+
I need to add a new API endpoint POST /api/projects/{id}/archive
124+
that archives a project and all its associated data. This should follow
125+
standard API route conventions and have appropriate testing. Follow the
126+
POST /api/projects/{id}/blah endpoint as an example. Archiving a project
127+
could have many downstream side effects and bugs, can you please also
128+
analyze any potential risks that could happen in other parts of our product
129+
from using this feature.
130+
```
131+
132+
After reviewing the proposed plan:
133+
134+
```
135+
The plan looks good, but we also need to revoke API keys
136+
when archiving. Update the plan.
137+
```
138+
139+
The goal is to allow the agent to work independently for as long as possible without needing your input.
140+
141+
An alternative to explicit plan mode is **spec-based development**: start with a minimal spec or prompt and ask Claude to interview you (using skills like [brainstorming](https://github.com/obra/superpowers/blob/main/skills/brainstorming/SKILL.md) that leverage `AskUserQuestion` to refine requirements interactively). Once the spec is solid, start a new session to execute it. This separates the thinking from the doing and keeps the implementation context clean.
142+
143+
### Techniques
144+
145+
Challenge Claude. Say "Grill me on these changes and don't make a PR until I pass your test." Make Claude be your reviewer. Or say "Prove to me this works" and have Claude diff behavior between main and your feature branch.
146+
147+
After a mediocre fix, say: "Knowing everything you know now, scrap this and implement the elegant solution."
148+
149+
Write detailed specs and reduce ambiguity before handing work off. The more specific you are, the better the output.
150+
151+
### Managing Context
152+
153+
Long sessions accumulate irrelevant context that can degrade performance. Use `/clear` between unrelated tasks to reset the context window. Use `/compact` to condense the conversation, or `/compact [instructions]` to preserve specific information like core definitions or debugging notes. Give sessions descriptive names so you can `/resume` them later. Run `/statusline` to keep track of remaining context at a glance.
154+
155+
### Todo Lists
156+
157+
For complex multi-step tasks, ask the agent to maintain a todo list. This helps it track progress, and you can review the list to course-correct before it goes too far in the wrong direction. Many agents will do this automatically in certain situations but sometimes it can't hurt to ask!
158+
159+
### Refinement Passes
160+
161+
Agents, like humans, often need multiple passes to polish code. After the initial implementation, use skills like `/code-simplifier` to clean up verbose or overly defensive patterns. Think of it as a code review step before your actual code review to catch the obvious issues before opening a PR.
111162

112163
## Working in Parallel
113164

114165
The goal is to run multiple AI sessions simultaneously with minimal interruption. A few techniques help achieve this.
115166

167+
### Pre-approve Permissions
168+
169+
Every permission prompt interrupts your flow. Run `/permissions` in Claude Code to manage your allow and block lists. Check these into your team's `settings.json` so everyone benefits.
170+
171+
Claude Code supports full wildcard syntax for permissions. For example, `Bash(bun run *)` pre-approves all `bun run` commands, and `Edit(/docs/**)` allows edits to any file under `/docs/`. See the [permissions documentation](https://code.claude.com/docs/en/permissions) for details.
172+
173+
### Multi-repo Tasks
174+
175+
When a task spans multiple repositories, use `/add-dir` in Claude Code to add additional directories to the session context. The agent can then read and edit files across repos.
176+
116177
### Git Worktrees
117178

118179
[Git worktrees](https://git-scm.com/docs/git-worktree) let you check out multiple branches in separate directories, each with its own Claude session. Spinning up 3-5 worktrees at once, each running its own Claude session in parallel, is one of the biggest productivity unlocks. While one agent refactors authentication, another can build an unrelated feature without conflicts or context pollution.
@@ -127,63 +188,58 @@ Name your worktrees and set up shell aliases (`za`, `zb`, `zc`) so you can hop b
127188

128189
Keep worktrees isolated: one branch per worktree, never develop directly in main. For short tasks, the setup overhead may not be worth it. See [Run parallel Claude Code sessions with git worktrees](https://code.claude.com/docs/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees) for more.
129190

130-
### Pre-approve Permissions
191+
### Subagents
131192

132-
Every permission prompt interrupts your flow. Configure allowed tools and commands in your project's settings to let agents work autonomously. In Claude Code, use `/allowed-tools` to see current permissions and `claude config set` to add new ones.
193+
Subagents are child agents spawned to handle specific tasks in parallel. They each run in their own context window and return a summary to the parent agent. General-purpose and Plan agents inherit the full parent conversation context, while Explore agents start fresh with no prior context (useful for independent search tasks).
133194

134-
### Multi-repo Tasks
195+
This isolation keeps your main conversation focused. A subagent can read thousands of lines of code, but only returns a concise summary, so your parent context stays clean. Use subagents when searching multiple code paths in parallel, running independent operations simultaneously, or doing large refactors across many files.
135196

136-
When a task spans multiple repositories, use `/add-dir` in Claude Code to add additional directories to the session context. The agent can then read and edit files across repos.
197+
Append "use subagents" to any request where you want Claude to throw more compute at the problem. You can also route permission requests to Opus 4.5 via a [hook](https://code.claude.com/docs/en/hooks#permissionrequest) to scan for attacks and auto-approve the safe ones.
137198

138-
### Managing Context
199+
See the [Claude Code subagents documentation](https://code.claude.com/docs/en/sub-agents) for details.
139200

140-
Long sessions accumulate irrelevant context that can degrade performance. Use `/clear` between unrelated tasks to reset the context window. Use `/compact` to condense the conversation, or `/compact [instructions]` to preserve specific information like core definitions or debugging notes. Give sessions descriptive names so you can `/resume` them later.
201+
### Sandboxing
141202

142-
### Todo Lists
203+
Enable Claude Code's [open source sandbox runtime](https://github.com/anthropic-experimental/sandbox-runtime) to improve safety while reducing permission prompts. Sandboxing runs on your machine and supports both file and network isolation.
143204

144-
For complex multi-step tasks, ask the agent to maintain a todo list. This helps it track progress, and you can review the list to course-correct before it goes too far in the wrong direction. Many agents will do this automatically in certain situations but sometimes it can't hurt to ask!
205+
Run `/sandbox` to enable it. See the [sandboxing documentation](https://code.claude.com/docs/en/sandboxing) for details.
145206

146-
### Refinement Passes
207+
### Hooks
147208

148-
Agents, like humans, often need multiple passes to polish code. After the initial implementation, use skills like `/code-simplifier` to clean up verbose or overly defensive patterns. Think of it as a code review step before your actual code review to catch the obvious issues before opening a PR.
209+
Hooks let you deterministically hook into Claude's lifecycle. Use them to:
210+
211+
- Automatically route permission requests to Slack or Opus for approval
212+
- Nudge Claude to keep going when it reaches the end of a turn (you can use a prompt or kick off an agent to decide whether Claude should continue)
213+
- Pre-process or post-process tool calls, for example to add your own logging
214+
- Enable terminal notifications when an agent is waiting for input
215+
216+
Ask Claude to add a hook to get started, or see the [hooks documentation](https://code.claude.com/docs/en/hooks).
149217

150218
### Let the Agent Fetch Context
151219

152220
Instead of copying and pasting error messages, give the agent a PR or issue URL and let it fetch the details itself. It can read build failures, status check logs, and PR comments directly using the `gh` CLI. This saves you time and ensures the agent sees the full context.
153221

154222
### Enable Notifications
155223

156-
When running multiple sessions, enable terminal notifications so you know when an agent is waiting for input. This lets you context-switch to other work while agents run, without constantly checking back.
157-
158-
### Terminal Setup
159-
160-
[Ghostty](https://ghostty.org/) is a popular choice for its synchronized rendering, 24-bit color, and proper unicode support. Use `/statusline` to customize your status bar to always show context usage and current git branch. Color-code and name your terminal tabs, one tab per task or worktree. Some people use tmux for this.
224+
When running multiple sessions, enable terminal notifications so you know when an agent is waiting for input. iTerm2 has built-in notification support, or you can use a custom notifications hook. This lets you context-switch to other work while agents run, without constantly checking back.
161225

162-
Use voice dictation. You speak 3x faster than you type, and your prompts get way more detailed as a result (hit fn twice on macOS). See the [terminal configuration docs](https://code.claude.com/docs/en/terminal-config) for more tips.
226+
## Workflows
163227

164-
## Bug Fixing
228+
### Bug Fixing
165229

166230
Claude fixes most bugs by itself with minimal guidance. Enable the Slack MCP, paste a Slack bug thread into Claude, and just say "fix."
167231

168232
Or just say "Go fix the failing CI tests." Don't micromanage how. Point Claude at docker logs to troubleshoot distributed systems.
169233

170-
## Prompting Techniques
171-
172-
Challenge Claude. Say "Grill me on these changes and don't make a PR until I pass your test." Make Claude be your reviewer. Or say "Prove to me this works" and have Claude diff behavior between main and your feature branch.
173-
174-
After a mediocre fix, say: "Knowing everything you know now, scrap this and implement the elegant solution."
175-
176-
Write detailed specs and reduce ambiguity before handing work off. The more specific you are, the better the output.
177-
178-
## Data & Analytics
234+
### Data & Analytics
179235

180236
Ask Claude Code to use the `bq` CLI to pull and analyze metrics on the fly. You can create a BigQuery skill and check it into the codebase so everyone on the team can run analytics queries directly in Claude Code.
181237

182238
This works for any database that has a CLI, MCP, or API.
183239

184-
## Learning with Claude
240+
### Learning with Claude
185241

186-
Enable the "Explanatory" or "Learning" output style in `/config` to have Claude explain the _why_ behind its changes.
242+
Run `/config` and set an output style to adjust Claude's tone and format. The **"Explanatory"** style is great when getting familiar with a new codebase, as Claude explains frameworks and code patterns as it works. The **"Learning"** style coaches you through making code changes yourself instead of writing the code for you. You can also create custom output styles to adjust Claude's voice however you like. See the [output styles documentation](https://code.claude.com/docs/en/output-styles) for details.
187243

188244
Have Claude generate a visual HTML presentation explaining unfamiliar code. Ask Claude to draw ASCII diagrams of new protocols and codebases to help you understand them.
189245

0 commit comments

Comments
 (0)