[00:00] (0.40s)
Hey, my name is Greg. I'm a developer
[00:02] (2.56s)
and over the last few months, Claude
[00:04] (4.72s)
Code has become my default way of
[00:07] (7.20s)
writing code. And so in this video, I
[00:09] (9.52s)
want to walk you through some Claude
[00:11] (11.04s)
Code pro tips. These pro tips are
[00:13] (13.60s)
primarily based on this post written by
[00:16] (16.40s)
Boris Churnney, who's the creator of
[00:18] (18.24s)
Claude Code at Enthropic. And we're
[00:21] (21.04s)
going to go through these uh pro tips
[00:23] (23.60s)
pretty quickly. First tip, cla code is a
[00:25] (25.92s)
CLI. So all the things that you're used
[00:27] (27.68s)
to doing with other bashbased CLIs, you
[00:30] (30.08s)
can probably do with cloud code. For
[00:31] (31.84s)
instance, you can pass in command line
[00:33] (33.76s)
arguments which will be run on startup.
[00:36] (36.40s)
You can use -p to run it in headless
[00:39] (39.20s)
mode. You can chain it with other
[00:41] (41.12s)
command line tools. You can pipe data
[00:43] (43.68s)
into it. You can run multiple instances
[00:46] (46.56s)
of it at once. You can actually have
[00:49] (49.52s)
cloud code launch instances of claude
[00:52] (52.88s)
code. In fact, anytime you ask it to
[00:54] (54.96s)
spin up a sub agent or anytime you see
[00:57] (57.44s)
task, that's exactly what clog code is
[01:00] (60.08s)
doing. Next category, images. You can
[01:03] (63.20s)
use an image simply by dragging it in to
[01:05] (65.84s)
the terminal on OSX. You can use shift
[01:09] (69.60s)
command control 4 to copy the screenshot
[01:14] (74.00s)
and then use controlV to paste it into
[01:16] (76.48s)
claude. That's controlV, not commandV
[01:19] (79.68s)
like you're used to. There's two ways
[01:22] (82.16s)
that you might find yourself using
[01:23] (83.92s)
images a lot. The first is mockups. You
[01:26] (86.88s)
can design a mockup, paste the mockup
[01:29] (89.12s)
into Claude, and then ask it to build
[01:32] (92.32s)
that interface. Second, you can use
[01:35] (95.04s)
images to close the feedback loop with
[01:36] (96.88s)
Claude. Ask it to build something, open
[01:39] (99.28s)
up what it built, and then take a
[01:40] (100.88s)
screenshot, feed that back into Claude,
[01:43] (103.12s)
and it's pretty good at iterating when
[01:45] (105.12s)
you're giving it feedback. Now, that's a
[01:47] (107.76s)
manual process for taking images. You
[01:49] (109.68s)
can also automate the screenshotting by
[01:52] (112.56s)
using the Puppeteer MCP server, which is
[01:55] (115.12s)
pretty easy to set up and run locally.
[01:57] (117.28s)
Then you can ask Claude to use Puppeteer
[02:00] (120.48s)
to go open up the app, take a screenshot
[02:03] (123.76s)
of it, and it can save those screenshots
[02:05] (125.84s)
to your local directory. Speaking of MCP
[02:08] (128.88s)
service, Cloud Code can function as both
[02:11] (131.44s)
an MCP server and an MCP client. So that
[02:15] (135.76s)
means that you can actually turn clogged
[02:17] (137.68s)
code into an MCP server that can then be
[02:20] (140.48s)
used by other agents. There's a whole
[02:22] (142.40s)
bunch of MCP servers that you could use.
[02:24] (144.56s)
It would be a whole video on its own
[02:26] (146.40s)
just to go through some of the most
[02:28] (148.00s)
popular ones. So we'll just hit a
[02:29] (149.52s)
couple. For instance, you might find it
[02:31] (151.44s)
useful to use the Postgres server to
[02:33] (153.68s)
hook up Cloud Code directly to your
[02:35] (155.52s)
database. You can use MCP servers that
[02:38] (158.00s)
are effectively wrappers around APIs.
[02:40] (160.72s)
Other dev tool companies like Cloudflare
[02:43] (163.12s)
are using their MCP servers to provide
[02:45] (165.92s)
up-to-date documentation to Claude. Not
[02:49] (169.36s)
all dev tool companies are making their
[02:50] (170.96s)
docs available via MCP just yet. So if
[02:54] (174.08s)
you just paste in a link, Claude code
[02:56] (176.24s)
can fetch that URL and then use those
[02:58] (178.72s)
docs to build against. You might also
[03:00] (180.80s)
want to use fetch URLs to retrieve
[03:03] (183.52s)
knowledge from the world that you use in
[03:05] (185.12s)
your app. For instance, I built a game
[03:07] (187.28s)
for my four-year-old daughter that was
[03:09] (189.44s)
uh Bluey Uno. Instead of trying to
[03:12] (192.72s)
describe the rules myself or relying on
[03:15] (195.44s)
the training data for Uno rules, I
[03:18] (198.00s)
pasted in
[03:19] (199.08s)
unorules.com and had Claude code the
[03:21] (201.76s)
gaming logic based on what it read
[03:23] (203.76s)
there. Next category, claude.mmd. This
[03:26] (206.56s)
is actually the first pro tip that's
[03:28] (208.56s)
mentioned in Boris's post. A claw.md is
[03:32] (212.16s)
a prompt that is loaded with every
[03:34] (214.48s)
request that you make to claude code.
[03:37] (217.12s)
This might include instructions for your
[03:39] (219.68s)
project such as common bash commands to
[03:41] (221.92s)
use, style guidelines, linting
[03:43] (223.92s)
guidelines, how to run your tests,
[03:46] (226.16s)
repository etiquette. If you type /init
[03:49] (229.44s)
after you launch claude in a directory,
[03:52] (232.56s)
it will create this claude. MD file for
[03:55] (235.20s)
you after scanning the directory and
[03:58] (238.24s)
summarizing its structure. If as you're
[04:00] (240.80s)
coding you want to add instructions to
[04:04] (244.16s)
the cloud.MD, you can use the hash sign.
[04:07] (247.84s)
You can also set a global cloud. MD in
[04:10] (250.96s)
your home
[04:13] (253.08s)
directory/cloud. This will be loaded
[04:14] (254.96s)
anytime that you're using cloud code
[04:16] (256.64s)
across any project. You can also add a
[04:19] (259.20s)
cloud.md file in subdirectories. You
[04:21] (261.92s)
should also refactor your cla.md files
[04:24] (264.48s)
often. So, it's common for them to grow
[04:27] (267.12s)
in complexity as you continue to work on
[04:29] (269.92s)
a project. But remember that this is a
[04:32] (272.32s)
prompt that is being loaded on every
[04:35] (275.20s)
turn of conversation with clawed code.
[04:38] (278.56s)
And these models do much better the more
[04:41] (281.04s)
specific you are. So, you don't want
[04:43] (283.52s)
this to be crammed with a bunch of
[04:45] (285.64s)
duplicative extraneous information. You
[04:48] (288.64s)
can use Anthropic's prompt optimizer
[04:51] (291.20s)
tool to help you write better cla.md
[04:54] (294.32s)
files. Slash commands. You can define
[04:56] (296.80s)
these in
[04:58] (298.36s)
thecloud/comands folder, and they're
[05:00] (300.24s)
just prompts. So, for instance, here's
[05:02] (302.24s)
one mentioned in Boris's post about
[05:05] (305.04s)
solving GitHub issues. You might write a
[05:07] (307.76s)
slash command for refactoring. You might
[05:10] (310.32s)
write a slash command for linting. You
[05:12] (312.88s)
might write a slash command for
[05:14] (314.40s)
reviewing a PR. slash commands are
[05:17] (317.20s)
prompt templates. So you can pass
[05:19] (319.28s)
command line arguments when you run the
[05:21] (321.52s)
slash command that will then be
[05:23] (323.76s)
interpolated into the prompt
[05:25] (325.96s)
template. Couple of UI tips. One, you
[05:29] (329.52s)
can use tab to complete files and
[05:32] (332.44s)
directories. Cloud code does better the
[05:35] (335.12s)
more specific you are. So if you can
[05:37] (337.28s)
actually let it know what files or what
[05:39] (339.68s)
directories to work with, you'll
[05:41] (341.04s)
generally get better results. Hit escape
[05:43] (343.68s)
often. I know that I when I started was
[05:46] (346.72s)
hesitant to interrupt Claude when I saw
[05:49] (349.28s)
it going off path, but you will find
[05:51] (351.68s)
your sessions go so much better if you
[05:54] (354.00s)
just stop Claude as soon as you see it
[05:55] (355.84s)
go in the wrong direction. You can hit
[05:57] (357.36s)
escape and ask it to undo its work from
[06:00] (360.24s)
the previous turn. And that will help
[06:02] (362.24s)
you go back as well. Speaking of undoing
[06:04] (364.80s)
Claude's work, I think the biggest
[06:06] (366.56s)
failure mode here when working with
[06:08] (368.64s)
Cloud Code is you use it to build a
[06:11] (371.20s)
project. You get that project to a place
[06:12] (372.88s)
where it's working really well, and then
[06:14] (374.80s)
it gets overly ambitious, does a bit too
[06:17] (377.44s)
much, makes breaking changes, and then
[06:19] (379.76s)
you have a hard time rolling them back.
[06:22] (382.00s)
And the easiest way to mitigate this
[06:24] (384.48s)
failure state is to use Cloud Code in
[06:27] (387.36s)
conjunction with version control. Ask
[06:30] (390.00s)
Cloud Code to commit after every major
[06:32] (392.56s)
change. Have Claude Code write your
[06:34] (394.64s)
commit messages. there's a good chance
[06:36] (396.48s)
they'll be the best commit messages that
[06:38] (398.40s)
have ever been submitted to a repository
[06:40] (400.40s)
that you own. When working with Claude
[06:42] (402.64s)
code, revert more often than what you're
[06:44] (404.96s)
used to. Often times, the best way to
[06:47] (407.28s)
fix things is just to clear out the
[06:49] (409.28s)
conversation history in Claude, revert
[06:51] (411.52s)
back to a previous save point, and try
[06:53] (413.84s)
again with slightly more specific
[06:55] (415.72s)
instructions. Install the GitHub CLI,
[06:58] (418.96s)
and it will use this for all of its
[07:00] (420.64s)
interactions with GitHub. If for some
[07:03] (423.12s)
reason you don't want to install this
[07:04] (424.40s)
tool, you can also interact with GitHub
[07:06] (426.96s)
via the GitHub MCP server. You can have
[07:09] (429.68s)
Cloud Code file PRs for you. You can
[07:13] (433.04s)
have Claude Code do code reviews on
[07:15] (435.60s)
those PRs. Managing context can
[07:18] (438.56s)
certainly be a bit of a challenge when
[07:20] (440.48s)
working with Claude Code. You want to
[07:22] (442.40s)
always keep an eye on the auto
[07:24] (444.48s)
compacting indicator. You always want to
[07:26] (446.56s)
know about how long you have until
[07:29] (449.36s)
Claude autoco compacts. prematurely
[07:32] (452.48s)
compact when you're at natural break
[07:34] (454.56s)
points. So if you see you're 35% of the
[07:36] (456.96s)
way to autoco compacting and you just
[07:38] (458.64s)
finished up a task, you just made a
[07:40] (460.56s)
commit, you might just want to go ahead
[07:42] (462.56s)
compact right there and start the next
[07:45] (465.04s)
task with all of the tokens available to
[07:47] (467.52s)
you. Also consider often clearing
[07:50] (470.24s)
instead of compacting. Work in such a
[07:53] (473.04s)
way that you can use claude code with
[07:56] (476.56s)
fresh memory. One way to do this is to
[07:59] (479.04s)
tell Claude to use scratchpads to plan
[08:02] (482.40s)
its work. Alternative to Scratchpads,
[08:05] (485.04s)
you can use GitHub issues. If you are
[08:07] (487.36s)
paying per token, then you're going to
[08:09] (489.92s)
really want to monitor that uh context
[08:13] (493.52s)
window usage and you're going to want to
[08:15] (495.36s)
use external memory as much as possible.
[08:17] (497.60s)
If you're looking for more robust cost
[08:19] (499.84s)
tracking across a team, for instance,
[08:22] (502.40s)
one way to achieve that is by using
[08:24] (504.88s)
Cloud Code's open telemetry support. So,
[08:28] (508.00s)
for instance, you could hook up Claude
[08:29] (509.52s)
Code to Data Dog and produce dashboards
[08:32] (512.08s)
that look like this. And for more
[08:34] (514.00s)
details on this, you should check out
[08:35] (515.36s)
Martin AMP's blog post, which is linked
[08:37] (517.36s)
in the description. But in my opinion,
[08:39] (519.28s)
the best way to manage your cost is just
[08:41] (521.44s)
to upgrade to one of those Claude Max
[08:43] (523.52s)
plans at either $100 or $200. I'm on the
[08:47] (527.12s)
$100 plan. I spent about
[08:49] (529.40s)
$150 worth of Claude Code tokens over
[08:52] (532.56s)
the course of about 3 days. If there's a
[08:55] (535.12s)
common complaint of Claude Code, it is
[08:57] (537.36s)
it's very expensive. So, I was very
[08:59] (539.84s)
excited to see Claude Code use bundled
[09:02] (542.56s)
in with Claude Max. I don't even know if
[09:05] (545.12s)
I got through half of the pro tips that
[09:08] (548.40s)
are included in this post. If you want
[09:10] (550.40s)
to learn more, uh, check out this
[09:12] (552.88s)
excellent post here by Boris and check
[09:15] (555.52s)
out some of the other links that I left
[09:17] (557.12s)
below in the description.