How to Configure the Notification Script in Deep Code: A Complete Guide

Deep Code executes a custom notification script automatically after every model turn when you specify the absolute path in the notify configuration field, piping the model's full output to STDIN for processing.

Configuring the notification script in Deep Code enables you to extend the agent's capabilities with custom alerts, logging, or third-party integrations. According to the deepseek-ai/awesome-deepseek-agent source code, this feature is controlled through a single configuration key that triggers your executable immediately after each model turn completes. The script receives the model's response through standard input, allowing you to parse, forward, or store the output as needed.

Understanding the Notification System

Deep Code's notification system provides a simple hook mechanism that runs synchronously after the model generates a response. As documented in docs/deepcode.md at line 52, the notify option accepts an absolute file path to any executable script. When triggered, the system spawns the script and writes the complete model output to its STDIN stream, enabling real-time processing without modifying the core agent logic.

Step-by-Step Configuration

Create Your Notification Script

Write an executable script in any language that reads from standard input. The script must handle the model output passed via STDIN, not command-line arguments. You can use bash, Python, Node.js, or any other runtime available on your system.

Place your script in a persistent location such as ~/.deepcode/scripts/ to ensure Deep Code can access it consistently across sessions.

Make the Script Executable

Before Deep Code can invoke your script, you must set the executable permission bit:

chmod +x /path/to/your-notification-script.sh

Without executable permissions, the agent will fail to spawn the process when attempting to trigger the notification.

Configure the notify Option

Add the notify key to your Deep Code configuration file with the absolute path to your script. The configuration resides in either the global user config at ~/.deepcode/config.yaml or the project-specific config at ./.deepcode/config.yaml.


# ~/.deepcode/config.yaml

notify: /Users/you/.deepcode/scripts/notify.sh

Deep Code checks for ./.deepcode/config.yaml first in the current project directory, then falls back to ~/.deepcode/config.yaml if the project-level configuration does not exist.

Practical Notification Script Examples

macOS Desktop Alerts with Bash

This bash script reads the model output from STDIN and displays a native macOS notification using osascript:

#!/usr/bin/env bash

# ~/.deepcode/scripts/notify.sh

output=$(cat)  # Capture the entire model turn output from STDIN

osascript -e "display notification \"$output\" with title \"Deep Code\""

Set the permissions and update your config:

chmod +x ~/.deepcode/scripts/notify.sh

# ~/.deepcode/config.yaml

notify: /Users/you/.deepcode/scripts/notify.sh

Slack Integration with Python

For team notifications, use this Python script to POST the model output to a Slack webhook:

#!/usr/bin/env python3
import sys, json, urllib.request

WEBHOOK_URL = "https://hooks.slack.com/services/XXX/YYY/ZZZ"

message = sys.stdin.read()
payload = json.dumps({"text": f"*Deep Code:* {message}"}).encode("utf-8")
req = urllib.request.Request(
    WEBHOOK_URL, 
    data=payload,
    headers={"Content-Type": "application/json"}
)
urllib.request.urlopen(req)

Make it executable and configure:

chmod +x ~/deepcode/notify_slack.py
notify: /home/you/deepcode/notify_slack.py

Using Environment Variables for Secrets

To avoid hardcoding sensitive URLs in your scripts, export environment variables before running Deep Code:

export SLACK_WEBHOOK="https://hooks.slack.com/services/XXX/YYY/ZZZ"

Then modify your Python script to read the variable:

import os
webhook = os.getenv("SLACK_WEBHOOK")

This approach keeps credentials out of version control while maintaining full functionality.

Configuration File Locations and Precedence

Deep Code supports two configuration file locations with specific precedence rules:

  1. Project-level: ./.deepcode/config.yaml inside your current working directory takes highest priority
  2. User-level: ~/.deepcode/config.yaml serves as the global fallback configuration

When you run Deep Code, it first searches for the project-specific configuration. If the file does not exist or lacks the notify key, the agent loads settings from the user-level configuration. This structure allows you to set global defaults while overriding them per project as needed.

Summary

  • The notify option in ~/.deepcode/config.yaml or ./.deepcode/config.yaml accepts an absolute path to your executable script
  • STDIN input: The script receives the complete model output through standard input, not command-line arguments
  • Execution timing: Deep Code spawns the script automatically after every model turn completes
  • Language flexibility: Any executable file works—bash, Python, Node.js, or compiled binaries
  • Security: Use environment variables to pass secrets like API keys rather than hardcoding them in scripts

Frequently Asked Questions

What arguments does the notification script receive?

The notification script receives no command-line arguments. Instead, Deep Code pipes the entire model output to the script's STDIN stream. You must read from standard input within your script using cat, sys.stdin.read(), or equivalent methods in your chosen language.

Can I use any programming language for the notification script?

Yes. Deep Code treats the notify path as an executable file and spawns it directly. You can write the script in Python, Node.js, Ruby, Rust, or any other language provided the file has the executable bit set (chmod +x) and includes the correct shebang line (e.g., #!/usr/bin/env python3).

Where is the notify option documented?

The notify configuration option is documented in the official Deep Code reference at docs/deepcode.md line 52 within the deepseek-ai/awesome-deepseek-agent repository. This documentation specifies that the value must be an absolute path to an executable script that Deep Code will spawn after each model turn.

How do I disable notifications once configured?

To disable notifications, either remove the notify key from your configuration file or comment it out with a # prefix. Alternatively, you can delete or rename the script file referenced by the notify path, though removing the configuration key is the recommended approach to prevent execution errors.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →