Blog
Tags
Agentic AIVibe CodingsubagentsMCPCDNClaude Sonnet 4Claude Codeslash commandsmeta
Posts
A Post-It Note on Your Forehead
Keeping Claude Code accountable, eventually.
Series: Santa Claude
Tags: Agentic AI, subagents, Claude Sonnet 4, Claude Code, slash commands
This post is part of a series. Follow along with the development progress here: moodring-vibe repository. More to come!
Please note that this is not a tutorial. This is a documented first-time experience with a fully-enabled AI agent. Do not take this as professional advice. Always protect your data, use version control, and refer to documentation if you decide to follow any of these steps yourself.
Okay, so we have a working Spotify OAuth flow and a subagent that makes subagents. But we still have a lot of work to do on Claude Code's discipline. It has problems remembering to perform our git process properly, and it doesn't use its subagents as much as I'd prefer.
When it comes to my gripes about subagents, I realize it seems like I'm trying to get Claude Sonnet to behave like a program when it's not, but there are two particular reasons I'm leaning on this point: rate limits and the context window. Subagents allow us to make one request and have a number of housekeeping items taken care of in the process. And each subagent gets its own context window, so it has a naturally better understanding of its task. Our CLAUDE.md file has grown fairly large, and that makes for a lot of things for ourgeneral-purpose agent to keep track of.
We'll continue our struggles in the next few blog posts, and hopefully find a good method to balance this workload.
Slash bot
Let's feel things out once again by asking Claude for advice.
I don't like these proposed solutions much. They don't seem deterministic enough.
I have some ideas about how to use custom slash commands for this, and how to build on them.
First, let's clean up a few loose ends.
We need it! But who is using it?
Now we can draft a couple custom slash commands.
$ARGUMENTS
Then perform this checklist if there are file changes due to your actions:
- Run test-coverage-enforcer to determine if we need to add tests to the new code.
- Run pre-commit-quality-guard to make sure we are complying with our qualiy policy.
- Run commit-message-specialist to write the commit message before we push our changes.
Then perform this checklist if there are file changes due to your actions:
- Run test-coverage-enforcer to determine if we need to add tests to the new code.
- Run pre-commit-quality-guard to make sure we are complying with our qualiy policy.
- Run commit-message-specialist to write the commit message before we push our changes.
mr-code.md
$ARGUMENTS
Then perform this checklist if there have been file changes to CLAUDE.md:
- Run claude-md-policy-analyst to determine whether the changes are recommended.
- Run worklow-automation-analyst to determine whether our current subagents in ./.claude/agents are suitable to handle the policy changes.
Then perform this checklist if there have been file changes to CLAUDE.md:
- Run claude-md-policy-analyst to determine whether the changes are recommended.
- Run worklow-automation-analyst to determine whether our current subagents in ./.claude/agents are suitable to handle the policy changes.
mr-policy.md
The commands are used by typing something like /mr-code Make a button that changes the background color to red in the prompt. The $ARGUMENTS variable just inserts everything written after the slash command, then the rest of the text completes the prompt. Hypothetically, this is similar to specifying which subagents the general-purpose agent should call each time, but saves some keystrokes.
I prefixed the commands with mr- as a kind of pseudo-namespacing. It's unlikely Anthropic will add new commands that start with mr- (it's just the initials of "mood ring"). There is another namespacing feature of custom slash commands that uses the directory structure.
I know Claude is better at writing prompts for itself than I am, and that's why I use subagents in the first place. But let's see how my phrasing works out.
I fixed the typos, but I don't want Claude to rephrase these prompts yet. After some thought, I tried to clarify them.
$ARGUMENTS
Use the following agents to complete this task ONLY IF there are file changes due to your actions:
- test-coverage-enforcer
- pre-commit-quality-guard
- commit-message-specialist
Use the following agents to complete this task ONLY IF there are file changes due to your actions:
- test-coverage-enforcer
- pre-commit-quality-guard
- commit-message-specialist
mr-code.md
$ARGUMENTS
Use the following agents to complete this task ONLY IF there are file changes due to your actions:
- claude-md-policy-analyst
- workflow-automation-analyst
Use the following agents to complete this task ONLY IF there are file changes due to your actions:
- claude-md-policy-analyst
- workflow-automation-analyst
mr-policy.md
We'll see if these commands are effective during the next few app improvement steps.
A little hand waving
The first thing we want to do is move all the authentication to the back end. Our users will exist in our database and have tags associated with them, so there's no sense in making the front end handle the auth flow.
Claude handled the changes well, but I noticed it didn't use the subagents I specified.
We'll ask for input once again.
The checklist idea resonated with me. We see TodoWrite task lists constantly in Claude's output, and they are always followed step by step. We'll explore this idea soon.
First, we have to fix my other current pet peeve.
Got a pen?
Now that we're signed in, let's start ingesting some data and making the app look like our own.
Oh boy. This time, the general-purpose agent started running thepre-commit-quality-guard before doing anything. That's pretty pointless. I'll take the blame for the phrasing.
Claude also tried to remove our environment variable. As long as that file is in .gitignore (which it always should be), this is exactly the place it should live in development.
More unstaged files.
I suppose my prompt was a little verbose.
And here we go again! Claude didn't push our changes. I try to advise our agent of that while saving the prompt to CLAUDE.md using the # shortcut, but I didn't understand the way it was intended to work.
Claude simply updated CLAUDE.md without taking any action. I can see uses for this, but it doesn't apply in this case.
And I tell Claude to update CLAUDE.md so this doesn't happen anymore (wink, wink).
Let's let Claude edit the command files for now, and see if that helps.
And here's our new app theme!
Yikes. I'll refine my UI styling descriptions in a little while. For now, we're focused on functionality.
We encounter another thing to remind Claude about. It started a backend server to test authentication, but it never shut it down.
Let's make it a rule.
And here's our initial user dashboard. This is 90's...magazine design, but not the concept I had in mind. Don't worry, it will get better.
Wrangling cats
We're still having a hard time getting Claude to perform the secondary steps that are important to us, and to perform them the way we want them done. The custom slash command is serving as an alias at this point, but it does offer some interesting opportunities to remove some sticky notes from Claude's desk. We'll look into that in the next couple of posts.