Why I Wrote cras and schain

Posted on Dec 27, 2021

I hope you’re all having a great Christmas season! I’ve been doing okayish and there’s a lot to talk about… about feeling tired, dropping good habits because of that, sorts of slowly slipping down a dangerous slope of resignation… ‘Tis the end of the year and it’s a time where I guess this is quite likely to happen? The thing is that two projects of mine have come in very handy precisely to combat this, and fight off the inertia: cras and schain!

I’ve got a very bad character trait… When I feel troubled, my first reaction is to give into… staying in bed. I don’t commiserate myself, but I do give into a narrative that goes like this: “I’m so tired from all these struggles…” Up to some point that can be healthy. Feeling tired or burnt out is definitely a sign that you must take care of yourself. However, what I don’t think is healthy is that you submit to it and lose track of everything you’ve been doing. I’m very vulnerable to the latter, sadly.

So, cras is a task list manager with a twist. It makes the task list unavailable the day after it was set for. One thing I hate most of most task list managers is that they roll your pending tasks over to the next day. To me, that feels like cheating if you really wanna get things done on a specific date. So, cras forces you to do two things:

  1. Plan for tasks that you can reasonably do today.
  2. Think of every day as a clean slate: Every day is a new beginning.

Psychologically, at least for me, this works wonders.

Now, I know that this is an evil tool, but cras has a light dopamine-kick mechanism built-in. The task list being deleted1 has a sorts of “gamification” effect (which I personally make it double with how I use schain, as I’ll explain later). But to me, the key one is cras outputting the task again marked as [DONE] when you mark it as such… even though that definitely goes against the Rule of Silence in UNIX philosophy. If you ever wondered why cras is so exceptionally verbose among my projects, that’s why.2

Enter schain. This is a project I many times have wondered if it shouldn’t just be a shell script and call it a day. I’ve also wondered many times if I shouldn’t merge it into cras somehow. Truth is… it works great as is. I know schain is one of the least understood projects of mine, from DMs and emails I’ve gotten over time. Its name comes from the Stoic idea of counting a chain of days in which you’ve committed to some habit. It’s basically a tool to count days, store the count into a file, and easily manipulate that count. Maybe a bit overkill to write in C, but who gives.

The way I use schain is to keep a count of days I’ve done all tasks I’ve entered into cras. If one day I failed to do everything I’ve registered on cras, I reset the count to zero. You’ve probably heard this, but there is this idea that your brain sets some activity as an habit if you do it for 21 days straight and sets it as a lifestyle if you do for 90 days straight. I’m pretty sure that’s just coaching BS and that the actual science behind this is way more complex, but hey… I guess the intuition behind it isn’t bad… and it won’t hurt anyways trying to commit to good habits by counting your progress, right?

OK, now disclosure time. There’s a Who Watches The Watcher? issue in all of this… All of this implies me commiting to using these tools! And I can tell you, this is almost a 1:1 scenario: the moment I stop using these tools, my life sinks into bad times… and possibly viceversa. This is the kind of problems not even all tech in the world will be able to solve for us… Having cras integrated into my WM status bar helps, because it’s a constant reminder that I should be using it, but God knows I’ve also been able to ignore that as well.

Keeping a healthy life is hard. Entropy is a thing. The easy thing is to sink into nothingness. And after two years of a pandemic, nothingness is certainly tempting. And I know people see me as this super-strong woman who’s been able to overcome lots and lots of challenges. A friend of mine told me a couple of days ago that he admired me and that he thinks of me as made of steel. I thanked him for the sweet compliment… but the fact is that I’m human and my energies are limited. The temptation of giving into not doing anything is always there.

But I do believe life is what you make of it. I believe whoever we are and whatever you wanna do, it’s worth at least the try. Maybe my tools might help you? I know some people use cras out there and I’m super grateful for that. But I’m a hobbyist; I don’t care about user numbers. It’s about mental health and keeping up with good habits that help you make your dreams become true!

I believe in you! 💝


  1. Well, it isn’t actually. It’s considered invalid. You could cheat this off if you read the source code like for two minutes and play around the file format. But… if I the lead developer don’t that, then you shouldn’t either! ↩︎

  2. It’s also the project which I refrain adding features to the most. At the time of writing this post I’ve got a local branch pending to merge into master implementing a new feature… I haven’t merged it just because I’m not totally convinced it’s really useful. ↩︎