Skip to content

VJsharan/causal-loop-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•΅οΈ CausalLoop

The AI That Fixes Systems, Not Just Symptoms

When a plane crashes, investigators don't just blame the pilotβ€”they fix the training, the gauges, and the rules. CausalLoop investigates your code the exact same way.


GitHub NPM Lyzr ADK Gemini 2.5 Pro MIT License GitAgent Hackathon



CausalLoop Cover


πŸ—‚οΈ Table of Contents


πŸ’‘ What is CausalLoop?

Have you ever had a bug that just kept coming back? Or wondered why your team keeps making the exact same mistakes?

CausalLoop is an AI assistant that lives directly in your terminal. It doesn’t just find bugsβ€”it figures out why they happened in the first place. Think of it as a strict system inspector for your software. When a mistake happens, most tools blame the developer. CausalLoop looks at your whole systemβ€”your rules, your tests, and your checksβ€”to find out which safety net failed.

"Instead of saying 'Bob wrote a bad line of code,' CausalLoop tells you: 'Your testing process is broken, your team skips reviews, and you have no automated checks to catch this error before it goes live.'"

It works across three timeframes:

  • Yesterday: It looks at your old code to find hidden problems and old passwords.
  • Today: It looks at current, live bugs and asks "Why?" over and over until it uncovers the real issue.
  • Tomorrow: It reviews new changes before they are merged, warning you if you are about to make an old mistake again.

🌟 Agent Features

Here is what the CausalLoop agent can do automatically for your project. All investigations stream their analysis instantly into your CLI, but also generate a rigorous .md markdown report saved directly to your filesystem, allowing your team to safely persist and reference the exact findings later.

Module What it does Goal Output
repo-autopsy 🩸 Deep scans your code for bad habits Find hidden problems autopsy-report.md
secret-scanner πŸ—οΈ Searches for accidentally saved passwords Keep data safe Terminal / Logs
dependency-audit πŸ₯« Checks your third-party packages Stop supply-chain risks Terminal / Logs
compliance-check πŸ“ Makes sure required standard files exist Keep projects tidy Terminal / Logs
mortem-interrogator 🚨 Reads real bugs and finds the true cause Stop the blame game systemic-finding.md
merge-risk πŸ›‘ Checks new code against old failures Stop repeat mistakes merge-risk.md

🧰 Live Tools Suite

CausalLoop operates with 6 distinct tool commands that you can execute at any time:


Scans the legacy codebase for security vulnerabilities

Hunts credentials & active private keys

Validates supply-chain architecture

Audits institutional git hygiene

Fetches live GitHub bugs & runs Five Whys

Pre-merge warnings on incoming PR diffs

πŸ”§ Native Tool Integrations

To execute its investigations autonomously, CausalLoop is equipped with 6 custom GitAgent-compliant capabilities defined securely inside the tools/ directory:

  • fetch-github-issues.yaml β€” Pulls live production bugs straight from the GitHub API.
  • run-grep-scan.yaml β€” Invokes ultra-fast C-based grep to search thousands of lines instantly.
  • list-directory.yaml β€” Maps out repository architecture natively.
  • read-file.yaml β€” Ingests application code directly from the filesystem.
  • write-file.yaml β€” Generates permanent Markdown reports of findings.
  • run-command.yaml β€” Executes static analysis testing natively.

🎬 Live Demo

Watch the Demo
Click above to watch the full project demonstration!

πŸ“Ί Interactive Previews

πŸ’» Welcome Screen & Easy Setup

Start by pointing CausalLoop at any repository URL. It will instantly download it securely and temporarily to begin analyzing.

Welcome Screen & CLI Menu

πŸŽ›οΈ Simple Action Menu

The built-in menu lets you pick exactly which investigation to run.

Features Menu

🩸 1. Codebase Autopsy

Scans for outdated logic, insecure functions, and messy code practices.

Repo Autopsy Scanning

πŸ—οΈ 2. Password & Key Scanner

Ensures no API keys or database passwords have been left in the text.

Secret Scanner Output

πŸ₯« 3. Third-Party Audit

Checks your npm or pip files to make sure other people's code isn't breaking yours.

Dependency Audit Checking

πŸ“ 4. Health Check

Verifies you have basic open-source health standards in place (Licenses, Readmes).

Compliance Checking

🚨 5. Live Bug Interrogation

Connects to GitHub, finds an open bug, and breaks down the real system failure behind it.

Mortem Interrogator Analysis

πŸ›‘ 6. Risk Prevention

Looks at newly proposed edits to ensure you don't repeat the errors found in the steps above.

Merge Risk Profiling


⚑ Installation Guide

πŸ“¦ Install via npm

CausalLoop is available as a global CLI tool on npm.

Quick Install

npm install -g @vjsharan/causal-loop-agent

Setup & Run

# 1. Get a free Gemini API key at https://aistudio.google.com

# 2. Go to any git repo
cd your-project

# 3. Create a .env file with your key
echo "GOOGLE_API_KEY=your_key_here" > .env

