Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungRefreshed repository pull requests page generally available(22.09.2026 um 03:25 Uhr)
Sichere ProgrammierungThe Joy of Learning the Basics Again(22.09.2026 um 03:28 Uhr)
Sichere ProgrammierungZero-Code OpenTelemetry Tracing for Dagster(22.09.2026 um 03:39 Uhr)
Linux Tipps & Hardening`prime-all`(22.09.2026 um 02:28 Uhr)
IT Security Toolsopensoho v0.15.2(22.09.2026 um 03:33 Uhr)
IT Security NachrichtenUS Proposes AI Incident Alert System in Talks With China, Bessent Says(22.09.2026 um 04:01 Uhr)
Sichere ProgrammierungRefreshed repository pull requests page generally available(22.09.2026 um 03:25 Uhr)
Sichere ProgrammierungThe Joy of Learning the Basics Again(22.09.2026 um 03:28 Uhr)
Sichere ProgrammierungZero-Code OpenTelemetry Tracing for Dagster(22.09.2026 um 03:39 Uhr)
Linux Tipps & Hardening`prime-all`(22.09.2026 um 02:28 Uhr)
IT Security Toolsopensoho v0.15.2(22.09.2026 um 03:33 Uhr)
IT Security NachrichtenUS Proposes AI Incident Alert System in Talks With China, Bessent Says(22.09.2026 um 04:01 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Agent Watch:Stop Telling Your AI Agent the Same Thing Twice

This is a group submission for the GitHub Copilot CLI Challenge Introduction "Auto-sync your AI instructions with every commit using agent-watch", a git hook that reads your commits and conversations, then uses AI to keep all…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

This is a group submission for the GitHub Copilot CLI Challenge






Introduction



"Auto-sync your AI instructions with every commit using agent-watch", a git hook that reads your commits and conversations, then uses AI to keep all your agent instruction files current — so your AI tools always know what your codebase looks like today.






What We Built



AI coding assistants like Claude Code, GitHub Copilot, Cursor, Windsurf and Cline, each read an instruction file(CLAUDE.md, .cursorrules, copilot-instructions.md, etc.) to understand your project's conventions, architecture, and rules.

But here's the thing: Your codebase changes every day. Those instruction files don't.



You could refactor a module, swap a library or change an API pattern, yet your AI agent is still giving advice based on stale instructions. You are either manually updating those files (tedious) or you don't (getting worse AI suggestions over time).





What Agent Watch Does



It plugs into your git workflow and automatically updates your AI instruction files after every commit or push. No manual effort.



Here's the flow:




  • You commit code as usual.

  • A git hook fires and gathers context — what files changed, commit messages, diff stats, even your recent Copilot chat history.

  • It sends that context to GitHub Copilot CLI with a smart prompt.

  • Copilot decides whether your agent files need updating — if yes, it rewrites them; if not, it skips.



That's it. Your AI tools always have fresh, accurate instructions.





What This Means for You as a Developer




  • Your AI assistants get smarter over time — they learn as your codebase evolves, not just when you remember to update a config file

  • Zero maintenance overhead — you never touch those instruction files manually again.

  • Works with whatever AI tool you use — one tool keeps Claude, Copilot, Cursor, Windsurf, and Cline all in sync.

  • Doesn't slow you down — smart filtering skips running when you only change docs, lock files, or configs.

  • Fits your existing workflow — supports Lefthook, Husky, or plain git hooks. Just agent-watch init and forget about it.





The Bigger Picture



AI coding assistants are only as good as the context they have. Agent Watch closes the gap between what your codebase actually looks like and what your AI tools think it looks like. It turns static instruction files into living documents that evolve with your code.



It's a small tool that solves a real, growing pain point — and as AI-assisted development becomes the norm, keeping agent context fresh isn't optional anymore. It's table stakes.





How GitHub Copilot CLI is leveraged for this tool



Agent Watch doesn't contain any AI logic itself. It's purely plumbing — git hooks, file detection, context gathering, and state tracking. All the intelligence is delegated to GitHub Copilot CLI. Every time Agent Watch needs to understand code, generate content, or decide whether an agent file needs updating, it shells out to copilot -p with a carefully crafted prompt and uses the response. Copilot CLI is the brain; Agent Watch is the nervous system that triggers it at the right time with the right context.





3 Distinct Uses of Copilot CLI



1) Creating Missing Agent Files

During agent-watch init, if a selected agent file doesn't exist yet, Copilot CLI creates it. Two paths:




  • For .github/copilot-instructions.md — Runs copilot init (Copilot's built-in scaffolding)

  • For everything else (CLAUDE.md, .cursorrules, etc.) — Runs:



copilot -p "Create a <filename> file for this project. Analyze the codebase..." --allow-all-tools -s






Copilot reads the codebase and generates a tailored starting file.



2) Updating Agent Files on Every Commit

This is the core use. On each git hook trigger, Agent Watch builds a context string (commit message, changed files, diff stats, chat sessions) and for each managed agent file calls:




copilot -p "<prompt with current file content + recent context>" -s





The prompt tells Copilot to merge new patterns into the existing document and output the complete updated file — or exactly NO_UPDATE if nothing meaningful changed. Timeout is 90 seconds per file.



3) Extracting Chat Session History

Agent Watch mines your past Copilot conversations for insights:



copilot --resume <sessionId> -p "List every user request and your response..." -s






It discovers sessions from ~/.copilot/session-state/, filters to the current project, resumes each unprocessed session, and asks Copilot to summarize conversations in a structured USER: ... | AGENT: ...format. This context feeds into the update prompt above.





Installation



Global installation



npm install -g agent-watch





As a dev dependency



npm install -D agent-watch





or



pnpm add -D agent-watch





Or run directly without installation:



npx agent-watch init







Repository







GitHub logo

surnr
/
agent-watch



CLI tool that uses git hooks to keep your AI agent configuration files in sync with your codebase







Agent Watch




CLI tool that uses git hooks to keep your AI agent configuration files in sync with your codebase. It watches for commits or pushes, gathers context from git changes and chat sessions, and automatically updates your agent files.




Install




Global installation (recommended for CLI usage):




npm install -g agent-watch




As a dev dependency (for team consistency):




npm install -D agent-watch
# or
pnpm add -D agent-watch



Or run directly without installation:



npx agent-watch init




Quick start





cd your-project
agent-watch init



The init command walks you through an interactive setup:




  1. Select agent files - auto-detects existing files and lets you pick which ones to manage (space to toggle, enter to confirm)


  2. Git context - choose whether to use commit messages and chat sessions when updating files


  3. Hook trigger - pick when to run: after git commit or before git push


  4. AI agents - select which agent integrations to enable…












Contributors



@itsashita x @surnr

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Agent Watch:Stop Telling Your AI Agent the Same Thing Twice

Thematisch verwandte Begriffe: Agent, WatchStop, Telling, Your · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-49449 | Joplin is an open source note-taking and to-do application that organise…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick