Wednesday, September 9, 2026

SAW: Build Structured Multi-Agent AI Workflows on Linux

https://www.tecmint.com/safe-agentic-workflow-linux

SAW: Build Structured Multi-Agent AI Workflows on Linux

Vulnerability Manager Plus
Learn how to install safe-agentic-workflow (SAW) on Linux, add it to a project alongside Claude Code, and use it to process a real task through its multi-agent workflow with Node.js and Git.

If you ask Claude Code to fix a single bug, it will usually do a good job. But as projects grow and you start handling multiple bugs across different files over several days, things can become inconsistent.

One agent might skip running tests, another might make changes you didn’t ask for, and it can be difficult to track who approved what. SAW is designed to solve these problems by adding a clear, structured workflow instead of relying on increasingly complex prompts.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.

What SAW Actually Is

SAW, short for SAFe Agentic Workflow, is a structured workflow that works alongside Claude Code. Instead of relying on a single AI agent to handle everything, SAW divides the work into clearly defined roles. It does this by adding a collection of Claude Code slash commands, agent definitions, and hooks to your project’s .claude directory.

Each agent has a specific responsibility. For example, the BSA (Business Systems Analyst) creates the requirements and acceptance criteria, Developer agents implement the changes, the QAS (Quality Assurance Specialist) reviews and approves the work before it moves forward, and the RTE (Release Train Engineer) coordinates the overall workflow and pull request.

The biggest advantage of SAW is that it prevents agents from making assumptions. If a task doesn’t include clear acceptance criteria, the Developer agent won’t start working on it. Instead, it sends the task back to the BSA to clarify the requirements.

This simple approval gate helps keep everyone working toward the same goal and reduces unexpected changes.

For this guide, we tested SAW on Ubuntu 26.04 LTS and RHEL 10. However, because SAW mainly consists of shell scripts and Markdown files stored in your project’s repository, it can run on almost any modern Linux distribution as long as Git and Node.js are installed.

Reload Your Shell

If you’ve just updated your shell configuration, reload it so the changes take effect:

source ~/.bashrc

This command reloads your current shell session without requiring you to log out or open a new terminal window.

Want to learn Claude Code from the ground up? Check out our Claude Code for Linux course, where you’ll learn to install, configure, and use Claude Code to build, debug, and automate real-world development workflows.

Prerequisites

Before you install SAW, make sure you have Git, Node.js, and Claude Code installed.

  • Git is used to clone the SAW repository and manage your project.
  • Node.js is required because SAW uses Node-based tools and scripts.
  • Claude Code is the AI coding assistant that SAW is designed to work with.

Install Git and Build Tools on Ubuntu/Debian

sudo apt update
sudo apt install -y git curl build-essential

Install Git and Build Tools on RHEL/Rocky Linux

sudo dnf install -y git curl gcc make

The sudo command runs a command with administrator (root) privileges. Installing software writes files to system directories that a regular user cannot modify, so these commands require sudo.

If you receive a Permission denied error during installation, make sure you’re running the command with sudo.

Install NVM (Node Version Manager)

SAW specifies the Node.js version it expects in a file named .nvmrc. Instead of using the Node.js version provided by your Linux distribution, it’s better to install NVM (Node Version Manager).

NVM makes it easy to install and switch between different Node.js versions.
Install NVM with:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

After the installation finishes, reload your shell so the nvm command becomes available:

source ~/.bashrc

This command reloads your current shell configuration without requiring you to open a new terminal window.

If SAW’s automation has made your workflow easier, share this guide with a teammate who’s still copy-pasting AI-generated code by hand.

Step 1: Clone the SAW Repository

The first step is to clone the SAW repository. This creates a local copy that you’ll use to copy the required files into your own project. You won’t be developing directly inside this cloned directory.

Clone the repository and switch to it:

git clone https://github.com/bybren-llc/safe-agentic-workflow.git
cd safe-agentic-workflow
nvm install
nvm use

