logoalt Hacker News

bkryzatoday at 10:39 AM35 repliesview on HN

They have an interesting regex for detecting negative sentiment in users prompt which is then logged (explicit content): https://github.com/chatgptprojects/claude-code/blob/642c7f94...

I guess these words are to be avoided...


Replies

BoppreHtoday at 10:59 AM

An LLM company using regexes for sentiment analysis? That's like a truck company using horses to transport parts. Weird choice.

show 25 replies
jacquesmtoday at 8:15 PM

George Carlin would be very pleased. They missed quite a few of the heavy seven though.

joeblautoday at 2:42 PM

We used this in 2011 at the startup I worked for. 20 positive and 20 negative words was good enough to sell Twitter "sentiment analysis" to companies like Apple, Bentley, etc...

show 1 reply
moonteartoday at 11:12 AM

I don't know about avoided, this kind of represents the WTF per minute code quality measurement. When I write WTF as a response to Claude, I would actually love if an Antrhopic engineer would take a look at what mess Claude has created.

show 2 replies
pprotastoday at 1:17 PM

Everyone is commenting how this regex is actually a master optimization move by Anthropic

When in reality this is just what their LLM coding agent came up with when some engineer told it to "log user frustration"

show 1 reply
amichaltoday at 4:31 PM

If this code is real and complete then there are no callers of those methods other than a logger line

ezekgtoday at 2:09 PM

Nice, "wtaf" doesn't match so I think I'm out of the dog house when the clanker hits AGI (probably).

rurptoday at 4:39 PM

I was thinking the opposite. Using those words might be the best way to provide feedback that actually gets considered.

I've been wondering if all of these companies have some system for flagging upset responses. Those cases seem like they are far more likely than average to point to weaknesses in the model and/or potentially dangerous situations.

ZainRiztoday at 2:31 PM

They also have a "keep going" keyword, literally just "continue" or "keep going", just for logging.

I've been using "resume" this whole time

show 1 reply
speedgoosetoday at 12:28 PM

I guess using French words is safe for now.

gilbetrontoday at 1:14 PM

That's undoubtedly to detect frustration signals, a useful metric/signal for UX. The UI equivalent is the user shaking their mouse around or clicking really fast.

mcvtoday at 1:37 PM

I'm clearly way too polite to Claude.

Also:

  // Match "continue" only if it's the entire prompt
  if (lowerInput === 'continue') {
    return true
  }
When it runs into an error, I sometimes tell it "Continue", but sometimes I give it some extra information. Or I put a period behind it. That clearly doesn't give the same behaviour.
show 4 replies
bean469today at 1:28 PM

Curiously "clanker" is not on the list

FranOntanayatoday at 2:46 PM

That looks a bit bare minimum, not the use of regex but rather that it's a single line with a few dozen words. You'd think they'd have a more comprehensive list somewhere and assemble or iterate the regex checks as needed.

alex_duftoday at 12:32 PM

everyone here is commenting how odd it looks to use a regexp for sentiment analysis, but it depends what they're trying to do.

It could be used as a feedback when they do A/B test and they can compare which version of the model is getting more insult than the other. It doesn't matter if the list is exhaustive or even sane, what matters is how you compare it to the other.

Perfect? no. Good and cheap indicator? maybe.

DIVx0today at 3:57 PM

oh I hope they really are paying attention. Even though I'm 100% aware that claude is a clanker, sometimes it just exhibits the most bizarre behavior that it triggers my lizard brain to react to it. That experience troubles me so much that I've mostly stopped using claude code. Claude won't even semi-reliably follow its own policies, sometimes even immediately after you confirm it knows about them.

francisofasciitoday at 12:33 PM

Interesting that expletives and words that are more benign like "frustrating" are all classified the same.

show 1 reply
ozimtoday at 12:30 PM

There is no „stupid” I often write „(this is stupid|are you stupid) fix this”.

And Claude was having in chain of though „user is frustrated” and I wrote to it I am not frustrated just testing prompt optimization where acting like one is frustrated should yield better results.

nicotoday at 3:27 PM

Probably a lot of my prompts have been logged then. I’ve used wtf so many times I’ve lost track. But I guess Claude hasn’t

show 1 reply
sreekanth850today at 11:06 AM

Glad abusing words in my list are not in that. but its surprising that they use regex for sentiments.

1970-01-01today at 12:42 PM

Hmm.. I flag things as 'broken' often and I've been asked to rate my sessions almost daily. Now I see why.

AIorNottoday at 2:44 PM

OMG WTF

johnfntoday at 2:49 PM

Surely "so frustrating" isn't explicit content?

nodjatoday at 10:56 AM

If anyone at anthropic is reading this and wants more logs from me add jfc.

stefanovittitoday at 2:19 PM

so they think that everybody on earth swears only in english?

ccvannormantoday at 1:02 PM

you'd better be careful wth your typos, as well

stainablesteeltoday at 12:54 PM

i dislike LLMs going down that road, i don't want to be punished for being mean to the clanker

alsetmusictoday at 1:56 PM

> terrible

I know I used this word two days ago when I went through three rounds of an agent telling me that it fixed three things without actually changing them.

I think starting a new session and telling it that the previous agent's work / state was terrible (so explain what happened) is pretty unremarkable. It's certainly not saying "fuck you". I think this is a little silly.

dheerajmptoday at 11:28 AM

Yeah, this is crazy

smeftoday at 12:02 PM

so frustrating..

anoncoward_nltoday at 2:12 PM

[dead]

saadn92today at 2:46 PM

[dead]

raihansaputratoday at 10:49 AM

i wish that's for their logging/alert. i definitely gauge model's performance by how much those words i type when i'm frustrated in driving claude code.

samuelknighttoday at 11:47 AM

Ridiculous string comparisons on long chains of logic are a hallmark of vibe-coding.

show 2 replies