How to use Claude to audit and repair Shared Brain
Claude audited Shared Brain, repaired regex, path, and shell-input flaws, and added targeted tests; the owner kept the resulting commits local for review.
Suggested prompt
Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.
Audit our lesson-checking CLI in a separate Claude session. Check regex denial of service in hooks, lesson-ID path traversal, and shell expansion of tool input. Reproduce each candidate, add bounded execution and containment fixes with regression tests, and leave all changes as local commits for my review before any push.
Reach people exploring AI agents
See placements →What happened
The author reports three repaired security issues and 23 targeted passing tests, packaged as local commits awaiting human review rather than a published release.
Reported by Yurukusa — DEV CommunityHow the agent did it
- The coordinator dispatched a security review of the Shared Brain codebase to Claude Code.
- Claude repaired regex execution, lesson-path containment, and shell-input handling, then added regression cases.
- The resulting commits stayed local and unpushed until the owner could review them.
Where a person stepped in
Yurukusa supplied priorities and retained manual review and publishing control. All overnight commits were explicitly unpushed when the account was written.
Yurukusa’s overnight agent run included a security review of Shared Brain, a command-line tool that stores lessons and checks risky operations. A Claude Desktop coordinator dispatched the work, while Claude Code read files, implemented changes, ran checks, and created local commits.
For the audit, a Sonnet-based executor examined code previously written with Opus. The author reported three high-severity candidates: a regular expression could stall the pre-tool hook, lesson identifiers could escape the storage directory, and shell expansion could interpret tool input as a command.
The repairs added a heuristic filter for problematic regex patterns plus a subprocess timeout, restricted lesson identifiers and checked resolved path containment, and read hook input from an environment variable instead of expanding it in a shell command. Claude also added targeted regression cases for the three issues.
The author reported the checks passing, but left all overnight commits local and unpushed for human review. The surrounding automation had brittle terminal and browser bridges and had previously approached destructive publishing actions. This account therefore demonstrates an agent-produced audit and repair package awaiting review, with explicit evidence that autonomy ended before publication.
Prompt
Suggested prompt (written by Agents In Use, not the author's)
Source: DEV Community · Yurukusa
Frequently asked questions
Which code did the auditor inspect?
Shared Brain code previously written with another Claude model.
How was regex execution bounded?
A heuristic validator was combined with a subprocess timeout.
Were the overnight commits published automatically?
No. They remained local and unpushed for human review.
More details
About this account
The coordinator dispatched a security review of the Shared Brain codebase to Claude Code. Claude repaired regex execution, lesson-path containment, and shell-input handling, then added regression cases.
The article reports the security portion of a larger overnight run. Do not treat all task counts as independently verified or local commits as published. Original task prompt was not shared. Suggested prompt written by Agents In Use; no original task prompt was published in the verified account.
Credit: Yurukusa — DEV Community
Source published 14 Feb 2026
Source checked 14 Oct 2026
Tools and topics
Claude Code · Claude Desktop · Python · tmux
security audit · regression tests · local commits
Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.