Skip to content
Software and product teams

Claude Code Internal Tooling for Software Teams: Issues to Draft PRs

A worked example of how a software team can run Claude Code inside its own repository and CI, with permission limits, hooks and human review, so bug reports become draft pull requests.

How can a software team use Claude Code as internal tooling?

A team can run Claude Code on its own machines or in CI, with fixed prompts and tight permissions, so that routine engineering chores are drafted automatically and a developer reviews the result. Typical chores are turning a bug report into a failing test and a proposed fix, writing release notes, or summarizing build failures. Claude Code does not merge to your main branch, touch production or hold your deployment secrets in this setup. This page is an illustrative scenario, not a client result. Website Prism has no published agent deployments, so it shows how we would configure and supervise one, using Claude Code's documented controls.

What is included
01

A short review of your repository, CI and branching rules to pick two or three chores where a draft is worth having and a wrong answer is cheap to catch.

02

A project instructions file (CLAUDE.md) covering your conventions, commands for tests and linting, and the areas the agent must not touch.

03

A permissions setup that allows only the commands each job needs, and a fixed non-interactive mode for unattended runs so no step waits for a prompt that nobody sees.

04

Hooks that run before tool calls and block specific actions, such as editing migration files or reading environment files, with a clear message back to the agent.

05

A GitHub Actions or equivalent workflow that triggers the job from an issue label or mention, caps the number of turns, and opens a draft pull request, not a merge.

06

Small internal scripts that call Claude Code non-interactively and return JSON that matches a schema, for jobs such as release notes or log summaries.

07

A logging step recording prompt version, commands run, files changed and cost per run, kept next to your CI history.

08

A written runbook for the team: how to trigger a run, how to review its pull requests, how to switch it off, and who owns the instructions file.

What counts as Claude Code internal tooling, and what does not?

Two things get called by this name, and they need different care.

  • Developers using Claude Code interactively in their terminal or editor. This is personal tooling, governed by team conventions and the permissions each developer approves.
  • Claude Code running unattended on a trigger, such as a labelled issue or a nightly job. This is internal tooling in the sense of this page: a repeatable job with fixed instructions, limited permissions and a defined output.

Anthropic's documentation says the same agent loop and tools are available in non-interactive form through claude -p, and as Python and TypeScript packages for fuller control. This page concentrates on the unattended kind, because that is where limits matter most. Our agentic AI and Claude Code development page describes the wider service, and the post on Claude Code for business automation covers non-engineering uses.

Illustrative scenario: a bug report becomes a draft pull request

An invented example, not a client result. A product team keeps its code on GitHub. A support engineer labels an issue claude-draft after confirming it describes a real, reproducible bug. The pipeline then runs in four gates.

  1. Gate one: trigger and identity.
    • Input: the issue text and the label event.
    • Check: the person who applied the label has write access. Anthropic's GitHub Actions documentation says the action checks that a triggering user has write access, and rejects bot actors unless they are listed.
  2. Gate two: reading.
    • The agent reads the issue, the instructions file and the relevant source directories on a fresh checkout.
    • It runs the existing tests to see a baseline.
  3. Gate three: working under limits.
    • Tools allowed: read and edit files, run the test and lint commands you listed, nothing else.
    • It writes a failing test that reproduces the bug, then a minimal fix, then re-runs the tests.
    • A turn cap ends the run if it wanders. A pre-tool hook blocks edits to files you marked off limits.
  4. Gate four: human review.
    • Output: a draft pull request on a new branch, with a description of what changed and what the agent could not verify.
    • Branch protection requires your normal CI and a developer's approval. The agent cannot merge.
    • Audit: the run record lists the prompt version, the commands executed, the files touched and the cost.

If the developer finds the fix wrong, they close the pull request or comment, and the outcome is recorded as a rejection for later review.