The nvm< install command reads the .nvmrc file in the repository and installs the required Node.js version if it isn’t already available on your system. The nvm use command then switches your current shell session to that version so SAW runs with the environment it was designed for.

Here’s what each command does:

  • git clone downloads the complete SAW repository, including configuration folders such as .claude/, .gemini/, .codex/, and .cursor/ for the supported AI providers.
  • cd safe-agentic-workflow changes your current directory to the cloned repository so the remaining commands run in the correct location.
  • nvm install checks the .nvmrc file and installs the required Node.js version if it’s not already installed.
  • nvm use switches your current terminal session to use that Node.js version.

Step 2: Copy SAW into Your Project

SAW isn’t installed like a typical software package. Instead, you copy its configuration files into the project where you want to use it. If you’re using Claude Code, you’ll copy the .claude directory into your project’s root directory.

Run the following command:

cp -r .claude/ /path/to/your-project/.claude/
cd /path/to/your-project

Replace /path/to/your-project/ with the actual path to your project. Throughout this guide, placeholders enclosed in angle brackets, such as, represent values that you should replace with your own.

The first command copies the entire .claude directory, including the agent definitions, slash commands, and workflow files, into your project. The second command changes to your project’s directory so you can continue the setup from there.

If your team uses another supported AI coding assistant, you can copy the corresponding configuration directory instead. For example, copy .gemini/ for Gemini CLI or .cursor/ for Cursor using the same approach.

Step 3: Customize the Project Placeholders

The SAW templates include placeholder values such as {{TICKET_PREFIX}} and {{PROJECT_NAME}}. Before you start using the workflow, replace these placeholders with values that match your project.

Run the setup script:

bash scripts/setup-template.sh

The script will prompt you for a few details, including your project name and a ticket prefix. For example, if your issue tracker uses ticket IDs likeTEC-123, enter TEC as the ticket prefix.

After the script finishes, open the .claude/SETUP.md file and verify that all placeholders have been replaced. If you still see values such as {{TICKET_PREFIX}} or {{PROJECT_NAME}}, update them before continuing.

Leaving placeholder values in the configuration can cause agent prompts and handoff templates to contain incomplete or incorrect information later.

If you’ve ever seen an AI agent make up requirements because the original task wasn’t clear, you’ll appreciate why SAW exists. Its stop-the-line workflow forces missing requirements to be clarified before any code is written, helping keep every agent focused on the work you actually asked for.

If you found this guide helpful, share it with someone who wants more predictable and reliable AI-assisted development.

Step 4: Run Your First Ticket

After copying and configuring SAW, you’re ready to use it with Claude Code.

Start Claude Code from your project’s root directory:

claude

When the Claude Code session opens, start working on a ticket using the slash command provided by SAW:

/start-work TEC-123

Replace TEC-123 with the actual ticket ID from your project.

When you run this command, the BSA (Business Systems Analyst) agent starts first. Its job is to check whether the ticket includes clear acceptance criteria and a defined “Definition of Done.

If either of these is missing, the workflow stops and asks you to add the required information before any implementation begins.

This behavior is intentional. Instead of letting an AI guess what needs to be done, SAW requires the task to be clearly defined first. This helps reduce mistakes and keeps the implementation aligned with the original requirements.

Once the ticket has complete acceptance criteria, the appropriate Developer agent begins implementing the changes. After finishing, it hands the work over with a “Ready for QAS” status.

The QAS (Quality Assurance Specialist) agent then reviews the implementation against the same acceptance criteria before the changes can move forward to a pull request.

This structured workflow helps ensure that every stage of the task is reviewed before it is considered complete.

If your team has ever shipped a fix that accidentally skipped testing, share this guide with your team lead before it happens again.

Key SAW Commands

As you work with SAW, you’ll mainly use the following slash commands to manage tickets and move them through the workflow.

Command Purpose
/start-work TEC-123 Starts work on a ticket and checks that it has valid acceptance criteria and a Definition of Done (DoD) before implementation begins.
/pre-pr Runs the required validation checks before creating or submitting a pull request.
/end-work Ends the current work session and cleans up the workflow state.
/check-workflow Shows the current status of a ticket and where it is in the SAW workflow.