# 4. Run the investigator
causalloop

Tip

No cloning needed. Install once, use in any repository globally.

πŸ‘‰ View on NPM Registry


πŸ›‘οΈ Alternative: gitclaw Runtime

If you are already integrated with the GitAgent ecosystem:

npm install -g gitclaw
gitclaw --dir . --model gemini-2.5-pro "scan this repository for hardcoded secrets"

🐍 Alternative: Python Backend

For contributors or standalone forensic inference:

git clone https://github.com/VJsharan/causal-loop-agent.git
pip install -r requirements.txt
python run_lyzr.py --repo "https://github.com/facebook/react" --all

πŸ›οΈ Architecture Flow

Powered by Google Gemini

This map shows how CausalLoop gathers data, thinks about it, and delivers reports.

graph TD
    subgraph "Phase 1: Gathering"
        CLI("User Inputs Link")
    end

    subgraph "Phase 2: Connecting"
        ROUTER("System Decides Action")
        CLONE("Quickly Downloads Code")
        GREP("Scans High-Speed Files")
        API("Reads Web Issues")
    end

    subgraph "Phase 3: The Brain"
        LYZR("Lyzr Safety Guard")
        LLM("Gemini Super-Computer")
    end

    subgraph "Phase 4: Agent Rules"
        SOUL("Personality Profile")
        RULES("Strict Boundaries")
    end

    CLI --> ROUTER
    ROUTER --> CLONE
    CLONE --> GREP
    CLONE --> API
    GREP --> LYZR
    API --> LYZR
    SOUL -.-> LYZR
    RULES -.-> LYZR
    LYZR --> LLM
    LLM --> OUTPUT("Prints Clear Reports to User")

    classDef basic fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#f8fafc;
    classDef advanced fill:#1e293b,stroke:#a855f7,stroke-width:2px,color:#f8fafc;
    classDef intelligence fill:#334155,stroke:#10b981,stroke-width:2px,color:#f8fafc;
    classDef guidelines fill:#475569,stroke:#f59e0b,stroke-width:2px,color:#f8fafc;
    
    class CLI basic;
    class ROUTER,CLONE,GREP,API advanced;
    class LYZR,LLM intelligence;
    class SOUL,RULES guidelines;
Loading

🧩 Agent Identity Profile

CausalLoop operates based on immutable rules and injected domain knowledge that it will never disobey:

SOUL.md (Who it is)

"I am a forensic systems analyst... I treat 'we didn't know' as a catastrophic engineering failure, not an acceptable excuse."

knowledge/security-patterns.md (What it knows)

The agent's memory bank is pre-injected with modern security patterns, optimizing the model to explicitly hunt for severe security flaws, supply-chain vulnerabilities, and hardcoded secrets with maximum efficiency and speed.

RULES.md (What it must do)

🟒 Must Always πŸ”΄ Must Never
Find the absolute bottom-level root cause Pretend the first obvious problem is the whole truth
Provide exact line numbers as proof Make guesses without looking at the code
Predict what could go wrong next based on the past Blame failure on a human making a mistake

πŸ“Œ Project Settings

You can customize how the agent behaves by reading the settings file: agent.yaml.

Ensure you have your environment defined properly as shown in the install step:

  • LYZR_API_KEY: Required for agent memory and structure.
  • GOOGLE_API_KEY: Required for the AI thinking engine.

πŸ“ File Layout

causal-loop/
β”œβ”€β”€ πŸ€– agent.yaml              # The main settings for the agent
β”œβ”€β”€ 🧠 SOUL.md                 # Personality and mood
β”œβ”€β”€ πŸ“ RULES.md                # Things it is never allowed to do
β”‚
β”œβ”€β”€ 🐍 run_lyzr.py             # Advanced Python scripting engine
β”œβ”€β”€ πŸ“¦ index.js                # The visual menu you interact with
β”œβ”€β”€ πŸ”‘ .env                    # Where your passwords live (kept hidden)
β”‚
β”œβ”€β”€ πŸ“ dummy_repo/             # A safe playground with fake messy code
β”œβ”€β”€ πŸ“ skills/                 # The 6 investigation techniques
β”œβ”€β”€ πŸ“ tools/                  # Code that lets it read local files

πŸ’» Technology Stack

Name Role
gitagent Defines how the bot is supposed to act
Lyzr Orchestrates the steps and keeps it on track
Google The raw artificial intelligence smarts
gitclaw Used to run it directly from terminal

πŸ‘₯ Contributing

We love help! If you want to add code to this project, please make sure it aligns with the strict philosophy in the SOUL.md file. Remember: If a test breaks, we fix the test environment. We do not blame the contributor.


βš–οΈ License

MIT License


Built for the Lyzr Γ— GitAgent Hackathon 2026 πŸ†

Fix systems. Not people.

About

When your code breaks... CausalLoop doesn't ask who wrote it. It asks why your system let it break. Scans for vulnerabilities, audits your guardrails, and traces every failure back to what actually went wrong and not who messed up.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors