r/devops • • 1d ago

Architecture How are you guys handling AI tooling?

Over the last like 6 months the amount of tools , agent guardrails, and prompts our repositories has skyrocketed. Some of the repositories the agents config dwarf the actual code 3-to-1. Every time I bring it up and try to come up with some kinda consolidation plan it gets shot down. And I’m not really sure what to do, I just did a small prompt to ask a question and it the context window had 80k tokens instantly dumped in it from all the tools and other crap(this is on top of the system baseline) . It definitely doesn’t feel sustainable but this kinda development is so new I have no good baseline. 4 years ago if you had 5K likes of just “documentation” in your repo people would call you a madman. I’m curious what others are doing. I did a little searching and the advice fell into 2 camps. “Just build your own harness bro” and “Call out sales team to set up a demo . First 30 days of usage is free”

1 Upvotes

11 comments sorted by

4

u/Starks1293 1d ago

80k before u even ask anything is usually two things, tool descriptions and instruction files, and both can shrink without a big consolidation plan

run /context in claude code on a fresh session (other clis have something similar). it splits that number into mcp tools, memory files, system etc. thats ur baseline, and its way easier to win the argument with a number than with a plan

mcp servers tend to be the worst bit. every server loads all its tool descriptions on every turn whether u call them or not, so move them out of the global config into only the projects that need them and drop the ones nobody uses

keep the root CLAUDE.md / AGENTS.md short, more a map of where things live than a manual. the detail goes in files next to the code its about, claude code only pulls a subfolder's CLAUDE.md in when it works in that folder. and any rule that can be a test or a lint should be one, then delete the prose. half the "never do x" lines get ignored anyway, a failing test doesnt

the 3-to-1 thing is mostly the same guardrails copied into every repo imo. a CLAUDE.md can import a shared file, one copy beats ten drifting apart

1

u/Amekaze 1d ago

Trust me I try, but every time I remove anything from one of the agents files it usually gets blocked. Current leadership is using the agent files more like an incident tracker, basically any time an agent does something that they don’t like it has be explicitly stated somewhere that agent should don’t that exact same thing again(even if we catch the issue before it gets deployed) . I guess it makes them feel better. And for some good awful reason they want the repo’s the be isolated. They don’t want any repo to be “dependent on” any other repo so a centralized Claude me file is out. I think it’s primarily because one of the leads REALLY wants to nuke all of our other repos and consolidate literally everything into a giant mono repo. The code base is like 7 years old reorganizing everything would be stupid . But I’m one of the newest members and I don’t have much weight to throw around. It clearly some kinda power struggle going on with the new owners but I’m not in those exec meetings.

1

u/Starks1293 23h ago

ah ok so those lines are more a paper trail for leadership than instructions for the agent. that changes it, u probably dont need to delete anything, just move where it lives

keep the incident list but in its own file that isnt auto loaded, like docs/agent-incidents.md, one line per incident with the date. the root file just says read it before touching deploys or whatever area it covers. leadership still sees every "never again" written down and the agent stops paying for all of them on every single prompt

and the ones that really matter become hooks instead of prose. claude code has PreToolUse hooks that can block a command before it runs, so "never run terraform apply against prod" turns into an actual block, not a sentence the model might skip. thats an easier sell too coz its stricter than what they have now, nobody blocks a change that makes the guardrail harder

works fine with the isolation rule as well, every repo keeps its own copy, its just a lot smaller

3

u/tubameister 1d ago

friend of mine in finance told me they're using the BMAD method.. https://github.com/bmad-code-org/BMAD-METHOD

3

u/Ok_Tip9357 1d ago

curious how well that holds up on legacy codebases vs greenfield stuff

2

u/Strange-Sea-9894 22h ago

The biggest trap we ran into over the last 6 months was treating Markdown rules files (CLAUDE.md, cursor rules, prompt snippets) as actual governance. They drift across repos immediately and models still violate them under edge cases.

Three things that actually brought order without slowing developers down:

  1. Move hard guardrails out of prompts and into deterministic runtime hooks and CI checks. A November arXiv study (2611.19549) showed prompt rules still fail on destructive commands, whereas in-loop runtime contracts drove violations to 0 across 104 paired runs with no drop in task completion.
  2. Put every AI tool behind a single internal LLM gateway (like LiteLLM) with per-team monthly USD spend caps and num_retries: 0 (when orchestrators already retry, gateway retries cause silent double-billing on provider hiccups). Zero raw API keys in individual repos.
  3. Audit your most-copied reference modules for old security bugs. ETH Zurich (arXiv:2611.11455) just showed coding agents copy insecure patterns from neighboring files in 76.5% of vulnerable runs even when they recognize the bug 69.9% of the time. Keeping 1 clean golden template repo per stack pays back way faster than writing 500 lines of prompt rules.

1

u/TorrentsAreCommunism 12h ago

I just tell Hermes to handle it for me.

1

u/Striking-Army-4650 10h ago

Are those 80k tokens mostly repeated repository instructions, tool schemas or retrieval results? The fix might look pretty different depending on whats consuming the context before work begin