These commands provide a consistent way to start work, validate changes, track progress, and finish tasks without manually managing the workflow.

If you’d like to learn more about using Claude Code, including agent orchestration, workflow automation, and practical examples, check out the Claude Code for Linux Sysadmins course, which covers the complete workflow from setup to advanced usage.

Running Agent Teams on a Remote Server

For longer or more complex projects, you can run SAW’s agent teams on a remote Linux server instead of your local machine. The dark-factory directory included with SAW is designed for this purpose.

It uses tmux to keep multiple agent sessions running in the background, even if you disconnect from the server.

This setup is useful for long-running tasks that may take hours to complete or when you don’t want to keep your laptop powered on throughout the process.

DigitalOcean offers cloud VPS plans starting at $4/month.

TecMint Pro members can also receive $200 in free credits to create their first server and follow along with this guide. We may earn a commission at no additional cost to you.

If you found SAW’s dark-factory tmux setup useful for running agents unattended, share this guide with others who are looking for a reliable way to keep AI agent workflows running on a remote Linux server without having to monitor a terminal continuously.

Common Mistake: Skipping the Manifest During Updates

A common mistake is updating SAW without using its manifest-based synchronization process. Older versions of SAW were typically updated by adding the repository as a Git remote and manually comparing changes with git diff.

While that approach still works in SAW v2.10.0, it doesn’t track which files you’ve customized. As a result, your local changes can be accidentally overwritten during an update.

Instead, initialize and use the manifest-based sync:

./scripts/sync-claude-harness.sh init
./scripts/sync-claude-harness.sh manifest init --yes
./scripts/sync-claude-harness.sh sync --version v2.10.0 --dry-run

Here’s what each command does:

  • ./scripts/sync-claude-harness.sh init initializes the synchronization environment.
  • ./scripts/sync-claude-harness.sh manifest init --yes creates a manifest that records the managed files in your project.
  • ./scripts/sync-claude-harness.sh sync --version v2.10.0 --dry-run previews the changes required to update to version v2.10.0 without modifying any files.

The --dry-run option is especially important because it shows exactly what will be updated before any changes are made. Review the output first, then rerun the sync command without --dry-run when you’re satisfied with the proposed changes.

What SAW Won’t Do for You

While SAW adds structure to AI-assisted development, it isn’t a complete project management solution or a replacement for good engineering practices.

According to the project’s documentation, SAW is primarily designed and tested for software development workflows. Support for other use cases, such as marketing, content creation, or research workflows, is available but hasn’t been validated as extensively in real-world production environments.

Similarly, SAW supports multiple AI coding assistants, including Claude Code, Gemini CLI, Codex CLI, and Cursor.

However, the Claude Code integration is currently the most mature and thoroughly tested. The integrations for Gemini CLI, Codex CLI, and Cursor are newer, so you may occasionally encounter limitations or need to make minor adjustments to fit your workflow.

If you’re using SAW with Claude Code for software development, you’re following the most established and well-tested path. If you’re using it for other domains or with newer integrations, be prepared to experiment and refine your setup as needed.

If this guide helped you set up a structured multi-agent workflow without building one from scratch, share it with your teammates or team lead so they can benefit from it too.
If you’re interested in building repeatable AI-powered workflows on Linux, check out our AI for Linux course, where you’ll learn how to create practical automations using tools like SAW and other AI-assisted development workflows.
Conclusion

You’ve successfully set up SAW by cloning the repository, copying the required files into your project, replacing the default placeholders with your own project details, and running your first ticket through the workflow.

Along the way, you also saw how SAW’s stop-the-line check ensures that work doesn’t begin until a ticket has clear acceptance criteria, and how the QAS approval step helps verify changes before they move forward.

The real strength of SAW isn’t just using multiple AI agents, it’s giving each agent a well-defined role and requiring work to pass through structured review stages.