Which guardrails should exist before the first run?

  • Allow-listed commands. Claude Code's --allowedTools option takes permission rules such as Bash(git diff *), which allow a command prefix. List what the job needs.
  • No prompts nobody can answer. Anthropic documents a dontAsk permission mode that denies any call that would otherwise prompt, intended for locked-down CI runs.
  • Hooks for hard stops. The hooks documentation says a PreToolUse hook can block a tool call by exiting with code 2, with its message passed back to the agent.
  • Bounded runs. Cap the turns with --max-turns and set a workflow timeout, as the GitHub Actions guidance suggests for cost control.
  • Secrets out of reach. The API key sits in the CI secret store. No production credentials, deployment tokens or customer data are present in the job's environment.
  • Predictable startup. The documentation recommends --bare for scripted calls so that every machine loads the same configuration. Check the current docs, since defaults change.
  • Narrow app permissions. The official GitHub app asks for a wider permission set than this action uses. Anthropic's page describes a custom app limited to contents, issues and pull requests for teams that need that.

For the security habits we check in AI-assisted code, see AI coding tool security mistakes.

What does the agent do alone, with approval, and never?

AreaAloneNeeds a developerNever
Reading code, issues and CI logsYes
Writing tests and edits on a new branchYes
Opening a draft pull requestYes
Merging, approving its own changeA developer mergesSelf-approval
Changing dependencies or CI configurationYes
Database migrationsBlocked by hook; human writes
Deploying, rotating secrets, touching production dataYes
Force-pushing or deleting branchesYes

What goes wrong in practice?

  • The fix passes the new test but breaks something untested. The pull request states what was and was not run, and your normal CI and review still apply. The agent adds evidence; it does not replace judgment.
  • The issue text is hostile or misleading. Issue bodies are untrusted input. With no network tools, no secrets and a narrow allow-list, injected text has little to act on.
  • The run loops or burns budget. The turn cap and timeout end it, and the log shows what it spent.
  • The agent edits files it should not. A pre-tool hook blocks the call; repeated blocks are visible in the log and prompt a review of the instructions file.
  • Instructions go stale. The instructions file has a named owner and is reviewed when the build commands or conventions change.
  • CI does not run on the agent's commits. Anthropic's troubleshooting notes warn that GitHub does not trigger workflows on commits made with the default workflow token, so authentication is set up to avoid that.

How would success be measured?

We would not promise a time saving. We would track:

  1. Draft acceptance: pull requests merged after review, merged after heavy edits, and closed.
  2. Review effort: time a developer spends per agent pull request, compared with similar human-written ones.
  3. Escaped defects: bugs traced to agent-authored changes after merge.
  4. CI pass rate on first push for agent branches.
  5. Cost per run and cost per merged change, from the run log.
  6. Blocked actions per week, as a sign the guardrails are working or the instructions need fixing.

To talk through your repository and where this would help, contact us.

How pricing works

We quote every project individually, from the number of systems, integrations, call or message volume and how much is custom. Tell us what you need and we reply with a written quotation.

Get a Quotation →

Frequently Asked Questions

Can Claude Code run unattended in CI?

Yes. Anthropic documents a non-interactive mode, claude -p, and a GitHub Action that can run on events such as issue comments or schedules. Unattended runs need explicit tool permissions and a permission mode that denies anything needing a prompt, because nobody is there to answer.

Can it be stopped from touching certain files or commands?

Yes, in two ways. Permission rules limit which commands it may run, and a PreToolUse hook can block a call by exiting with code 2, sending the reason back to the agent. We combine both and check they work with test runs.

Should Claude Code be allowed to merge its own pull requests?

We would not allow it. The agent opens a draft pull request, branch protection requires your normal CI and a developer's approval, and the person merging takes responsibility for the change. Self-approval is excluded by design.

Where do the API keys live?

In your CI secret store, referenced by name in the workflow, never committed to the repository. Anthropic's documentation says to store credentials as GitHub secrets. We also keep production credentials and deployment tokens out of the job's environment altogether.

Is this the same as using Claude Code on a developer's laptop?

No. Interactive use depends on each developer approving actions as they go. Unattended tooling has fixed instructions, limited permissions, a defined output and a log, so the controls must be set up in advance.

What does it cost to set up?

We quote after reviewing your repository and the chores you want covered. The quote reflects how many jobs are involved, how complex your CI and branching rules are, and how much review tooling you want. Model usage under your own account is charged by Anthropic, separately.

Want this for your business?

Free consultation, no pressure: just a clear plan and a written quotation.

Get a Free Consultation
Get a written quote