โ† Claude Hacks (10x Productivity)

Claude Code Tips & Tricks Nobody Tells You, 8 Principles to Build Faster & Smarter

Video 3 of 3 ยท 19:33

Chapters

  • 00:00- Why most people use Claude Code wrong
  • 02:40- Live Demo: Building a Full-Stack Website the right way
  • 05:47- The 8 Claude Code Best Practices (Full Framework)
  • 06:52- Tip 1 & 2: How to plan architecture & use Claude for real-time research
  • 09:19- Tip 3: Break problems into logical, testable components
  • 11:00- Tip 4: Always use a test-first mindset with Claude Code
  • 13:25- Tip 5: Version control โ€” your safety net against hallucinations
  • 15:05- Tips 6, 7 & 8: Sessions, context windows & staying in control
  • 16:52- Full Best Practices Summary
  • 17:41- What's Next

Transcript

Auto generated by YouTube. Click any timestamp to jump to that moment.

Show
  1. 0:02are doing well. This is Rajesh
  2. 0:03here. Today I'm going to cover
  3. 0:06principles of AI coding for product
  4. 0:09and I think we are at a very
  5. 0:11juncture right AI has evolved so
  6. 0:15that now there's lot of power in
  7. 0:17hands of product managers to build
  8. 0:20they want and we are at AI
  9. 0:22managers are at a very central
  10. 0:24because we have two very good
  11. 0:26right one skill is understanding
  12. 0:29requirements we understand the user
  13. 0:31thoroughly we understand
  14. 0:33market dynamics
  15. 0:34have been working on ways and means
  16. 0:37improve revenue for a company,
  17. 0:39engagement for a company. As a
  18. 0:42PM probably we go much much
  19. 0:44into improving performance
  20. 0:46and couple of important aspects
  21. 0:48users journey, right? We have been on
  22. 0:51of lot of different things and lot
  23. 0:53us have high level understanding of
  24. 0:55design, right? Okay. What is a
  25. 0:57level architecture? What does it
  26. 0:59to build a scalable analytics
  27. 1:01What does it take to build a
  28. 1:03uh website or gaming engine
  29. 1:06caters to millions of people right
  30. 1:08a lot of interesting ways and means
  31. 1:11which we have been driving the
  32. 1:13forward and often times we
  33. 1:16the space where probably there's no
  34. 1:19our backlog list is so long often I
  35. 1:22in a state when I was working with
  36. 1:23Walmart or zinga in the past we
  37. 1:26huge backlog right we have backlog
  38. 1:28100 plus items and my engineering
  39. 1:31barely scraps through 10 of them.
  40. 1:33cost of that to the company is huge.
  41. 1:36thanks to AI, the power is now in
  42. 1:39hands to s sort of launch something
  43. 1:40launch something in the market,
  44. 1:43to gather feedback very very fast
  45. 1:45see if you want to put additional
  46. 1:47strength to take it to a
  47. 1:49huge scale. Right? Having said
  48. 1:51you can also now debate that
  49. 1:53teams are more than capable to
  50. 1:56something huge. Right? As an
  51. 1:58I have been running CodePai as
  52. 2:01solo founder. Again, PM for almost 15
  53. 2:04now. Worked with companies like
  54. 2:06Flipkart and Walmart. Obviously,
  55. 2:09millions of DAUs and millions
  56. 2:11dollars in revenue. But last one year
  57. 2:13been pretty fascinating and I've
  58. 2:15pretty deep into AI, right? And
  59. 2:17used some of these AI coding tools
  60. 2:18cloud code or cursor or other tools
  61. 2:23sort of create an end toend website
  62. 2:25is codepi. And in codepi which
  63. 2:29I'm going to show you very
  64. 2:30we just cover high level aspects
  65. 2:32that you can understand what a
  66. 2:34manager can do with the right
  67. 2:37of tools and this and in this AI
  68. 2:39Right. Great. Let me go through
  69. 2:42AI website. When you log into Codep
  70. 2:44you got three types of websites you
  71. 2:47generate. A simple website is a
  72. 2:49prototype that you want to build
  73. 2:51that you want to create on the
  74. 2:52and showcase to your team.
  75. 2:54website is something that
  76. 2:56with a basic database. So you need
  77. 2:59provide your superbase access token
  78. 3:02you're working on a superbase
  79. 3:03right now. You may not even
  80. 3:05to enter the superbase token in the
  81. 3:07but effectively it creates a
  82. 3:09stack website. And last one is
  83. 3:11store which creates an end
  84. 3:12e-commerce store along with
  85. 3:14gateway integration with stripe.
  86. 3:17So this how it looks. I mean this
  87. 3:18to show you guys the art of what
  88. 3:20possible when AP really goes deeper
  89. 3:22executions and leverages right
  90. 3:24of AI coding tools and skills.
  91. 3:27I'll go I'll take you through as
  92. 3:29discussed earlier we have built
  93. 3:31of browse engines event-driven
  94. 3:33engines and even the
  95. 3:34campaign engines I think
  96. 3:36built in a span of 2 weeks single
  97. 3:38in two weeks and I was trying to
  98. 3:40a landing page for that using
  99. 3:42now let me see how that looks what
  100. 3:44did is I created a full stack website
  101. 3:47then I wrote a simple prompt I
  102. 3:49like the initial layout so I need
  103. 3:51made couple of modifications and then
  104. 3:53I landed in this particular page
  105. 3:55now when you see this page
  106. 3:58talks about hey this is my assembly
  107. 4:00where you can in fact go in it's
  108. 4:03a mini amplitude where you have an
  109. 4:05you can integrate with your main
  110. 4:06and all the events get captured
  111. 4:08later you can use them to target
  112. 4:10customers right I can request
  113. 4:12when I request access I can write
  114. 4:16name email id right and then timeline
  115. 4:20maybe I need to integrate this as
  116. 4:21and then I asked it to make the form
  117. 4:24bit dynamic have couple of addition
  118. 4:27elements based on what the
  119. 4:29needs. I need smart card targeting
  120. 4:33probably I was with mix panel before
  121. 4:36I have 100k
  122. 4:39per month. I'll do submit request
  123. 4:42now as you see when I submit the
  124. 4:45actually goes and sits in my
  125. 4:47account right so it's all full
  126. 4:50completely integrated and if I
  127. 4:52through the site you can see the
  128. 4:54you can see how to use
  129. 4:56SDK quick start guides again core
  130. 5:00API references what are the key
  131. 5:02cases that you want to run through
  132. 5:04what are the best practices use
  133. 5:06right welcome emails cart
  134. 5:08user activation and again
  135. 5:11entire website is created using
  136. 5:12PBI. Once I create the website, you
  137. 5:15do a oneclick deploy. You can attach
  138. 5:17custom domains. You can also view
  139. 5:20right? This is the browser
  140. 5:21SDK that runs on the site.
  141. 5:23someone goes and visits your
  142. 5:25we generate basic traffic metrics
  143. 5:28how many visitors, which pages did
  144. 5:30visit, how many audience came up,
  145. 5:32countries are they from, how many
  146. 5:34what is the bounce rate, what
  147. 5:35the duration. Again all this created
  148. 5:39one or two people within a span of
  149. 5:42to three weeks right beautiful isn't
  150. 5:45what AI can do in this modern world
  151. 5:47let's switch some gears let me go
  152. 5:50to the presentation and I will just
  153. 5:52you so I think we have talked
  154. 5:54about couple of what code does
  155. 5:57I have now captured is what does
  156. 6:00mean for you right I've been
  157. 6:02all this for you to sort of show
  158. 6:04the art of what is possible now what
  159. 6:06this mean to you. What this means
  160. 6:08with low teams, with low budgets, you
  161. 6:10build very high quality products in
  162. 6:12less time. One year back none of
  163. 6:14was possible. Now almost everything
  164. 6:17possible. But again, it's not so
  165. 6:18dory that you write a single
  166. 6:20and AI can create everything one
  167. 6:22You need to have some basics. You
  168. 6:24to have some good understanding.
  169. 6:26need to have a strong discipline in
  170. 6:28of how to work with AI. And that's
  171. 6:30I'm going to cover today. Right?
  172. 6:32going to cover what are the
  173. 6:34that I observed while doing AI
  174. 6:36while building codepai while
  175. 6:39couple of these peripheral
  176. 6:41that we talked about and how
  177. 6:43can benefit from my learnings over
  178. 6:46period of last one year. So I split
  179. 6:48into eight highle principles. Let's
  180. 6:50through each of them individually.
  181. 6:52are the foundations? How do I
  182. 6:53do this? Right. Um when I come
  183. 6:56an idea as product managers, we
  184. 6:58understand the user
  185. 6:59very thoroughly. We write a
  186. 7:02thorough PRD or a document so that
  187. 7:04understand what the users are trying
  188. 7:07convey and we also sort of when we
  189. 7:09the document we internal
  190. 7:10some of those workflows and
  191. 7:12and why we're doing what we're
  192. 7:14The next step given that all of
  193. 7:16are product managers you know how to
  194. 7:17PRDs is all about how do you now
  195. 7:20highle architecture right for
  196. 7:22you need some basic level of
  197. 7:23of how high level system
  198. 7:25what I typically do given I know
  199. 7:28basics of high level system designs
  200. 7:31go to GPD 502 thinking I upload my PRD
  201. 7:34terms of use cases what I want to do
  202. 7:36I ask it to create a high very high
  203. 7:38architecture in terms of different
  204. 7:41interactions how does it work
  205. 7:43high level view right high level
  206. 7:45design and I do this for two to
  207. 7:47days at a stitch I don't just
  208. 7:49a single prompt I wait for it to
  209. 7:51me something ad hoc and start
  210. 7:54immediately I wait I converse
  211. 7:56it quite a lot of things it doesn't
  212. 7:59in the first iteration so I have
  213. 8:01own questions I have my own doubts
  214. 8:03happens when we hit 1 million
  215. 8:05what happens when we hit 10
  216. 8:07events per second that's too
  217. 8:09but again just for the benefit of
  218. 8:11right what happens When an
  219. 8:14user turns up into a signed up
  220. 8:16how do we handle this scenario?
  221. 8:18scenario typical product manager,
  222. 8:21But you need to do that
  223. 8:22You need to do that
  224. 8:23so that your architecture
  225. 8:26is perfectly strong and sound. So
  226. 8:28thing that I do, I brainstorm
  227. 8:30a lot of thinking model. I prefer
  228. 8:33Thinking it depends upon you. Then
  229. 8:36do I do? My second step is AIS have
  230. 8:39have stale data. I obviously need
  231. 8:42data whenever I need an API
  232. 8:44So I tend to depend quite a
  233. 8:46on perplexity to get all the latest
  234. 8:48If I let's say want to
  235. 8:50with a anthropic API, an open
  236. 8:54API, right? Or some other API, I
  237. 8:56or recent API, I jump into
  238. 8:59to get all the recent
  239. 9:01or summarize the documents and
  240. 9:02now I have a highle plan, high
  241. 9:05architecture. Before even that I
  242. 9:08a high level PR I have a high level
  243. 9:10and I also have the latest
  244. 9:12on any of the external
  245. 9:14that my engine needs to
  246. 9:16right what next I break them into
  247. 9:20parts LLMs are super super
  248. 9:22but they have peanut sized
  249. 9:24right the brains are very small
  250. 9:26can't go beyond 200k context window
  251. 9:30claim they can go till 1 million
  252. 9:31the moment you go beyond 200k the
  253. 9:33quality deteriorates drastically
  254. 9:35how do you manage is this don't try
  255. 9:38build the entire system in a single
  256. 9:41It's not built for that. We're
  257. 9:43there yet. LLMs are not there yet.
  258. 9:45how what do you do? You break
  259. 9:48highle component into multiple
  260. 9:50and sub components. Typical
  261. 9:53typical product principles
  262. 9:55terms of problem solving right one
  263. 9:57solving. Now let's take an
  264. 9:59I'm building an analytics
  265. 10:00What does it mean for me? I need
  266. 10:02collect data from customer
  267. 10:03I need to then store the
  268. 10:06somewhere for different purposes.
  269. 10:08can be for logs just to replay just
  270. 10:12look at the past data and validate if
  271. 10:14work correctly or not. Another
  272. 10:17streaming the live events onto the
  273. 10:19website. Another for probably
  274. 10:22all these events and
  275. 10:24my campaigns. Another for
  276. 10:27analytics I want to roll up at an
  277. 10:28level, at a day level, at 7-day
  278. 10:31things like those right there. So
  279. 10:33are multiple use cases. So break
  280. 10:34into individual components. First
  281. 10:36probably is data collection,
  282. 10:38Only build that component, then
  283. 10:41the data storage component, then
  284. 10:43the analytics component, so on and
  285. 10:45forth, right? Break it into as many
  286. 10:48usable, feasible, testable
  287. 10:52as possible. And then you
  288. 10:54them one after the other and then
  289. 10:56connect and then you make a full
  290. 10:57Right? That is the third
  291. 10:59What is the fourth principle?
  292. 11:02are very good at goal-driven path
  293. 11:06Right? Now, what do I mean by
  294. 11:08If I say build me this analytics
  295. 11:10it'll definitely libert quite a
  296. 11:12It will take quite a lot of time.
  297. 11:15will take quite a lot of tokens. It's
  298. 11:17token efficient. Then what do you
  299. 11:19You probably go in with a test first
  300. 11:22right? You always already had
  301. 11:24use case document. You have your
  302. 11:26definition. You know which
  303. 11:28component you're working on.
  304. 11:30Now ask the LLM to create lot of
  305. 11:32cases based on what you want to
  306. 11:35Customer data acquisition or
  307. 11:38data capture. That's your
  308. 11:40statement, right? Write lot of
  309. 11:41cases, right? Test cases. One of the
  310. 11:44that I quickly want to show you
  311. 11:45how I do it, right? So this was the
  312. 11:48think I showed you analytics in terms
  313. 11:49how it captured in codebook AI or
  314. 11:51campaigns. There's an SDK
  315. 11:54we released recently onto the
  316. 11:55If you want you can subscribe
  317. 11:57you know you can start using. You
  318. 11:59have to drop in a mail and we'll
  319. 12:00you an API key. But again, so this
  320. 12:02an SDK that we have recently built.
  321. 12:05for this SDK when I was developing
  322. 12:07I needed to test it, right? I this
  323. 12:09a end to end mini amplitude kind of
  324. 12:12SDK which captures all the events and
  325. 12:14you can trigger campaigns based on
  326. 12:16Now what did I do? So this is a
  327. 12:17example of how I tested my SDK,
  328. 12:20I created this particular
  329. 12:22with lot of examples with lot
  330. 12:25examples. Right?
  331. 12:27you can see, I've got edge cases, I
  332. 12:30test cases, I got trackers, I got
  333. 12:34are lot of things that you know
  334. 12:36case that I created even before
  335. 12:39it. So ask LLM to create all
  336. 12:43test cases. Ask it to be
  337. 12:45at the same time don't ask
  338. 12:47to overgineer. Right? LLM LLM tends
  339. 12:50overengineer quite a lot. So you have
  340. 12:52be very very very about some of those
  341. 12:55you prompted prompted to say hey
  342. 12:58comprehensive test cases but
  343. 12:59overengineer at all. So the fourth
  344. 13:02is test first mindset okay so we
  345. 13:06brainstorming with thinking
  346. 13:07GBD 5.2 Two, research latest
  347. 13:10using complexity. Break
  348. 13:12into logical parts. As many
  349. 13:15components as possible, test
  350. 13:17mindset. Create all the test cases
  351. 13:19before you even start coding the
  352. 13:22SDK.
  353. 13:24now the fifth part, LLM tend to
  354. 13:26quite a lot, right? It it
  355. 13:29should not touch the code that I
  356. 13:31ask it to code, but it tends to do
  357. 13:33quite often, right? And there are
  358. 13:36approaches to stop it. One is you
  359. 13:38always tend to plan on cloud code.
  360. 13:41do shift. You do plan mode. You
  361. 13:43quite a lot during plan mode.
  362. 13:45look at the plan, read the plan,
  363. 13:46the plan. Once you're all good,
  364. 13:49do auto approve all the changes.
  365. 13:51Always do manual monitoring of
  366. 13:54Right? So it'll so when you
  367. 13:57that option, you can see what
  368. 13:59the changes it is making and
  369. 14:00dynamically. But even then there
  370. 14:02a lot of changes that are possible.
  371. 14:04are a lot of code messing that
  372. 14:06be possible. So what do you do for
  373. 14:08You get push, right? Git is a
  374. 14:12beautiful tool for you to
  375. 14:14It's free to use. Push into
  376. 14:17as much as possible so that you have
  377. 14:19many backups as possible. Again, just
  378. 14:22product managers, we advise to a
  379. 14:24of product managers to communicate
  380. 14:26a lot. Overcommunication is always
  381. 14:29Under commmunication is very very
  382. 14:30Similarly, try to push to get as
  383. 14:33as possible. Now, how do you do
  384. 14:34You can either ask cloud itself do
  385. 14:36or you can create a create a concept
  386. 14:40hooks right whenever it writes
  387. 14:43a code file you create a hook post
  388. 14:45usage do a good push right test it
  389. 14:48do a good push so there are a lot of
  390. 14:51in tools I'm not going to
  391. 14:52all those today that will become
  392. 14:54will make the conversation too long
  393. 14:57take away for you do get push quite
  394. 15:00so that your hard work is not
  395. 15:02and LM don't ruin your time. What
  396. 15:05the sixth point? Restart when stuck.
  397. 15:08happens quite often, right? Often
  398. 15:10get stuck in a huge context window
  399. 15:12pileup mess and it tends to shift you
  400. 15:15multiple different directions which
  401. 15:17never wanted to go. So what do you
  402. 15:19then? Simply restart. Restart always
  403. 15:22right? Laptop doesn't work,
  404. 15:24it. Code doesn't work, restart
  405. 15:26Right? But jokes apart, that
  406. 15:29quite a lot. 30% of the time, I
  407. 15:31to clear my conversation. and I
  408. 15:32to restart the session and it works
  409. 15:35well. The last two points are
  410. 15:37about how do you use the context
  411. 15:40more efficiently. I tend to
  412. 15:42lot of MD files. So whenever I
  413. 15:45any major decision within the
  414. 15:47I capture those in MD
  415. 15:50For large code bases like
  416. 15:52I think I have got roughly
  417. 15:5525 to 30 plus MD files with all
  418. 15:58decisions captured over there.
  419. 16:00whenever I start my clot again, the
  420. 16:03session need not read the entire
  421. 16:05which is way too exhaustive. It
  422. 16:08looks at this MD files and figures
  423. 16:10the critical decisions and moves on
  424. 16:12there. It's a very beautiful way of
  425. 16:14your overall context windows.
  426. 16:17again, don't let this mess up your
  427. 16:19Don't let this mess up your Git
  428. 16:23So always add a g ignore
  429. 16:25so that your github repository
  430. 16:28clean and precise.
  431. 16:31last point context is the king.
  432. 16:33try to dump too much information
  433. 16:35the context window and expect LLMs
  434. 16:38make magic. Llms only amplify the
  435. 16:41sets that you have. So you know
  436. 16:43you need to learn a lot. You need to
  437. 16:45on top of your game and use LLM for
  438. 16:48the required highquality context to
  439. 16:50it work beautifully well. make it
  440. 16:52for you and beautifully well right
  441. 16:55overall what does it mean for you
  442. 16:57are the key learning lessons you
  443. 16:59lot of time in brainstorming with
  444. 17:01models like GBD52
  445. 17:03perplexity as much as possible
  446. 17:05real-time information break a big
  447. 17:08into multiple small components
  448. 17:10on one component at a time test
  449. 17:13mindset create lot of test case
  450. 17:15so that your LLM has a goal to
  451. 17:17get pushed quite aggressively so
  452. 17:21you don't lose your hard work due
  453. 17:22LM calcinations. Restart when stuck,
  454. 17:25happens quite often, 20% of the
  455. 17:27Markdown files as much as possible
  456. 17:30manage your context window more
  457. 17:31and capture your important
  458. 17:33Context is the king. Don't
  459. 17:36garbage. Fill LLMs with only the
  460. 17:39that you need. Right? I
  461. 17:42that's all from my side. Again,
  462. 17:44one more. So based on all these
  463. 17:46at codepai we were able to
  464. 17:48four plus production grade
  465. 17:50including a full-fledged loable
  466. 17:53of a system analytics engine
  467. 17:55testing engine browser
  468. 17:57engine and quite a lot to come
  469. 17:59all this done with simple one
  470. 18:02founder with multiple with couple
  471. 18:04interns and for managing all this
  472. 18:07we have lot lot of MD files
  473. 18:09files so it's all fun if you
  474. 18:12this session I think I would
  475. 18:14encourage you to explore the
  476. 18:16starting in March first week.
  477. 18:19I'm still figuring out the cohort
  478. 18:21and details and further things
  479. 18:23those. But at a very high level,
  480. 18:25is this will be super super
  481. 18:27friendly. Any product manager,
  482. 18:29founder who wants to get onto this
  483. 18:31use AI to expedite their
  484. 18:33use AI to build something usable,
  485. 18:36production ready, this
  486. 18:38this cohort will be super
  487. 18:40for you. So we I'll be personally
  488. 18:42you to use claude code teach
  489. 18:46some of the design first principles
  490. 18:48terms of component making create a
  491. 18:50project you can pick your
  492. 18:52and I'll guide you in terms of
  493. 18:54to build what to build when you get
  494. 18:56you know how to unlock and all
  495. 18:57things and how to build guardrails
  496. 18:59AI coding right so that AI builds
  497. 19:02very very costefficient token
  498. 19:05system for you to create these
  499. 19:07right and also build guardrail
  500. 19:10that you don't expose your API keys
  501. 19:12security codes outside and you have
  502. 19:15of these patterns well baked in
  503. 19:17you hit the production. So, we're
  504. 19:19to teach all this. It's all going
  505. 19:20be about AI coding and it's all going
  506. 19:22be how you can leverage AI coding to
  507. 19:24your skills to the next level. Hope
  508. 19:25see you guys soon and if you have any
  509. 19:27drop a note to me on Rajes at
  510. 19:29redcodep codepub.a. Call it chase.

Want the next one in your inbox?

Join 1,000+ Product Managers getting one deep dive every Friday.