This helps keep development consistent, reduces unnecessary changes, and makes it easier to track the progress of every task.

To see where your current work stands, run:

 /check-workflow

This command displays the current status of the workflow and shows which stage your ticket is in.

If this article helped, with someone on your team.

 

Saturday, March 14, 2026

MultiTail – What It Is and How It Can Make You a Better SysAdmin

https://idolinux.com/multitail-what-it-is-and-how-it-can-make-you-a-better-sysadmin

MultiTail – What It Is and How It Can Make You a Better SysAdmin

As a Linux administrator, you already know how important it is to master tools like iptables reject vs drop, netcat, df, du, kernel 6.19.3, the LS command, and vim. These are fundamentals. But once your infrastructure grows beyond a single service and a couple of log files, the classic tail -f workflow starts to feel painfully limited.

This is where MultiTail becomes a game changer.

In this in-depth guide, we’ll explore what MultiTail is, how it works, why it’s superior to traditional approaches, and how mastering it can seriously improve your effectiveness as a sysadmin.


What Is MultiTail?

MultiTail is a powerful terminal-based utility that allows you to view multiple log files simultaneously in a single terminal window. Think of it as tail -f on steroids.

Instead of opening several terminal tabs or splitting your screen with tmux, MultiTail creates dynamically managed panes inside one terminal session. Each pane can follow a different file, command output, or even network stream.

At its core, MultiTail is designed to:

  • Monitor multiple log files at once
  • Display them in split windows
  • Apply colorization rules
  • Merge multiple files into one unified view
  • Filter content live
  • Follow new files dynamically

If you manage web servers, databases, firewalls, containers, or microservices, this is not just convenient — it’s transformative.


Why tail -f Is No Longer Enough

Before diving into MultiTail, let’s be honest about traditional workflows.

Most admins start with:

tail -f /var/log/syslog

Then maybe:

tail -f /var/log/nginx/access.log

Then another terminal for:

tail -f /var/log/nginx/error.log

Soon you’re juggling:

  • Multiple SSH sessions
  • Split panes in tmux
  • Scroll chaos
  • Missed correlations between logs

Correlating events across multiple files in real time becomes difficult. When debugging production issues, seconds matter.

MultiTail solves this problem elegantly.


Installing MultiTail

On Debian/Ubuntu systems:

sudo apt update
sudo apt install multitail

On RHEL/CentOS (if available via EPEL):

sudo yum install multitail

To verify installation:

multitail --version

That’s it. No complex configuration required to get started.


Basic Usage: Viewing Multiple Files

The simplest use case:

multitail /var/log/syslog /var/log/auth.log

The terminal splits automatically into sections. Each file gets its own pane.

You can move between panes using keyboard shortcuts (like pressing b to switch windows).

Already more powerful than multiple tail -f sessions.


Vertical and Horizontal Splits

MultiTail allows layout control.

For vertical split:

multitail -s 2 /var/log/syslog /var/log/auth.log

For horizontal layout control:

multitail -l "tail -f /var/log/syslog" -l "tail -f /var/log/auth.log"

The -l option lets you monitor command output instead of just files.

This means you’re not limited to logs — you can monitor any command in real time.


Monitoring Commands Instead of Files

You can follow dynamic command outputs like:

multitail -l "dmesg -w" -l "journalctl -f"

Or combine log files and commands:

multitail /var/log/syslog -l "netstat -tulpn"

This is incredibly useful when debugging:

  • Network activity
  • Firewall events
  • Kernel messages
  • Service logs

Imagine diagnosing connectivity issues while watching firewall drops and application logs side by side.


Merging Multiple Logs Into One View

Sometimes separate panes are not what you want. You want a chronological, merged stream.

MultiTail can combine logs:

multitail -M /var/log/syslog /var/log/auth.log

This merges both files into a single window, ordered by timestamp.

This is extremely useful when correlating authentication failures with system events.


Automatic Detection of New Files

One powerful feature often overlooked: MultiTail can track files that appear dynamically.

Example scenario:

Your application generates logs like:

app-2026-03-01.log
app-2026-03-02.log

Instead of restarting your monitoring session daily, you can use wildcards:

multitail /var/log/app-*.log

It will follow newly created matching files automatically.

This is particularly useful in environments where logs rotate frequently.


Color Highlighting and Filtering

MultiTail supports automatic colorization and filtering.

You can filter a specific word:

multitail -e "ERROR" /var/log/syslog

Or display separate filtered views:

multitail -l "grep ERROR /var/log/syslog" -l "grep WARNING /var/log/syslog"

With color rules enabled, errors can appear red, warnings yellow, and info messages green.

This dramatically improves visual parsing speed during incident response.


Recursive Monitoring of Directories

If you need to monitor many logs recursively:

multitail -R 3 /var/log/

This searches log files recursively up to a specified depth.

For large infrastructures with complex logging trees, this feature saves enormous time.


Using MultiTail with systemd journalctl

Modern Linux systems use systemd, and logs often live in the journal.

You can combine MultiTail with journalctl:

multitail -l "journalctl -f -u nginx" -l "journalctl -f -u mysql"

Now you monitor multiple systemd services in parallel.

This avoids multiple terminal tabs and gives you synchronized visibility.


Navigating Inside MultiTail

MultiTail isn’t just a viewer — it’s interactive.

Common controls:

  • b – switch to next window
  • q – quit
  • Ctrl + c – stop command in active pane
  • Scroll up support (depending on configuration)
  • Resize windows dynamically

You’re no longer blind to previous output; you can inspect context more effectively than with plain tail -f.


Advanced Example: Real Incident Debugging

Let’s imagine a real production issue:

Users report slow logins.

You open:

multitail \
/var/log/nginx/access.log \
/var/log/nginx/error.log \
/var/log/auth.log \
-l "journalctl -f -u php-fpm"

In one terminal window you see:

  • Incoming requests
  • Backend errors
  • Authentication failures
  • PHP processing logs

Instead of context switching between terminals, everything appears in one place. Correlation becomes almost effortless.

This is where you transition from reactive administrator to proactive operator.


How MultiTail Makes You a Better SysAdmin

Mastering MultiTail improves you in multiple ways:

1. Faster Diagnosis

Less tab switching means faster thinking.
Faster thinking means faster resolution.

2. Better Event Correlation

Seeing logs side-by-side exposes patterns you would otherwise miss.

3. Reduced Cognitive Load

Instead of managing terminal sessions, you focus on the problem.

4. Improved Incident Handling

During outages, structure matters. MultiTail gives you structured visibility.

5. Stronger Command-Line Fluency

MultiTail encourages combining tools like:

  • grep
  • awk
  • journalctl
  • netstat
  • dmesg

This deepens your Linux proficiency overall.


MultiTail vs Alternatives

You could use:

  • tmux splits with multiple tail -f
  • watch command
  • less +F
  • GUI log aggregators

But MultiTail provides:

  • Native multi-pane layout
  • Built-in merging
  • Automatic file detection
  • Color coding
  • Interactive controls
  • Lightweight execution

No heavy centralized logging stack required.


Final Thoughts

If tools like df, du, vim, and the LS command are part of your daily routine, MultiTail deserves a place next to them.

It’s lightweight, powerful, and extremely practical.

You won’t notice how much time you’re wasting with traditional tail -f workflows — until you start using MultiTail.

After that, going back feels primitive.

In modern Linux environments where logs multiply rapidly and services interact constantly, MultiTail gives you clarity, speed, and confidence.

And those are exactly the qualities that separate average administrators from excellent ones.


Monday, July 14, 2025

How to Run a Python Script Using Docker

https://www.maketecheasier.com/run-python-script-using-docker

How to Run a Python Script Using Docker

Run Python Script Docker

Running Python scripts is one of the most common tasks in automation. However, managing dependencies across different systems can be challenging. That’s where Docker comes in. Docker lets you package your Python script along with all its required dependencies into a container, ensuring it runs the same way on any machine. In this step-by-step guide, we’ll walk through the process of creating a real-life Python script and running it inside a Docker container.

Why Use Docker for Python Scripts

When you’re working with Python scripts, things can get messy/complex very fast. Different projects need different libraries, and what runs on your machine might break on someone else’s. Docker solves that by packaging your script and its environment together. So instead of saying “It works on my machine”, you can be sure it works the same everywhere.

It also keeps your system clean. You don’t have to install every Python package globally or worry about version conflicts. Everything stays inside the container.

If you’re deploying or handing your script off to someone else, Docker makes that easy, too. No setup instructions, no “install this and that”. Just one command, and it runs.

Write the Python Script

Let’s create a project directory to keep your Python script and Dockerfile. Once created, navigate into this directory using the cd command:

mkdir docker_file_organizer
cd docker_file_organizer

Create a script named “organize_files.py” to scan a directory and group files into folders based on their file extensions:

nano organize_files.py

Paste the following code into the “organize_file.py” file. Here, we use two pre-built Python modules, named os and shutil, to handle files and create directories dynamically:

import os
import shutil

SOURCE_DIR = "/files"

def organize_by_extension(directory):
try:
for fname in os.listdir(directory):
path = os.path.join(directory, fname)
if os.path.isfile(path):
ext = fname.split('.')[-1].lower() if '.' in fname else 'no_extension'
dest_dir = os.path.join(directory, ext)
os.makedirs(dest_dir, exist_ok=True)
shutil.move(path, os.path.join(dest_dir, fname))
print(f"Moved: {fname} → {ext}/")
except Exception as e:
print(f"Error organizing files: {e}")

if __name__ == "__main__":
organize_by_extension(SOURCE_DIR)

In this script, we organize files in a given directory based on their extensions. We use the os module to list the files, check if each item is a file, extract its extension, and create folders named after those extensions (if they don’t already exist). Then, we use the shutil module to move each file into its corresponding folder. For each move, we print a message showing the file’s new location.

Create the Dockerfile

Now, create a Dockerfile to define the environment in which your script will run:

FROM python:latest
LABEL maintainer="you@example.com"
WORKDIR /usr/src/app
COPY organize_files.py .
CMD ["python", "./organize_files.py"]

We use this Dockerfile to create a container with Python, add our script to it, and make sure the script runs automatically when the container starts:

Create Docker File

Build the Docker Image

Before you can build the Docker image, you need to install Docker first. After that, run the following command to package everything into a Docker image:

sudo docker build -t file-organizer .

It reads our Dockerfile and puts together the Python setup and our script so they’re ready to run in a single container image:

Build Docker Image

Create a Sample Folder with Files

To see our script in action, we create a test folder named “sample_files” with a few files of different types. We created these files just to make the folder a bit messy and see how our Python script handles it:

mkdir ~/sample_files
touch ~/sample_files/test.txt
touch ~/sample_files/image.jpg
touch ~/sample_files/data.csv

Run the Script Inside Docker

Finally, we run our Docker container and mount the sample folder into it. The -v flag mounts your local “~/sample_files” directory to the “/files” directory in the container, which allows the Python script to read and organize files on your host machine:

docker run --rm -v ~/sample_files:/files file-organizer

Here, we use the --rm option to remove the container automatically after it finishes running, which saves disk space:

Run Script In Docker

In the end, we use the tree command to check if the files have been sorted into folders based on their extensions:

tree sample_files
Verify Result With Tree Command

Note: The tree command isn’t pre-installed on most systems. You can easily install it using a package manager like apt on Ubuntu, brew on macOS, and so on.

Final Thoughts

With your Python script running inside Docker, you’re all set to take full advantage of a clean, portable, and consistent development setup. You can easily reuse this containerized workflow for other automation tasks, share your script without worrying about dependencies, and keep your system clutter-free. As a next step, consider exploring how to build multi-script Docker images, schedule containers with cron jobs, or integrate your scripts with other tools like Git, Jenkins, or even cloud platforms to streamline your automation and deployment process.