top | item 46083268

(no title)

hamasho | 3 months ago

  > For example, the other day, it completely forgot about a database connection URL I had given it and started spitting someone else's database URL in the same session.
Something similar happened to me. Our team managed multiple instances for our develop environment. I was working with the instance named <product>-develop-2, and explicitly told Claude Code to use that one.

  $ aws ec2 describe-instances ...
  <product>-develop    # shared develop instance
  <product>-develop-2  # a development instance where a developer can do anything
  <product>-develop-3  # another development instance
  <product>-staging
  <product>-production
Claude used the correct instance for a while, and wrote multiple python one-off scripts to operate on it. But at some point, without any reason, it switched the target to the shared one, <product>-develop. I should have checked the code more carefully, but I didn't pay enough attention to the first few lines of dozens lines of code where all config were written, because it seemed always the same and I was mostly focuced the main function.

  import boto3
  import os
  ...
  AWS_REGION=xxx
  AWS_PROJECT=yyy
  EC2_INSTANCE=<product>-develop  # <- at some point this changed without any reason
  S3_BUCKET=zzz
  ...
  def main():  # <- all my attention is here
      # ~100 lines of code
As a result, it modified the shared instance and caused a little confusion to my team. Luckily it wasn't a big issue. But I was very scared if it targeted the production, and now I'm paying most attention to the config part rather than the main logic.

discuss

order

abenga|3 months ago

It should not be possible to connect to the production database from your local machine, especially if the tool you are using to write and run your code is configured by polite entreaties that can be ignored willy nilly.

hamasho|3 months ago

I mean, yes, our team and I were too lazy to set up things correctly cause we were hurried to ship some AI product only to be replaced later by OpenAI's much better version.

mulquin|3 months ago

Is there a way for you to split the configuration out into a separate file? That way you can tell it to explicitly ignore it altogether.