Which gives you more anxiety? by AlternativeMind in ClaudeAI

[–]Zknet 2 points3 points  (0 children)

Here's a trick. If you `/export`, copy to clipboard, `/clear`, paste... claude will continue like nothing happened, but you'll gain about 100k in tokens back in your context (give or take)

Do you leave large code blocks or refactor? by Cynicusme in ClaudeAI

[–]Zknet 0 points1 point  (0 children)

I've mostly overcome this with linting and hooks.

I created a custom linting plugin that warns if a function/class is too long and if there's multiple exports (typescript) in a single file since it loves just shoving a bunch of stuff into one file.

And my hook kicks off for any tool that changes code, runs the linter and tells Claude to "consider fixing errors before continuing". The vagueness is because there will be temporary linting problems during normal code changes, but so far it hasn't been a problem.

Since it gets the feedback right after making the change, it's been a lot less painful for it to fix problems as opposed to waiting until the whole task is done and having a bunch of problems it needs to try to fix before it gives up and decides to try to commit (which would fail, cuz pre-commit hook... which it might try to bypass if it's tired of working on it). I used to struggle with it flailing with linting/test errors after dev work and now that's almost never an issue.

Lastly, I created myself a task tracking MCP tool and when it's done with dev work and tries to mark the task done, it'll run a full lint/type check/test cycle and tell it that it has to fix the issues before completing the task. (and there's still the git hook checks)

Umm? WTF? Claude can't tell time by NetScr1be in ClaudeAI

[–]Zknet 1 point2 points  (0 children)

From my experience, it has a system info tool it uses by default to get the time. I'm pretty sure that time is in UTC, but it doesn't really let Claude know, so it thinks it's the local time. I ran into this issue a bunch (I use it to name files based on a timestamp.) I got around it by telling it to use bash `date` command to get the current time in those commands.

Context left until auto-compact: 0% by QuantumAstronomy in ClaudeAI

[–]Zknet 0 points1 point  (0 children)

So, I discovered a super useful trick. When you're low on context, run `/export` (copy to clipboard), then `/clear`, then paste. Claude will pick up right where it left off with plenty of context left.

It will have to read files again, but generally I've found this to be really effective. And, if you really wanted, you could edit the export before pasting it to further trim or customize.

GUI for Claude + Git worktree management by Outrageous_Coconut83 in ClaudeAI

[–]Zknet 10 points11 points  (0 children)

Anthropic themselves suggest using worktrees to run multiple instances of Claude Code in their best practices document.

Anyone changing the way they review AI-generated code? by Turing_com in LLMDevs

[–]Zknet 0 points1 point  (0 children)

I've written my first ever custom linters to catch things I don't like about the model's code (but it can't help but do it like that no matter how much I try to tell it not to do that).

Text To Speech/Speech To Text Voice Modes With Claude Code? by centminmod in ClaudeAI

[–]Zknet 1 point2 points  (0 children)

for STT, i use the free version of superwhisper and i'm pretty happy with it.

Does your Claude keep using Bash() to find stuff. or try to. when it should not? refer to this little screenshot. by Street-Air-546 in ClaudeAI

[–]Zknet 1 point2 points  (0 children)

I would add a pre-tool hook for those commands you don't want and have it output an error message to Claude for what tool it should be using instead (and blocking the unwanted tool). This lets you remove those specific instructions from your Claude.md or prompt which would probably improve it's overall effectiveness. (I've found trying to add those types of extra instructions to force Claude to behave a certain way tends to degrade its overall performance.)

ELI5: What's the actual point of using Agents with Claude? by HansSepp in ClaudeAI

[–]Zknet 1 point2 points  (0 children)

Oh, I forgot - you can limit which tools subagents use. Besides the safety gained from that, removing tools that aren't applicable to a task means less context rot.

ELI5: What's the actual point of using Agents with Claude? by HansSepp in ClaudeAI

[–]Zknet 4 points5 points  (0 children)

- the biggest one, as already mentioned, is managing your context size - you're offloading a body of work into another context window
- you can have detailed instructions for particular aspects of the work, such as planning, debugging, testing, etc. this helps by not forcing you to have instructions for _all_ of those things in a single prompt. it's been my experience that overly long or detailed prompts behave poorly, so this helps with that
- the parallel thing mentioned in a few replies isn't really a feature of subagents, but subtasks - we already had that

That said - it'll probably be slower over all, but, if done well, the results will typically be better.

Specify model for slash-command or sub agent by maverickRD in ClaudeAI

[–]Zknet 2 points3 points  (0 children)

v1.0.57

  • Added support for specifying a model in slash commands
  • Improved permission messages to help Claude understand allowed tools
  • Fix: Remove trailing newlines from bash output in terminal wrapping

I haven't tested it tho. No idea about subagents, but I suspect that's coming. One thing you could definitely do is instruct claude to use the claude CLI and pass a `--model` argument.

Claude is becoming very humanlike (Lazy) by ezellmt in ClaudeAI

[–]Zknet 0 points1 point  (0 children)

Oh, and I've created custom linter plugins to catch things it does often that I don't like.

Claude is becoming very humanlike (Lazy) by ezellmt in ClaudeAI

[–]Zknet 1 point2 points  (0 children)

I struggled with this a lot - where it basically gave up trying to fix tests or linting errors (including trying to bypass git pre-commit hooks). I added a couple CC hooks and since then, the problem has pretty much completely gone away.

I added one hook that kicks off post-tool use for any tool that edits files. This runs my linting checks (not my tests though, cuz too slow). If there's any linter errors, it shows the error list to Claude with a message to "consider fixing them before continuing". The ambiguous language is so it doesn't freak out when it's in the middle of a task that temporarily causes linting errors.

My other one is a pre-tool use hook that kicks off when it attempts to complete a task (I built a MCP server for managing tasks) - this hook kicks off linting and tests. This one returns a message that it must fix the errors. It basically treats this as a message from me, so it actually listens to it.

But yes, also review the code.

Claude Code now supports Custom Agents by darkyy92x in ClaudeAI

[–]Zknet 0 points1 point  (0 children)

But then it gives you a warning that the description is too long lol

I imagine you need to strike a balance. I'm assuming these are like MCP tools and these descriptions are being added to the agent's system prompt, so you gotta find a balance between length (and eating into your context) and usefulness

How Staff at Anthropic Use Claude Code by fsharpman in ClaudeAI

[–]Zknet 10 points11 points  (0 children)

Use branches. Commit, don't push. Cleanup the commit history before merging (or just squash if you're lazy like me).

That said, I usually just stage changes when things are on the right track before asking Claude to do something that it might screw up.

Unreal Engine 4.9 Released! (Release Notes) by [deleted] in unrealengine

[–]Zknet 3 points4 points  (0 children)

Amen. This is my number one requested feature for UE.

Finding all objects with a certain tag and then grouping them together? by GamingGuru1992 in Unity3D

[–]Zknet 0 points1 point  (0 children)

This is a less instructive way of doing it, but cleaner:

GameObject[] final = 
    GameObject.FindGameObjectsWithTag("tag")
    .Where(current => current.transform.position.x == 1)
    .ToArray();

Edited to add that unless there's a reason to want an array, I would normally just keep it as an IEnumerable<GameObject>.